fc5dafc79b
the link level name for the interface (ifp->if_sadl) is allocated before ifp->if_addrlen is initialized, which could lead to allocating too little space for the link level address. Do this by splitting allocation of the link level name out of if_attach() and into if_alloc_sadl(), which is normally called by functions like ether_ifattach(). Network interfaces which don't have a link-specific attach routine must call if_alloc_sadl() themselves (example: gif). Link level names are freed by if_free_sadl(), which can be called from e.g. ether_ifdetach(). Drivers never need call if_free_sadl() themselves as if_detach() will do it if it is not already done. While here, add the ability to pass an AF_LINK address to SIOCSIFADDR in ether_ioctl() (this is what caused me to notice the problem that the above fixes). |
||
---|---|---|
.. | ||
fil.c | ||
icmp6.h | ||
icmp_var.h | ||
if_arp.c | ||
if_atm.c | ||
if_atm.h | ||
if_ether.h | ||
if_ieee1394arp.c | ||
if_ieee1394arp.h | ||
if_inarp.h | ||
igmp_var.h | ||
igmp.c | ||
igmp.h | ||
in4_cksum.c | ||
in_cksum.c | ||
in_gif.c | ||
in_gif.h | ||
in_pcb.c | ||
in_pcb.h | ||
in_proto.c | ||
in_systm.h | ||
in_var.h | ||
in.c | ||
in.h | ||
ip6.h | ||
ip_auth.c | ||
ip_auth.h | ||
ip_compat.h | ||
ip_ecn.c | ||
ip_ecn.h | ||
ip_encap.c | ||
ip_encap.h | ||
ip_fil.c | ||
ip_fil.h | ||
ip_flow.c | ||
ip_frag.c | ||
ip_frag.h | ||
ip_ftp_pxy.c | ||
ip_gre.c | ||
ip_gre.h | ||
ip_icmp.c | ||
ip_icmp.h | ||
ip_input.c | ||
ip_ipip.c | ||
ip_ipip.h | ||
ip_log.c | ||
ip_mroute.c | ||
ip_mroute.h | ||
ip_nat.c | ||
ip_nat.h | ||
ip_output.c | ||
ip_proxy.c | ||
ip_proxy.h | ||
ip_raudio_pxy.c | ||
ip_rcmd_pxy.c | ||
ip_state.c | ||
ip_state.h | ||
ip_var.h | ||
ip.h | ||
ipl.h | ||
Makefile | ||
raw_ip.c | ||
tcp_debug.c | ||
tcp_debug.h | ||
tcp_fsm.h | ||
tcp_input.c | ||
tcp_output.c | ||
tcp_seq.h | ||
tcp_subr.c | ||
tcp_timer.c | ||
tcp_timer.h | ||
tcp_usrreq.c | ||
tcp_var.h | ||
tcp.h | ||
tcpip.h | ||
udp_usrreq.c | ||
udp_var.h | ||
udp.h |