]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Match if_address
authorRoy Marples <roy@marples.name>
Fri, 22 Jul 2016 21:01:24 +0000 (21:01 +0000)
committerRoy Marples <roy@marples.name>
Fri, 22 Jul 2016 21:01:24 +0000 (21:01 +0000)
if-sun.c

index 5f6d5ed81078644bf5b96d5555d9e2a17bbb04e9..36ba24c54be8efc62bb5555fe03b41fce6d1b8c4 100644 (file)
--- a/if-sun.c
+++ b/if-sun.c
@@ -1285,8 +1285,12 @@ if_address6(unsigned char cmd, const struct ipv6_addr *ia)
        struct sockaddr_in6     *sin6_addr, *sin6_mask;
        struct priv             *priv;
 
+       /* Either remove the alias or ensure it exists. */
+       if (if_plumb(cmd, ia->iface->ctx, AF_INET, ia->alias) == -1)
+               return -1;
+
        if (cmd == RTM_DELADDR)
-               return if_plumb(cmd, ia->iface->ctx, AF_INET6, ia->alias);
+               return 0;
 
        if (cmd != RTM_NEWADDR) {
                errno = EINVAL;