summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6
diff options
context:
space:
mode:
authorChris Koch <chrisko@google.com>2023-02-18 14:24:41 -0800
committerChris K <c@chrisko.ch>2023-02-18 23:57:24 -0800
commit573052511f5790667b95f4a801f7ed0680a66a83 (patch)
tree3df91debad2b6976b0773c6f0e8904d26b8631ac /dhcpv6
parent8b3544ec108e0a730423f0027d03ac80e4b08ad0 (diff)
Consistent short string messages
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6')
-rw-r--r--dhcpv6/dhcpv6message.go10
-rw-r--r--dhcpv6/dhcpv6relay.go7
2 files changed, 7 insertions, 10 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index e2210fd..e68284f 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -202,8 +202,8 @@ func (mo MessageOptions) UserClasses() [][]byte {
//
// RFC 8415 Section 21.17:
//
-// Multiple instances of the Vendor-specific Information option may appear in
-// a DHCP message.
+// Multiple instances of the Vendor-specific Information option may appear in
+// a DHCP message.
func (mo MessageOptions) VendorOpts() []*OptVendorOpts {
opt := mo.Options.Get(OptionVendorOpts)
if opt == nil {
@@ -222,8 +222,8 @@ func (mo MessageOptions) VendorOpts() []*OptVendorOpts {
//
// RFC 8415 Section 21.17:
//
-// Servers and clients MUST NOT send more than one instance of the
-// Vendor-specific Information option with the same Enterprise Number.
+// Servers and clients MUST NOT send more than one instance of the
+// Vendor-specific Information option with the same Enterprise Number.
func (mo MessageOptions) VendorOpt(enterpriseNumber uint32) Options {
vo := mo.VendorOpts()
for _, v := range vo {
@@ -543,7 +543,7 @@ func (m *Message) IsOptionRequested(requested OptionCode) bool {
// String returns a short human-readable string for this message.
func (m *Message) String() string {
- return fmt.Sprintf("Message(messageType=%s transactionID=%s, %d options)",
+ return fmt.Sprintf("Message(MessageType=%s, TransactionID=%#x, %d options)",
m.MessageType, m.TransactionID, len(m.Options.Options))
}
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go
index 6245b81..ace35f7 100644
--- a/dhcpv6/dhcpv6relay.go
+++ b/dhcpv6/dhcpv6relay.go
@@ -94,11 +94,8 @@ func (r *RelayMessage) Type() MessageType {
// String prints a short human-readable relay message.
func (r *RelayMessage) String() string {
- ret := fmt.Sprintf(
- "RelayMessage(messageType=%s hopcount=%d, linkaddr=%s, peeraddr=%s, %d options)",
- r.Type(), r.HopCount, r.LinkAddr, r.PeerAddr, len(r.Options.Options),
- )
- return ret
+ return fmt.Sprintf("RelayMessage(MessageType=%s, HopCount=%d, LinkAddr=%s, PeerAddr=%s, %d options)",
+ r.Type(), r.HopCount, r.LinkAddr, r.PeerAddr, len(r.Options.Options))
}
// Summary prints all options associated with this relay message.