aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/ulpevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/ulpevent.h')
-rw-r--r--include/net/sctp/ulpevent.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 1060494ac230..b8c86ec1a8f5 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -153,8 +153,12 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event);
153static inline int sctp_ulpevent_type_enabled(__u16 sn_type, 153static inline int sctp_ulpevent_type_enabled(__u16 sn_type,
154 struct sctp_event_subscribe *mask) 154 struct sctp_event_subscribe *mask)
155{ 155{
156 int offset = sn_type - SCTP_SN_TYPE_BASE;
156 char *amask = (char *) mask; 157 char *amask = (char *) mask;
157 return amask[sn_type - SCTP_SN_TYPE_BASE]; 158
159 if (offset >= sizeof(struct sctp_event_subscribe))
160 return 0;
161 return amask[offset];
158} 162}
159 163
160/* Given an event subscription, is this event enabled? */ 164/* Given an event subscription, is this event enabled? */