I am guessing that this patch fixes
https://github.com/cloudius-systems/osv/issues/726
*Justin* - can you still reproduce this issue? If so, can you please check
if this patch fixes it?


--
Nadav Har'El
n...@scylladb.com

On Fri, Sep 9, 2016 at 8:08 PM, Timmons C. Player <
timmons.pla...@spirent.com> wrote:

> Check the TCP state of net_channel directed packets to ensure that
> tcp_do_segment can process them.  If not, hand the packet off to
> netisr_dispatch and teardown the net channel.  This prevents triggering
> assertion failures in tcp_do_segment.
>
> Also update the lock acquisition check at the beginning of tcp_do_segment
> to match the assertion check below it.
>
> Signed-off-by: Timmons C. Player <timmons.pla...@spirent.com>
> ---
>  bsd/sys/netinet/tcp_input.cc | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/bsd/sys/netinet/tcp_input.cc b/bsd/sys/netinet/tcp_input.cc
> index 642cfeb..c780d46 100644
> --- a/bsd/sys/netinet/tcp_input.cc
> +++ b/bsd/sys/netinet/tcp_input.cc
> @@ -1048,7 +1048,9 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th,
> struct socket *so,
>          * if we fail, drop the packet.  FIXME: invert the lock order so
> we don't
>          * have to drop packets.
>          */
> -       if (tp->get_state() != TCPS_ESTABLISHED && ti_locked ==
> TI_UNLOCKED) {
> +       if ((tp->get_state() != TCPS_ESTABLISHED
> +       || (thflags & (TH_SYN | TH_FIN | TH_RST) != 0))
> +          && ti_locked == TI_UNLOCKED) {
>                 if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) {
>                         ti_locked = TI_WLOCKED;
>                 } else {
> @@ -3188,6 +3190,15 @@ tcp_newreno_partial_ack(struct tcpcb *tp, struct
> tcphdr *th)
>  static void
>  tcp_net_channel_packet(tcpcb* tp, mbuf* m)
>  {
> +       if (tp->get_state() <= TCPS_LISTEN) {
> +               // We can't hand this packet off to tcp_do_segment due to
> the
> +               // current connection state.    Drop the channel and
> handle the
> +               // packet via the slow path.
> +               tcp_teardown_net_channel(tp);
> +               netisr_dispatch(NETISR_ETHER, m);
> +               return;
> +       }
> +
>         log_packet_handling(m, NETISR_ETHER);
>         caddr_t start = m->m_hdr.mh_data;
>         auto h = start;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to