aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-02-25 04:54:33 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-02-28 15:31:12 -0500
commit36ef906ee8fefbfac3844206e66d8450e6221c69 (patch)
tree6c6a1d4212dc70fd686e7a64be2039b61e87ba99 /include/net
parentabfbc3af57b1b92ff976ce7f1c776c169d14ed8a (diff)
wext: add checked wrappers for adding events/points to streams
These checked wrappers are necessary for the next patch, which will use them to avoid sending out partial scan results. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/iw_handler.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index a830b01baba4..8f81bbbc38fc 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -519,6 +519,17 @@ iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends,
519 return stream; 519 return stream;
520} 520}
521 521
522static inline char *
523iwe_stream_add_event_check(struct iw_request_info *info, char *stream,
524 char *ends, struct iw_event *iwe, int event_len)
525{
526 char *res = iwe_stream_add_event(info, stream, ends, iwe, event_len);
527
528 if (res == stream)
529 return ERR_PTR(-E2BIG);
530 return res;
531}
532
522/*------------------------------------------------------------------*/ 533/*------------------------------------------------------------------*/
523/* 534/*
524 * Wrapper to add an short Wireless Event containing a pointer to a 535 * Wrapper to add an short Wireless Event containing a pointer to a
@@ -545,6 +556,17 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
545 return stream; 556 return stream;
546} 557}
547 558
559static inline char *
560iwe_stream_add_point_check(struct iw_request_info *info, char *stream,
561 char *ends, struct iw_event *iwe, char *extra)
562{
563 char *res = iwe_stream_add_point(info, stream, ends, iwe, extra);
564
565 if (res == stream)
566 return ERR_PTR(-E2BIG);
567 return res;
568}
569
548/*------------------------------------------------------------------*/ 570/*------------------------------------------------------------------*/
549/* 571/*
550 * Wrapper to add a value to a Wireless Event in a stream of events. 572 * Wrapper to add a value to a Wireless Event in a stream of events.