Date: Thu, 11 Aug 2016 19:05:47 +0000 (UTC) From: Andrew Gallatin <gallatin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303966 - stable/11/sys/netinet Message-ID: <201608111905.u7BJ5ltM038661@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gallatin Date: Thu Aug 11 19:05:47 2016 New Revision: 303966 URL: https://svnweb.freebsd.org/changeset/base/303966 Log: MFC r303457: Call tcp_notify() directly to shoot down routes Approved by: re (gjb) Modified: stable/11/sys/netinet/tcp_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_subr.c ============================================================================== --- stable/11/sys/netinet/tcp_subr.c Thu Aug 11 18:13:48 2016 (r303965) +++ stable/11/sys/netinet/tcp_subr.c Thu Aug 11 19:05:47 2016 (r303966) @@ -1950,11 +1950,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s 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 *s 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)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608111905.u7BJ5ltM038661>