]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix an analyzer error.
authorRoy Marples <roy@marples.name>
Fri, 15 May 2015 14:58:04 +0000 (14:58 +0000)
committerRoy Marples <roy@marples.name>
Fri, 15 May 2015 14:58:04 +0000 (14:58 +0000)
ipv6nd.c

index 4f389dbaa20306b71879fb8825c4251d49093193..6bb9b0fe39a3d2f5214d9020477b8bd65712a4d6 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -1294,10 +1294,9 @@ ipv6nd_env(char **env, const char *prefix, const struct interface *ifp)
                /* Unlike DHCP, ND6 options *may* occur more than once.
                 * There is also no provision for option concatenation
                 * unlike DHCP. */
-               len = rap->data_len;
-               if (ND_CFIRST_OPTION(rap))
-                       len -= (size_t)((const uint8_t *)ND_CFIRST_OPTION(rap)
-                           - rap->data);
+               len = rap->data_len -
+                   ((size_t)((const uint8_t *)ND_CFIRST_OPTION(rap) -
+                   rap->data));
 
                for (o = ND_CFIRST_OPTION(rap);
                    len >= (ssize_t)sizeof(*o);