Author: tuexen
Date: Thu Oct 27 22:38:48 2011
New Revision: 226869
URL: http://svn.freebsd.org/changeset/base/226869

Log:
  When add a new remote address using sctp_add_remote_addr(),
  return the correct net if requested.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c Thu Oct 27 22:37:59 2011        (r226868)
+++ head/sys/netinet/sctp_pcb.c Thu Oct 27 22:38:48 2011        (r226869)
@@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *st
 #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 *st
                TAILQ_INSERT_HEAD(&stcb->asoc.nets,
                    stcb->asoc.primary_destination, sctp_next);
        }
-       if (netp) {
-               *netp = net;
-       }
        return (0);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to