diff options
author | kbyanc <kbyanc@FreeBSD.org> | 2002-05-07 22:14:06 +0000 |
---|---|---|
committer | kbyanc <kbyanc@FreeBSD.org> | 2002-05-07 22:14:06 +0000 |
commit | cc607e6c2d164e9cb79d2fdec151a8c3a151be83 (patch) | |
tree | 1011805115056aee5a327edbdc2edbd88f8dd3e5 /sys/net/if_dl.h | |
parent | 890d39a38cddebc8d4ce58feba2c0be1ee5e44f6 (diff) | |
download | FreeBSD-src-cc607e6c2d164e9cb79d2fdec151a8c3a151be83.zip FreeBSD-src-cc607e6c2d164e9cb79d2fdec151a8c3a151be83.tar.gz |
Move ISO88025 source routing information into sockaddr_dl's sdl_data
field. This returns the sdl_data field to a variable-length field. More
importantly, this prevents a easily-reproduceable data-corruption bug when
the interface name plus the hardware address exceed the sdl_data field's
original 12 byte limit. However, token-ring interfaces may still overflow
the new sdl_data field's 46 byte limit if the interface name exceeds 6
characters (since 6 characters for interface name plus 6 for hardware
address plus 34 for source routing = the size of sdl_data). Further
refinements could overcome this limitation but would break binary
compatibility; this commit only addresses fixing the bug for
commonly-occuring cases without breaking binary compatibility with the
intention that the functionality can be MFC'ed to -stable.
See message ID's (both send to -arch):
20020421013332.F87395-100000@gateway.posi.net
20020430181359.G11009-300000@gateway.posi.net
for a more thorough description of the bug addressed and how to
reproduce it.
Approved by: silence on -arch and -net
Sponsored by: NTT Multimedia Communications Labs
MFC after: 1 week
Diffstat (limited to 'sys/net/if_dl.h')
-rw-r--r-- | sys/net/if_dl.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h index 2eb33dc..b9980bb 100644 --- a/sys/net/if_dl.h +++ b/sys/net/if_dl.h @@ -66,10 +66,8 @@ struct sockaddr_dl { u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */ u_char sdl_alen; /* link level address length */ u_char sdl_slen; /* link layer selector length */ - char sdl_data[12]; /* minimum work area, can be larger; + char sdl_data[46]; /* minimum work area, can be larger; contains both if name and ll address */ - u_short sdl_rcf; /* source routing control */ - u_short sdl_route[16]; /* source routing information */ }; #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) |