From 0fee59c8c84bff0185e681b4550ba077a65739f2 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Fri, 13 Nov 2020 17:11:12 -0800 Subject: Requested Comment/Message wording changes PiperOrigin-RevId: 342366891 --- test/packetimpact/testbench/connections.go | 2 +- test/packetimpact/testbench/layers.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/packetimpact/testbench/connections.go b/test/packetimpact/testbench/connections.go index 030a73c3c..919b4fd25 100644 --- a/test/packetimpact/testbench/connections.go +++ b/test/packetimpact/testbench/connections.go @@ -72,7 +72,7 @@ func pickPort(domain, typ int) (fd int, port uint16, err error) { } sa, err = unix.Getsockname(fd) if err != nil { - return -1, 0, fmt.Errorf("fail in Getsocketname(%d): %w", fd, err) + return -1, 0, fmt.Errorf("unix.Getsocketname(%d): %w", fd, err) } port, err = portFromSockaddr(sa) if err != nil { diff --git a/test/packetimpact/testbench/layers.go b/test/packetimpact/testbench/layers.go index 62473c577..7401a1991 100644 --- a/test/packetimpact/testbench/layers.go +++ b/test/packetimpact/testbench/layers.go @@ -410,13 +410,7 @@ func Address(v tcpip.Address) *tcpip.Address { // continues parsing further encapsulations. func parseIPv4(b []byte) (Layer, layerParser) { h := header.IPv4(b) - hdrLen := h.HeaderLength() - // Even if there are no options, we set an empty options field instead of nil - // so that the decision to compare is up to the caller of that comparison. - var options header.IPv4Options - if hdrLen > header.IPv4MinimumSize { - options = append(options, h.Options()...) - } + options := h.Options() tos, _ := h.TOS() ipv4 := IPv4{ IHL: Uint8(h.HeaderLength()), -- cgit v1.2.3