]> Zhao Yanbai Git Server - minix.git/commitdiff
inet: strncmp() fix
authorBen Gras <ben@minix3.org>
Fri, 3 Feb 2012 13:49:18 +0000 (14:49 +0100)
committerBen Gras <ben@minix3.org>
Fri, 3 Feb 2012 13:49:18 +0000 (14:49 +0100)
servers/inet/inet.c

index d4e974637e66ac2847912568616c904b326b1fe8..eb0f18d8af58c725bd2db11d8ba1d2f089ddfc95 100644 (file)
@@ -339,6 +339,9 @@ PRIVATE void ds_event()
        int type;
        endpoint_t owner_endpoint;
        int r;
+       int prefix_len;
+
+       prefix_len = strlen(driver_prefix);
 
        /* We may get one notification for multiple updates from DS. Get events
         * and owners from DS, until DS tells us that there are no more.
@@ -351,13 +354,13 @@ PRIVATE void ds_event()
                }
 
                /* Only check for network driver up events. */
-               if(strncmp(key, driver_prefix, sizeof(driver_prefix))
+               if(strncmp(key, driver_prefix, prefix_len)
                   || value != DS_DRIVER_UP) {
                        return;
                }
 
                /* The driver label comes after the prefix. */
-               label = key + strlen(driver_prefix);
+               label = key + prefix_len;
 
                /* A driver is (re)started. */
                eth_check_driver(label, owner_endpoint);