Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2013 11:21:15 -0400
From:      Matt Miller <matt@matthewjmiller.net>
To:        freebsd-net@freebsd.org
Subject:   ip_output() Error Handling in tcp_output()
Message-ID:  <CAFc6gu-1X68%2Bd=-Fq5%2BoDbHM6VHqqRi5WNw_L==WT2AbJ5sTOg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
If we have a connection that has received a SYN and ip_output()
returns, say, EHOSTUNREACH, is there anything that guarantees the
connection would always eventually be dropped if the condition
persists?

E.g., similar to this case for ENOBUFS:

http://svnweb.freebsd.org/base?view=revision&revision=61179

Should we ensure that a timer is set for the EHOSTUNREACH, et al.
cases too in addition to setting t_softerror?

        error = ip_output(m, tp->t_inpcb->inp_options, &ro,
            ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0,
            tp->t_inpcb);
...
                switch (error) {
                case EPERM:
                        tp->t_softerror = error;
                        return (error);
                case ENOBUFS:
                        if (!tcp_timer_active(tp, TT_REXMT) &&
                            !tcp_timer_active(tp, TT_PERSIST))
                                tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur);
                        tp->snd_cwnd = tp->t_maxseg;
                        return (0);
...
                case EHOSTDOWN:
                case EHOSTUNREACH:
                case ENETDOWN:
                case ENETUNREACH:
                        if (TCPS_HAVERCVDSYN(tp->t_state)) {
                                tp->t_softerror = error;
                                return (0);
                        }

Thanks,

Matt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFc6gu-1X68%2Bd=-Fq5%2BoDbHM6VHqqRi5WNw_L==WT2AbJ5sTOg>