From 7d9c272db15897ba386b5cf863f1533d08f5d792 Mon Sep 17 00:00:00 2001 From: tuexen Date: Thu, 27 Oct 2011 22:38:48 +0000 Subject: [PATCH] When add a new remote address using sctp_add_remote_addr(), return the correct net if requested. MFC after: 3 days. --- sys/netinet/sctp_pcb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2b36ba4e1f21..389943e18ac1 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -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); }