gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20114 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r20114 - gnunet/src/transport
Date: Tue, 28 Feb 2012 16:21:13 +0100

Author: grothoff
Date: 2012-02-28 16:21:13 +0100 (Tue, 28 Feb 2012)
New Revision: 20114

Modified:
   gnunet/src/transport/gnunet-helper-transport-wlan.c
Log:
-make no assumptions about the value of EINVAL

Modified: gnunet/src/transport/gnunet-helper-transport-wlan.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-02-28 15:17:18 UTC 
(rev 20113)
+++ gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-02-28 15:21:13 UTC 
(rev 20114)
@@ -709,7 +709,7 @@
  * @param iterator iterator to initialize
  * @param radiotap_header message to parse
  * @param max_length number of valid bytes in radiotap_header
- * @return 0 on success
+ * @return 0 on success, -1 on error
  */
 static int
 ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator *iterator,
@@ -719,16 +719,16 @@
 {
   if ( (iterator == NULL) ||
        (radiotap_header == NULL) )
-    return -EINVAL;
+    return -1;
 
   /* Linux only supports version 0 radiotap format */
   if (0 != radiotap_header->it_version)
-    return -EINVAL;
+    return -1;
 
   /* sanity check for allowed length and radiotap length field */
   if ( (max_length < sizeof (struct ieee80211_radiotap_header)) ||
        (max_length < (GNUNET_le16toh (radiotap_header->it_len))) )
-    return -EINVAL;
+    return -1;
 
   iterator->rtheader = radiotap_header;
   iterator->max_length = GNUNET_le16toh (radiotap_header->it_len);
@@ -752,7 +752,7 @@
        * stated radiotap header length
        */
       if (iterator->arg - ((uint8_t*) iterator->rtheader) > 
iterator->max_length)
-        return -EINVAL;
+        return -1;
     }
     iterator->arg += sizeof (uint32_t);
     /*
@@ -777,7 +777,7 @@
  *
  * @param iterator: radiotap_iterator to move to next arg (if any)
  *
- * @return next present arg index on success or negative if no more or error
+ * @return next present arg index on success or -1 if no more or error
  */
 static int
 ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator)
@@ -883,7 +883,7 @@
 
     if ((((void *) iterator->arg) - ((void *) iterator->rtheader)) >
         iterator->max_length)
-      return -EINVAL;
+      return -1;
 
 next_entry:
 
@@ -1162,7 +1162,7 @@
 
     rthdr = (struct ieee80211_radiotap_header *) tmpbuf;
 
-    if (ieee80211_radiotap_iterator_init (&iterator, rthdr, caplen) < 0)
+    if (0 != ieee80211_radiotap_iterator_init (&iterator, rthdr, caplen))
       return 0;
 
     /* go through the radiotap arguments we have been given




reply via email to

[Prev in Thread] Current Thread [Next in Thread]