summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2014-08-22 19:40:29 +0000
committertuexen <tuexen@FreeBSD.org>2014-08-22 19:40:29 +0000
commit6022e8fc874a336efc8c1f0c1b492ede1a5ebe81 (patch)
tree4dc316aa18e433d9fb08a73893b0ba7013c8b2d2
parent401dfe0b41d5393df20878b750c63b8b33953ffc (diff)
downloadFreeBSD-src-6022e8fc874a336efc8c1f0c1b492ede1a5ebe81.zip
FreeBSD-src-6022e8fc874a336efc8c1f0c1b492ede1a5ebe81.tar.gz
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.
-rw-r--r--sys/netinet/sctp_pcb.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 82b1788..fa5a288 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -3968,9 +3968,14 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
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 *stcb, struct sockaddr *newaddr,
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 *stcb, struct sockaddr *newaddr,
*/
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) ^
OpenPOWER on IntegriCloud