When add a new remote address using sctp_add_remote_addr(),

return the correct net if requested.

MFC after: 3 days.
This commit is contained in:
tuexen 2011-10-27 22:38:48 +00:00
parent 810e2ec44a
commit 7d9c272db1

View File

@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
#ifdef INVARIANTS
net->flowidset = 1;
#endif
if (netp) {
*netp = net;
}
netfirst = TAILQ_FIRST(&stcb->asoc.nets);
if (net->ro.ro_rt == NULL) {
/* Since we have no route put it at the back */
@ -4209,9 +4212,6 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
TAILQ_INSERT_HEAD(&stcb->asoc.nets,
stcb->asoc.primary_destination, sctp_next);
}
if (netp) {
*netp = net;
}
return (0);
}