]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Work with zerolength options again.
authorRoy Marples <roy@marples.name>
Sun, 16 Mar 2008 08:22:01 +0000 (08:22 +0000)
committerRoy Marples <roy@marples.name>
Sun, 16 Mar 2008 08:22:01 +0000 (08:22 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 8ed66da9efd457f27af551d3f3bb0a5c4eff760d..14b40d836436c7e7c744895bc233c9c4e0979e3b 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -669,9 +669,9 @@ parse_start:
                length = *p++;
 
                if (option != DHCP_PAD && length == 0) {
-                       logger (LOG_ERR, "option %d has zero length", option);
-                       retval = -1;
-                       goto eexit;
+                       logger (LOG_ERR, "option %d has zero length, skipping",
+                               option);
+                       continue;
                }
 
                if (p + length >= end) {
@@ -680,21 +680,6 @@ parse_start:
                        goto eexit;
                }
 
-               switch (option) {
-                       case DHCP_MESSAGETYPE:
-                               retval = (int) *p;
-                               p += length;
-                               continue;
-
-                       default:
-                               if (length == 0) {
-                                       logger (LOG_DEBUG,
-                                               "option %d has zero length, skipping",
-                                               option);
-                                       continue;
-                               }
-               }
-
 #define LENGTH(_length) \
                if (length != _length) \
                LEN_ERR;
@@ -721,6 +706,9 @@ parse_start:
                _val = ntohl (_val);
 
                switch (option) {
+                       case DHCP_MESSAGETYPE:
+                               retval = (int) *p;
+                               break;
                        case DHCP_ADDRESS:
                                GET_UINT32 (dhcp->address.s_addr);
                                break;