Commit Graph

23 Commits

Author SHA1 Message Date
matt eefce21cf2 Revert change of char to int8_t. 2008-02-20 17:18:11 +00:00
matt 2b028087f5 s/u_\(int[0-9]*_t\)/u\1/g
(change u_int*_t to uint*_t)
2008-02-20 17:05:52 +00:00
dyoung b3fc296326 Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool
and dom_sa_len members from struct domain.  Pools of fixed-size
objects are too rigid for sockaddr_dls, whose size can vary over
a wide range.

Return sockaddr_dl to its "historical" size.  Now that I'm using
malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create
a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl
is useless.

Avoid using sizeof(struct sockaddr_dl) in the kernel.

Introduce sockaddr_dl_alloc() for allocating & initializing an
arbitrary sockaddr_dl on the heap.

Add an argument, the sockaddr length, to sockaddr_alloc(),
sockaddr_copy(), and sockaddr_dl_setaddr().

Constify: LLADDR() -> CLLADDR().

Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(),
instead.  Used properly, sockaddr_dl_setaddr() will not overrun
the end of the sockaddr.
2007-08-30 02:17:34 +00:00
dyoung 3aa180f03a As a stopgap measure to avoid dependency on net/if.h, don't use
IFNAMSIZ.
2007-08-07 04:59:46 +00:00
dyoung 04d14f227e Lengthen sockaddr_dl so that a 16-byte FireWire address will fit
into sdl_data[].

Move the macro satocsdl() to net/if_dl.h, and introduce satosdl().

Add some helpers for initializing sockaddr_dl (sockaddr_dl_init),
for finding out the length to put in a sockaddr_dl's sdl_len member
(sockaddr_dl_measure), and for setting the link-layer address in
a sockaddr_dl to a new value (sockaddr_dl_setaddr).

Make sockaddr_copy() panic if the caller tries to copy a sockaddr
to a destination where it will not fit.
2007-08-07 04:06:20 +00:00
thorpej 63eac52bac ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
elad 976bf6cfdd Multiple inclusion protection, as suggested by christos@ on tech-kern@
few days ago.
2005-12-10 23:21:38 +00:00
christos 6c547ba0c6 change casts back to char * and explain why. 2005-05-31 01:47:24 +00:00
christos f954cf7e94 Add a CLLADDR macro which is the same as LLADDR only const. Make both macros
return void pointers.
2005-05-30 22:11:47 +00:00
perry f07677dd81 nuke trailing whitespace 2005-02-26 22:45:09 +00:00
wiz 95f9af9926 Apply patch from PR 23990 by Greg Troxel (s/AF_DLI/AF_LINK/ in a comment):
<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.
2004-11-20 00:53:13 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
kleink 079b94ad72 Avoid recursion with traditional cpp. 2000-07-28 12:13:32 +00:00
kleink 5de786e04a Define sa_family_t and use it for sdl_family. 2000-06-26 15:59:20 +00:00
perry 41c3fea850 add multiple inclusion protection (and cleanup). 1998-02-09 17:43:44 +00:00
jtc 7c04233887 KERNEL -> _KERNEL 1995-03-26 20:23:52 +00:00
cgd 17d1e137e0 punt on using int8 types for chars, at least for now. char is 8 byts anyway. 1995-03-12 04:19:08 +00:00
cgd e363664703 fixed sized types, where appropriate. when casting pointers to
integers to do math on them, cast to long.  ioctl commands are
u_longs.
1995-03-08 02:56:49 +00:00
cgd cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
mycroft d361acde18 Update to 4.4-Lite networking code, with a few local changes. 1994-05-13 06:01:27 +00:00
cgd a82018489a add rcs ids to everything, and clean up headers 1993-05-20 03:05:46 +00:00
mycroft 235bd1db44 Add consistent multiple-inclusion protection. 1993-04-19 03:45:34 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00