Don't stop parsing on padding options
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Jun 2014 14:08:44 +0000 (15:08 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Jun 2014 14:08:44 +0000 (15:08 +0100)
src/lib/dhcp.c

index 1a91807..6ffde31 100644 (file)
@@ -585,8 +585,11 @@ ssize_t fr_dhcp_decode_options(uint8_t *data, size_t len, VALUE_PAIR **head)
 
                p = next;
 
-               if (*p == 0) break;
-               if (*p == 255) break; /* end of options signifier */
+               if (*p == 0) {          /* 0x00 - Padding option */
+                       next++;
+                       continue;
+               }
+               if (*p == 255) break;   /* 0xff - End of options signifier */
                if ((p + 2) > (data + len)) break;
 
                next = p + 2 + p[1];