]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove a needless set and fix length check of an array of IPv4 addresss.
authorRoy Marples <roy@marples.name>
Wed, 4 Apr 2012 23:09:48 +0000 (23:09 +0000)
committerRoy Marples <roy@marples.name>
Wed, 4 Apr 2012 23:09:48 +0000 (23:09 +0000)
configure.c
dhcp.c

index 88ff5d9add608b9c76ca4f290b2ef588c2bc2129..4b610c8b2fbe36d528e3350951015514d9046511 100644 (file)
@@ -307,7 +307,6 @@ send_interface1(int fd, const struct interface *iface, const char *reason)
        struct iovec iov[2];
        int retval;
 
-       retval = 0;
        make_env(iface, reason, &env);
        elen = arraytostr((const char *const *)env, &s);
        iov[0].iov_base = &elen;
diff --git a/dhcp.c b/dhcp.c
index cc705b3b9cc4f2d0f96a90721899cce528fc648e..f39e7835cb256457c564dda1b2baa0eb4b604da1 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -280,7 +280,7 @@ valid_length(uint8_t option, int dl, int *type)
                if (opt->type & UINT8)
                        sz = sizeof(uint8_t);
                if (opt->type & (IPV4 | ARRAY))
-                       return dl % sz;
+                       sz = dl % sizeof(uint32_t);
                return (dl == sz ? 0 : -1);
        }