Date: Fri, 11 Jul 2014 17:31:40 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268534 - head/sys/netinet Message-ID: <201407111731.s6BHVejw006484@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Fri Jul 11 17:31:40 2014 New Revision: 268534 URL: http://svnweb.freebsd.org/changeset/base/268534 Log: Bugfix: When a remote address was added to an endpoint, a source address was selected and cached, but it was not stored that is was cached. This resulted in selecting different source addresses for the INIT-ACK and COOKIE-ACK when possible. Thanks to Niu Zhixiong for reporting the issue. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Jul 11 16:45:55 2014 (r268533) +++ head/sys/netinet/sctp_pcb.c Fri Jul 11 17:31:40 2014 (r268534) @@ -3968,9 +3968,14 @@ sctp_add_remote_addr(struct sctp_tcb *st net, 0, stcb->asoc.vrf_id); - /* Now get the interface MTU */ - if (net->ro._s_addr && net->ro._s_addr->ifn_p) { - net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); + if (net->ro._s_addr != NULL) { + net->src_addr_selected = 1; + /* Now get the interface MTU */ + if (net->ro._s_addr->ifn_p != NULL) { + net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); + } + } else { + net->src_addr_selected = 0; } if (net->mtu > 0) { uint32_t rmtu; @@ -3992,6 +3997,8 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } + } else { + net->src_addr_selected = 0; } if (net->mtu == 0) { switch (newaddr->sa_family) { @@ -4039,7 +4046,6 @@ sctp_add_remote_addr(struct sctp_tcb *st */ net->find_pseudo_cumack = 1; net->find_rtx_pseudo_cumack = 1; - net->src_addr_selected = 0; /* Choose an initial flowid. */ net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407111731.s6BHVejw006484>