diff options
author | yongari <yongari@FreeBSD.org> | 2009-04-13 00:32:34 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2009-04-13 00:32:34 +0000 |
commit | 602feb88d638d3b2f8d937af06e35ce5c43774b9 (patch) | |
tree | 83241b6cf92c284cf9d261da68aa66a6b4b38264 /sys/dev/fxp/if_fxp.c | |
parent | 67227c12c0e0a27755a06861b476815955bd8b2b (diff) | |
download | FreeBSD-src-602feb88d638d3b2f8d937af06e35ce5c43774b9.zip FreeBSD-src-602feb88d638d3b2f8d937af06e35ce5c43774b9.tar.gz |
Don't blindly set IP packet length from interface MTU in TSO case.
Remote host can advertise smaller MSS than that of sender so upper
stack might have adjusted the MSS which in turn generates IP
packets that are less size than that of interface MTU.
Reported by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de )
Tested by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de )
MFC after: 3 days
Diffstat (limited to 'sys/dev/fxp/if_fxp.c')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 352a2b0..0bddd17 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1485,7 +1485,8 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) * checksum in the first frame driver should compute it. */ ip->ip_sum = 0; - ip->ip_len = htons(ifp->if_mtu); + ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) + + (tcp->th_off << 2)); tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP + (tcp->th_off << 2) + m->m_pkthdr.tso_segsz)); |