]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Zero the un-used portions of the struct sockaddr data before sending
authorChristian S.J. Peron <csjp@FreeBSD.org>
Mon, 10 May 2004 15:07:23 +0000 (15:07 +0000)
committerChristian S.J. Peron <csjp@FreeBSD.org>
Mon, 10 May 2004 15:07:23 +0000 (15:07 +0000)
commit3581cc66bbd6129e945fd3ba12dcebb6e95842c4
tree14c8e3598a7376ca19cb4a9b69ca8a68f23fdc39
parent9c4b841b67601d275cf9245c675b92d789b92d89
Zero the un-used portions of the struct sockaddr data before sending
it back to userspace, so it does not break bind(2) on raw sockets in jails.

Currently some processes, like traceroute(8) construct a routing request
to determine its source address based on the destination. This sockaddr
data is fed directly to bind(2). When bind calls ifa_ifwithaddr(9) to
make sure the address exists on the interface, the comparison will
fail causing bind(2) to return EADDRNOTAVAIL if the data wasnt zero'ed
before initialization.

Approved by: bmilekic (mentor)
sys/net/rtsock.c