diff options
author | gallatin <gallatin@FreeBSD.org> | 2016-08-11 19:05:47 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2016-08-11 19:05:47 +0000 |
commit | 6ebead2b698ae3f9a5cf1ae1bf588c12f29fa993 (patch) | |
tree | 2ca92261adc770727d91e903067b0bd24cff9d87 /sys/netinet/tcp_subr.c | |
parent | 2799407183ea1a78d82757540633ffb68a7ab9a4 (diff) | |
download | FreeBSD-src-6ebead2b698ae3f9a5cf1ae1bf588c12f29fa993.zip FreeBSD-src-6ebead2b698ae3f9a5cf1ae1bf588c12f29fa993.tar.gz |
MFC r303457:
Call tcp_notify() directly to shoot down routes
Approved by: re (gjb)
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 12945ce..505fc30 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1950,11 +1950,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip) notify = tcp_drop_syn_sent; - else if (PRC_IS_REDIRECT(cmd)) { - /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); - return; - } + /* * Hostdead is ugly because it goes linearly through all PCBs. * XXX: We never get this from ICMP, otherwise it makes an @@ -1975,7 +1971,12 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) INP_INFO_RLOCK(&V_tcbinfo); inp = in_pcblookup(&V_tcbinfo, faddr, th->th_dport, ip->ip_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL); - if (inp != NULL) { + if (inp != NULL && PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + inp = (*notify)(inp, EHOSTDOWN); + if (inp != NULL) + INP_WUNLOCK(inp); + } else if (inp != NULL) { if (!(inp->inp_flags & INP_TIMEWAIT) && !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { |