Subject: Re: if_fddisubr.c fix for netiso
To: None <firstname.lastname@example.org>
From: Ignatios Souvatzis <email@example.com>
Date: 12/05/2006 17:23:21
On Tue, Dec 05, 2006 at 10:12:13AM -0600, David Young wrote:
> On Tue, Dec 05, 2006 at 01:34:59PM +0100, Ignatios Souvatzis wrote:
> > Here's part two of the patches, for FDDI (again, netiso/clnp_input.c and
> > netinet/fddi_subr.c). Sorry, wrong subject on the first try, and I fear
> > the designated alpha testers wouldn't see it.
> > I did test that it compiles, but not run-time - no FDDI here. Testers
> > can use the package at
> > ftp://ftp.netbsd.org/pub/NetBSD/misc/is/isotest/
> > It comes with a README file that explains how to setup two machines and
> > send an ISO CLTP packet from one to the other.
> I count at least three anonymous numbers (see below). I am mystified. :-)
> > Index: sys/netiso/clnp_input.c
> > ===================================================================
> > RCS file: /cvsroot/src/sys/netiso/clnp_input.c,v
> > retrieving revision 1.31
> > diff -u -r1.31 clnp_input.c
> > --- sys/netiso/clnp_input.c 1 Dec 2006 18:43:40 -0000 1.31
> > +++ sys/netiso/clnp_input.c 4 Dec 2006 21:20:11 -0000
> > @@ -204,9 +204,8 @@
> > case IFT_FDDI:
> > bcopy((caddr_t) (mtod(m, struct fddi_header *)->fddi_dhost),
> > (caddr_t) sh.snh_dhost, 2 * sizeof(sh.snh_dhost));
> > - m->m_data += sizeof(struct fddi_header);
> > - m->m_len -= sizeof(struct fddi_header);
> > - m->m_pkthdr.len -= sizeof(struct fddi_header);
> > +
> > + m_adj(m, sizeof(struct fddi_header) + 3);
That's LLC_UFRAMELEN, and anonymous in the old version of the code, too.
I planned to replace that seperately, but could do that in the same step, if
> > case LLC_XID_P:
> > - if(m->m_len < 6)
> > + if(m->m_len < 6 + sizeof(struct fddi_header))
> > goto dropanyway;
I didn't change the 6. No idea. Just changed the length offset as above.
> > l->llc_window = 0;
> > l->llc_fid = 9;
I didn't change the 9. No idea. Just changed the length offset as above.
I notice you didn't complain when I posted and committed the ether_subr
code, which is the same...
I guess you can look them up in 802.2 .
(And IMO, that code should not depend on the llc SAP codes, but be generic
for all that has an LLC the the LLC commands involved. But I won't change
that with this change.