Author: tuexen
Date: Fri Feb 10 07:31:50 2012
New Revision: 231358
URL: http://svn.freebsd.org/changeset/base/231358

Log:
  MFC r216887:
  Bugfix: Make sure that the COMM_UP notificatin is delivered first also
          on the passive side.

Modified:
  stable/8/sys/netinet/sctp_input.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c   Fri Feb 10 07:30:15 2012        
(r231357)
+++ stable/8/sys/netinet/sctp_input.c   Fri Feb 10 07:31:50 2012        
(r231358)
@@ -2311,6 +2311,7 @@ sctp_handle_cookie_echo(struct mbuf *m, 
        int notification = 0;
        struct sctp_nets *netl;
        int had_a_existing_tcb = 0;
+       int send_int_conf = 0;
 
        SCTPDBG(SCTP_DEBUG_INPUT2,
            "sctp_handle_cookie: handling COOKIE-ECHO\n");
@@ -2630,8 +2631,7 @@ sctp_handle_cookie_echo(struct mbuf *m, 
                        netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED;
                        (void)sctp_set_primary_addr((*stcb), (struct sockaddr 
*)NULL,
                            netl);
-                       sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
-                           (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED);
+                       send_int_conf = 1;
                }
        }
        if (*stcb) {
@@ -2655,6 +2655,10 @@ sctp_handle_cookie_echo(struct mbuf *m, 
                                 * socket, no need to do anything. I THINK!!
                                 */
                                sctp_ulp_notify(notification, *stcb, 0, (void 
*)&sac_restart_id, SCTP_SO_NOT_LOCKED);
+                               if (send_int_conf) {
+                                       
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
+                                           (*stcb), 0, (void *)netl, 
SCTP_SO_NOT_LOCKED);
+                               }
                                return (m);
                        }
                        oso = (*inp_p)->sctp_socket;
@@ -2768,7 +2772,10 @@ sctp_handle_cookie_echo(struct mbuf *m, 
                        /* Switch over to the new guy */
                        *inp_p = inp;
                        sctp_ulp_notify(notification, *stcb, 0, NULL, 
SCTP_SO_NOT_LOCKED);
-
+                       if (send_int_conf) {
+                               sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
+                                   (*stcb), 0, (void *)netl, 
SCTP_SO_NOT_LOCKED);
+                       }
                        /*
                         * Pull it from the incomplete queue and wake the
                         * guy
@@ -2787,8 +2794,14 @@ sctp_handle_cookie_echo(struct mbuf *m, 
                        return (m);
                }
        }
-       if ((notification) && ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) {
-               sctp_ulp_notify(notification, *stcb, 0, NULL, 
SCTP_SO_NOT_LOCKED);
+       if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
+               if (notification) {
+                       sctp_ulp_notify(notification, *stcb, 0, NULL, 
SCTP_SO_NOT_LOCKED);
+               }
+               if (send_int_conf) {
+                       sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
+                           (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED);
+               }
        }
        return (m);
 }
_______________________________________________
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