gofmt: ran gofmt because noticed weird diffs in last commit, seemed OK though

This commit is contained in:
Patricio Whittingslow
2026-02-28 17:47:11 -03:00
parent f6e7801d8c
commit 02b4e71c2a
8 changed files with 19 additions and 21 deletions
+1 -1
View File
@@ -369,4 +369,4 @@ func getSrcIPPort(ipCarrier []byte) (srcaddr []byte, port uint16, err error) {
}
port = binary.BigEndian.Uint16(ipCarrier[off:]) // TCP and UDP share same port offsets.
return srcaddr, port, nil
}
}
+1 -1
View File
@@ -355,4 +355,4 @@ func TestServerRediscover(t *testing.T) {
if cl.State() != StateBound {
t.Errorf("second DORA: want StateBound, got %s", cl.State())
}
}
}
+2 -2
View File
@@ -259,8 +259,8 @@ func (d *dhcpInterceptor) buildARPReply(request []byte) {
// ARP reply.
afrm, _ := arp.NewFrame(buf[sizeEthernet:])
afrm.SetHardware(1, 6) // Ethernet, 6-byte addresses
afrm.SetProtocol(ethernet.TypeIPv4, 4) // IPv4, 4-byte addresses
afrm.SetHardware(1, 6) // Ethernet, 6-byte addresses
afrm.SetProtocol(ethernet.TypeIPv4, 4) // IPv4, 4-byte addresses
afrm.SetOperation(arp.OpReply)
replySndrHW, replySndrIP := afrm.Sender4()
*replySndrHW = d.svMAC
+5 -5
View File
@@ -11,11 +11,11 @@ import (
)
var (
ErrRingBufferFull = lneto.ErrBufferFull
errRingNoData = errors.New("lneto/ring: empty write")
errInvalidDiscard = errors.New("lneto/ring: invalid discard amount")
errDiscardExceeds = errors.New("lneto/ring: discard exceeds length")
errOffsetOverflow = errors.New("lneto/ring: offset too large (32 bit overflow)")
ErrRingBufferFull = lneto.ErrBufferFull
errRingNoData = errors.New("lneto/ring: empty write")
errInvalidDiscard = errors.New("lneto/ring: invalid discard amount")
errDiscardExceeds = errors.New("lneto/ring: discard exceeds length")
errOffsetOverflow = errors.New("lneto/ring: offset too large (32 bit overflow)")
)
// Ring implements basic Ring buffer functionality.
-1
View File
@@ -118,7 +118,6 @@ func (i6frm Frame) ClearHeader() {
// Validate API.
//
// ValidateSize checks the frame's size fields and compares with the actual buffer
// the frame. It returns a non-nil error on finding an inconsistency.
func (i6frm Frame) ValidateSize(v *lneto.Validator) {
+8 -8
View File
@@ -16,14 +16,14 @@ var (
errDropSegment error = lneto.ErrPacketDrop
errWindowTooLarge = errors.New("invalid window size > 2**16")
errBufferTooSmall error = lneto.ErrShortBuffer
errNeedClosedTCBToOpen = errors.New("need closed TCB to call open")
errInvalidState = errors.New("invalid state")
errConnNotExist = errors.New("connection does not exist")
errConnectionClosing = errors.New("connection closing")
errExpectedSYN = errors.New("seqs:expected SYN")
errBadSegack = errors.New("seqs:bad segack")
errFinwaitExpectedACK = errors.New("seqs:finwait1 expected ACK")
errBufferTooSmall error = lneto.ErrShortBuffer
errNeedClosedTCBToOpen = errors.New("need closed TCB to call open")
errInvalidState = errors.New("invalid state")
errConnNotExist = errors.New("connection does not exist")
errConnectionClosing = errors.New("connection closing")
errExpectedSYN = errors.New("seqs:expected SYN")
errBadSegack = errors.New("seqs:bad segack")
errFinwaitExpectedACK = errors.New("seqs:finwait1 expected ACK")
errWindowOverflow = newRejectErr("wnd > 2**16")
errSeqNotInWindow = newRejectErr("seq not in snd/rcv.wnd")
-1
View File
@@ -177,7 +177,6 @@ func (tfrm Frame) String() string {
// Validation API
//
// func (tfrm Frame) Validate(v *lneto.Validator) {
// tfrm.ValidateSize(v)
// tfrm.ValidateExceptCRC(v)
+2 -2
View File
@@ -214,7 +214,7 @@ func TestWindowReject_ChallengeACK(t *testing.T) {
t.Run("SeqNotInWindow", func(t *testing.T) {
tcb := setup()
retransmit := Segment{
SEQ: issB, // Before rcv.NXT (issB+512).
SEQ: issB, // Before rcv.NXT (issB+512).
ACK: issA,
Flags: FlagACK,
WND: 64240,
@@ -237,7 +237,7 @@ func TestWindowReject_ChallengeACK(t *testing.T) {
t.Run("LastNotInWindow", func(t *testing.T) {
tcb := setup()
seg := Segment{
SEQ: issB + 512, // At rcv.NXT (in window).
SEQ: issB + 512, // At rcv.NXT (in window).
ACK: issA,
Flags: FlagACK,
WND: 64240,