Subject: kern/23990: comment if net/if_dl.h says AF_DLI rather than AF_LINK
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gdt@ir.bbn.com>
List: netbsd-bugs
Date: 01/05/2004 12:51:54
>Number: 23990
>Category: kern
>Synopsis: comment if net/if_dl.h says AF_DLI rather than AF_LINK
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 05 17:53:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Greg Troxel
>Release: NetBSD 1.6.1_STABLE
>Organization:
Greg Troxel <gdt@ir.bbn.com>
>Environment:
System: NetBSD fnord.ir.bbn.com 1.6.1_STABLE NetBSD 1.6.1_STABLE (FNORD) #7: Mon Oct 6 15:46:22 EDT 2003 root@fnord.ir.bbn.com:/home/gdt/QUIST-current/netbsd/src/sys/arch/i386/compile/FNORD i386
Architecture: i386
Machine: i386
>Description:
<net/if_dl.h> defines struct sockaddr_dl. On the line defining member
"sdl_family" (which overlaps "sa_family" in struct sockaddr), the
comment says AF_DLI.
But,
1) AF_DLI is said to be a DEC Direct data link interface
(sys/socket.h)
2) The kernel actually sends sockaddr_dl structs with AF_LINK.
The problem is present in both netbsd-1-6 and -current.
>How-To-Repeat:
Inspect the code.
>Fix:
Change the comment AF_DLI to AF_LINK:
Index: sys/net/if_dl.h
===================================================================
RCS file: /FOO-CVS/netbsd/src/sys/net/if_dl.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -u -r1.1.1.2 -r1.2
--- if_dl.h 28 Jul 2000 12:13:32 -0000 1.1.1.2
+++ if_dl.h 5 Jan 2004 17:49:17 -0000 1.2
@@ -68,7 +68,7 @@
*/
struct sockaddr_dl {
u_char sdl_len; /* Total length of sockaddr */
- sa_family_t sdl_family; /* AF_DLI */
+ sa_family_t sdl_family; /* AF_LINK */
u_int16_t sdl_index; /* if != 0, system given index for interface */
u_char sdl_type; /* interface type */
u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
>Release-Note:
>Audit-Trail:
>Unformatted: