summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2015-03-10 22:38:10 +0000
committertuexen <tuexen@FreeBSD.org>2015-03-10 22:38:10 +0000
commitc7380868012628ae72d3d9823118d11e58df0681 (patch)
tree8c0e930c91a8d4464aebb9b892c5c89ef31f4e8e /sys/netinet
parente09330b6b5ebddd1e9e7a09c994b3f982d12ed51 (diff)
downloadFreeBSD-src-c7380868012628ae72d3d9823118d11e58df0681.zip
FreeBSD-src-c7380868012628ae72d3d9823118d11e58df0681.tar.gz
Keep track on the socket lock state. This fixes a bug showing up on
Mac OS X. MFC after: 3 days
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctputil.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 801f03b..9879282 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -2745,7 +2745,11 @@ set_error:
static void
sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state,
- struct sockaddr *sa, uint32_t error)
+ struct sockaddr *sa, uint32_t error, int so_locked
+#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
+ SCTP_UNUSED
+#endif
+)
{
struct mbuf *m_notify;
struct sctp_paddr_change *spc;
@@ -2828,7 +2832,7 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state,
control,
&stcb->sctp_socket->so_rcv, 1,
SCTP_READ_LOCK_NOT_HELD,
- SCTP_SO_NOT_LOCKED);
+ so_locked);
}
@@ -3592,7 +3596,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
net = (struct sctp_nets *)data;
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE,
- (struct sockaddr *)&net->ro._l_addr, error);
+ (struct sockaddr *)&net->ro._l_addr, error, so_locked);
break;
}
case SCTP_NOTIFY_INTERFACE_UP:
@@ -3601,7 +3605,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
net = (struct sctp_nets *)data;
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_AVAILABLE,
- (struct sockaddr *)&net->ro._l_addr, error);
+ (struct sockaddr *)&net->ro._l_addr, error, so_locked);
break;
}
case SCTP_NOTIFY_INTERFACE_CONFIRMED:
@@ -3610,7 +3614,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
net = (struct sctp_nets *)data;
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_CONFIRMED,
- (struct sockaddr *)&net->ro._l_addr, error);
+ (struct sockaddr *)&net->ro._l_addr, error, so_locked);
break;
}
case SCTP_NOTIFY_SPECIAL_SP_FAIL:
@@ -3681,15 +3685,15 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
break;
case SCTP_NOTIFY_ASCONF_ADD_IP:
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data,
- error);
+ error, so_locked);
break;
case SCTP_NOTIFY_ASCONF_DELETE_IP:
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_REMOVED, data,
- error);
+ error, so_locked);
break;
case SCTP_NOTIFY_ASCONF_SET_PRIMARY:
sctp_notify_peer_addr_change(stcb, SCTP_ADDR_MADE_PRIM, data,
- error);
+ error, so_locked);
break;
case SCTP_NOTIFY_PEER_SHUTDOWN:
sctp_notify_shutdown_event(stcb);
OpenPOWER on IntegriCloud