Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2014 19:40:30 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270351 - stable/10/sys/netinet
Message-ID:  <201408221940.s7MJeU7f021434@svn.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help
Author: tuexen
Date: Fri Aug 22 19:40:29 2014
New Revision: 270351
URL: http://svnweb.freebsd.org/changeset/base/270351

Log:
  MFC r268534:
  
  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.

Modified:
  stable/10/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/10/sys/netinet/sctp_pcb.c	Fri Aug 22 19:37:50 2014	(r270350)
+++ stable/10/sys/netinet/sctp_pcb.c	Fri Aug 22 19:40:29 2014	(r270351)
@@ -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: <http://docs.FreeBSD.org/cgi/mid.cgi?201408221940.s7MJeU7f021434>