]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
sun: Update the interface index after plumbing
authorRoy Marples <roy@marples.name>
Sun, 14 Apr 2019 11:01:21 +0000 (14:01 +0300)
committerRoy Marples <roy@marples.name>
Sun, 14 Apr 2019 11:01:21 +0000 (14:01 +0300)
Otherwise it's likely zero ....

src/if-sun.c

index d65347550240cb41fb7473b19c82989a1bb5a916..10816dd053f3c7868fc74f4bcedb6f7f367e5514 100644 (file)
@@ -1489,6 +1489,9 @@ if_address(unsigned char cmd, const struct ipv4_addr *ia)
                return -1;
        }
 
+       /* We need to update the index now */
+       ia->iface->index = if_nametoindex(ia->alias);
+
        sin_addr = (struct sockaddr_in *)&ss_addr;
        sin_addr->sin_family = AF_INET;
        sin_addr->sin_addr = ia->addr;