]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
options: Match exact string for environment changes
authorRoy Marples <roy@marples.name>
Tue, 7 Feb 2023 16:39:27 +0000 (16:39 +0000)
committerRoy Marples <roy@marples.name>
Tue, 7 Feb 2023 16:39:27 +0000 (16:39 +0000)
So that domain_name doesn't overwrite domain_name_servers.
Fixes #184.

src/if-options.c

index 721c762c286cda344a628b7afccace7555791e97..fdb507065d58afc41ca3eab664cd1c7ba3bcb048 100644 (file)
@@ -190,10 +190,9 @@ add_environ(char ***array, const char *value, int uniq)
                return NULL;
        }
        *p++ = '\0';
-       l = strlen(match);
 
        while (list && list[i]) {
-               if (match && strncmp(list[i], match, l) == 0) {
+               if (match && strcmp(list[i], match) == 0) {
                        if (uniq) {
                                n = strdup(value);
                                if (n == NULL) {