summaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 9d7512958a6a..c7718272d69b 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2307,6 +2307,7 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
2307 struct sctp_event_subscribe subscribe; 2307 struct sctp_event_subscribe subscribe;
2308 __u8 *sn_type = (__u8 *)&subscribe; 2308 __u8 *sn_type = (__u8 *)&subscribe;
2309 struct sctp_sock *sp = sctp_sk(sk); 2309 struct sctp_sock *sp = sctp_sk(sk);
2310 struct sctp_association *asoc;
2310 int i; 2311 int i;
2311 2312
2312 if (optlen > sizeof(struct sctp_event_subscribe)) 2313 if (optlen > sizeof(struct sctp_event_subscribe))
@@ -2319,14 +2320,17 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
2319 sctp_ulpevent_type_set(&sp->subscribe, SCTP_SN_TYPE_BASE + i, 2320 sctp_ulpevent_type_set(&sp->subscribe, SCTP_SN_TYPE_BASE + i,
2320 sn_type[i]); 2321 sn_type[i]);
2321 2322
2323 list_for_each_entry(asoc, &sp->ep->asocs, asocs)
2324 asoc->subscribe = sctp_sk(sk)->subscribe;
2325
2322 /* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, 2326 /* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
2323 * if there is no data to be sent or retransmit, the stack will 2327 * if there is no data to be sent or retransmit, the stack will
2324 * immediately send up this notification. 2328 * immediately send up this notification.
2325 */ 2329 */
2326 if (sctp_ulpevent_type_enabled(sp->subscribe, SCTP_SENDER_DRY_EVENT)) { 2330 if (sctp_ulpevent_type_enabled(sp->subscribe, SCTP_SENDER_DRY_EVENT)) {
2327 struct sctp_association *asoc = sctp_id2assoc(sk, 0);
2328 struct sctp_ulpevent *event; 2331 struct sctp_ulpevent *event;
2329 2332
2333 asoc = sctp_id2assoc(sk, 0);
2330 if (asoc && sctp_outq_is_empty(&asoc->outqueue)) { 2334 if (asoc && sctp_outq_is_empty(&asoc->outqueue)) {
2331 event = sctp_ulpevent_make_sender_dry_event(asoc, 2335 event = sctp_ulpevent_make_sender_dry_event(asoc,
2332 GFP_USER | __GFP_NOWARN); 2336 GFP_USER | __GFP_NOWARN);