mirror of
https://github.com/soypat/lneto.git
synced 2026-09-12 01:29:30 +00:00
Tcp buffer bug fix (#79)
* start working on tracking down tcp buffer bug * mtu refactor * modularize test * more precise testing * tests fail, but is it the failure we are looking for? * fix typo in espradio link (#76) * implement a new backoff abstraction (#75) * rewrite backoff api * rewrite tcp.Conn.Write * keep fixing small things * much better Conn.Read implementation * fix critical overflow bug in internal.ConnRWBackoff --------- Co-authored-by: Joel Wetzell <jwetzell@yahoo.com>
This commit is contained in:
@@ -17,9 +17,9 @@ import (
|
||||
)
|
||||
|
||||
func FuzzStackPacketHTTP(f *testing.F) {
|
||||
const MTU = 1500
|
||||
const MTU = ethernet.MaxMTU
|
||||
const seed = 1
|
||||
var buf [MTU + ethernet.MaxOverheadSize]byte
|
||||
var buf [ethernet.MaxFrameLength]byte
|
||||
s1, s2, c1, c2 := newTCPStacks(f, seed, MTU)
|
||||
var hdr httpraw.Header
|
||||
err := s1.ListenTCP(c1, 80)
|
||||
@@ -78,7 +78,7 @@ func FuzzStackPacketHTTP(f *testing.F) {
|
||||
}
|
||||
|
||||
f.Fuzz(func(t *testing.T, pktnum int, a []byte) {
|
||||
var buf [MTU + ethernet.MaxOverheadSize]byte
|
||||
var buf [ethernet.MaxFrameLength]byte
|
||||
s1, s2, c1, c2 := newTCPStacks(t, seed, MTU)
|
||||
err = s1.EnableICMP(true)
|
||||
if err != nil {
|
||||
@@ -268,8 +268,8 @@ func testStackSeeded(t *testing.T, seed1, seed2 int64) {
|
||||
}
|
||||
}
|
||||
|
||||
const mtu = 1500
|
||||
const mfl = mtu + 14 // frame length includes ethernet header
|
||||
const mtu = ethernet.MaxMTU
|
||||
const mfl = mtu + ethernet.MaxOverheadSize // frame length includes ethernet header
|
||||
var buf [mfl]byte
|
||||
var s1, s2 StackAsync
|
||||
v1, v2 := byte(seed1), byte(seed2)
|
||||
|
||||
Reference in New Issue
Block a user