Subject: kern/8305: inet6: ndp gets confused on alpha
To: None <gnats-bugs@gnats.netbsd.org>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: netbsd-bugs
Date: 08/31/1999 22:09:54
>Number:         8305
>Category:       kern
>Synopsis:       inet6: ndp gets confused on alpha
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 31 21:50:01 1999
>Last-Modified:
>Originator:     Bill Sommerfeld
>Organization:
	
>Release:        19990831
>Environment:
	
	alpha pc164 running -current.

>Description:
	`ndp -an' output is confused on alpha:

Neighbor                      Linklayer Address   Netif Expire    St Flgs Prbs
ndp: ioctl: Device not configured
ndp: failed to get neighbor information
fe80:1::210:4bff:fe9d:5b5f    0:0:18:12:3:0      (null)         
ndp: ioctl: Device not configured
ndp: failed to get neighbor information
fe80:1::2e0:29ff:fe47:b485    0:0:18:12:1:0      (null)         
ndp: ioctl: Device not configured
ndp: failed to get neighbor information
fe80:1::a00:2bff:fe81:6007    0:0:18:12:1:0      (null)         

>How-To-Repeat:
	run `ndp -an'
>Fix:
	???

	from looking at src/usr.sbin/ndp/ndp.c, it looks like the
	program's expecting to find the routing table entries returned
	via sysctl as an rtm header, followed by two sockaddrs.

                rtm = (struct rt_msghdr *)next;
                sin = (struct sockaddr_in6 *)(rtm + 1);
                sdl = (struct sockaddr_dl *)(sin + 1);

However, when inspecting the actual block of memory returned by the
kernel, i find an extra 4 bytes (containing 0xdeadbeef) stuck in
between the two sockaddrs; when running under a debugger, manually
moving sdl 4 bytes later inside dump() causes the expected output to
look sane.



>Audit-Trail:
>Unformatted: