summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2011-01-02 10:27:27 +0000
committertuexen <tuexen@FreeBSD.org>2011-01-02 10:27:27 +0000
commite53f353cdccb63721a0678751c6d600432c1a807 (patch)
treef4b52084e2e745ce0bc38059a71bd10ecc088b11 /sys/netinet
parent68eca43089187031faaff5201cb59a1e28c40159 (diff)
downloadFreeBSD-src-e53f353cdccb63721a0678751c6d600432c1a807.zip
FreeBSD-src-e53f353cdccb63721a0678751c6d600432c1a807.tar.gz
Bugfix: Make sure that the COMM_UP notificatin is delivered first also
on the passive side. MFC after: 3 days.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_input.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 77e0289..acbad4f 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -2311,6 +2311,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
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, int iphlen, int offset,
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, int iphlen, int offset,
* 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, int iphlen, int offset,
/* 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, int iphlen, int offset,
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);
}
OpenPOWER on IntegriCloud