Subject: Re: if_fddisubr.c fix for netiso
To: None <tech-net@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-net
Date: 12/05/2006 10:12:13
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);
3?
> case LLC_XID_P:
> - if(m->m_len < 6)
> + if(m->m_len < 6 + sizeof(struct fddi_header))
> goto dropanyway;
6?
> l->llc_window = 0;
> l->llc_fid = 9;
9?
Dave
--
David Young OJC Technologies
dyoung@ojctech.com Urbana, IL * (217) 278-3933