Re: cvs commit: src/sys/conf options src/sys/netinet ip_output.c

From: Maxime Henrion <mux_at_freebsd.org>
Date: Tue, 25 Mar 2003 23:20:16 +0100
Mike Silbersack wrote:
> FWIW, the two drivers I tested this with (if_xl and if_sis) both flunk.
> if_xl tries to fix the situation, but fails, and if_sis goes totally
> weird, eating mbufs and rendering the interface unuseable.
> 
> I'll test more interfaces once I have these two fixed.

Looks like there is a bug in this code.  I tried to understand what's
wrong in the if_xl code that tries to deal with mbuf chains containing
more than XL_MAXFRAGS mbufs, and noticed that m_head->m_pkthdr.len isn't
set properly.  The length of an mbuf chain shouldn't change when we're
just splitting it into more mbufs, so this is kinda weird.  Using
m_fixhdr() just after the splitting code solves it, but that's probably
just a workaround, and either m_split() or the MBUF_FRAG_TEST code needs
to be fixed.

That would be a very sufficient reason for this code to not work, but
unfortunately, it seems there are more bugs to fix.  However, I couldn't
even see the packet in tcpdump before, and I now can.  That means the
card has successfully queued the packet, otherwise it would not get
passed to BPF_MTAP() and it wouldn't show up in tcpdump.  Moreover, it
looks like the packet is valid, yet it seems it's not sent by the card
for some reason.  I couldn't figure out why yet.

I think we should have some code like this before handing a packet to a
network driver :

KASSERT(m0->m_pkthdr.len == m_length(m0, NULL), ("Bad packet header"));

Cheers,
Maxime
Received on Tue Mar 25 2003 - 14:20:17 UTC