svn commit: r216887 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun Jan 2 10:27:27 UTC 2011


Author: tuexen
Date: Sun Jan  2 10:27:27 2011
New Revision: 216887
URL: http://svn.freebsd.org/changeset/base/216887

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

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c	Sun Jan  2 10:01:29 2011	(r216886)
+++ head/sys/netinet/sctp_input.c	Sun Jan  2 10:27:27 2011	(r216887)
@@ -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;
@@ -2766,7 +2770,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
@@ -2785,8 +2792,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);
 }


More information about the svn-src-all mailing list