In in_pcbconnect_setup(), don't use the cached inp->inp_route unless
it is marked as RTF_UP. This appears to fix a crash that was sometimes triggered when dhclient(8) tried to send a packet after an interface had been detatched. Reviewed by: sam
This commit is contained in:
parent
dab12c8eba
commit
3ab2096b80
@ -578,10 +578,10 @@ in_pcbconnect_setup(inp, nam, laddrp, lportp, faddrp, fportp, oinpp, td)
|
||||
* destination, in case of sharing the cache with IPv6.
|
||||
*/
|
||||
ro = &inp->inp_route;
|
||||
if (ro->ro_rt &&
|
||||
(ro->ro_dst.sa_family != AF_INET ||
|
||||
satosin(&ro->ro_dst)->sin_addr.s_addr != faddr.s_addr ||
|
||||
inp->inp_socket->so_options & SO_DONTROUTE)) {
|
||||
if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 ||
|
||||
ro->ro_dst.sa_family != AF_INET ||
|
||||
satosin(&ro->ro_dst)->sin_addr.s_addr != faddr.s_addr ||
|
||||
inp->inp_socket->so_options & SO_DONTROUTE)) {
|
||||
RTFREE(ro->ro_rt);
|
||||
ro->ro_rt = (struct rtentry *)0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user