summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-05-18 16:23:28 +0000
committerRoy Marples <roy@marples.name>2016-05-18 16:23:28 +0000
commit109146e29e2eadcff467d273018d789359fa11e1 (patch)
treea6ecb9c14fb154091056060eb5f59abfb0baaac4 /ipv6.c
parent7f911ce43483c446672b18d67515f021a0fc8bf1 (diff)
downloaddhcpcd-109146e29e2eadcff467d273018d789359fa11e1.tar.xz
Rework if_address to just use an ipv4_addr structure, similar to how
if_address6 works. Use a pointer to the ipv4_addr for the address we added for dhcp and ipv4ll states. This is quite some churn throughout the IPv4 stack, but makes the binary smaller (at least on Linux/amd64). It will be needed to support adding addresses on Solaris.
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipv6.c b/ipv6.c
index 1e0f234a..05c9c3b5 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -589,9 +589,9 @@ ipv6_deleteaddr(struct ipv6_addr *ia)
logger(ia->iface->ctx, LOG_INFO, "%s: deleting address %s",
ia->iface->name, ia->saddr);
- if (if_deladdress6(ia) == -1 &&
+ if (if_address6(RTM_DELADDR, ia) == -1 &&
errno != EADDRNOTAVAIL && errno != ENXIO && errno != ENODEV)
- logger(ia->iface->ctx, LOG_ERR, "if_deladdress6: :%m");
+ logger(ia->iface->ctx, LOG_ERR, "if_address6: :%m");
/* NOREJECT is set if we delegated exactly the prefix to another
* address.
@@ -701,7 +701,7 @@ ipv6_addaddr(struct ipv6_addr *ap, const struct timespec *now)
#endif
}
- if (if_addaddress6(ap) == -1) {
+ if (if_address6(RTM_NEWADDR, ap) == -1) {
logger(ap->iface->ctx, LOG_ERR, "if_addaddress6: %m");
/* Restore real pltime and vltime */
ap->prefix_pltime = pltime;
@@ -824,10 +824,10 @@ ipv6_addaddrs(struct ipv6_addrhead *addrs)
apf->iface->name,
ap->saddr,
ap->iface->name);
- if (if_deladdress6(apf) == -1 &&
+ if (if_address6(RTM_DELADDR, apf) == -1 &&
errno != EADDRNOTAVAIL && errno != ENXIO)
logger(apf->iface->ctx, LOG_ERR,
- "if_deladdress6: %m");
+ "if_address6: %m");
apf->flags &=
~(IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED);
} else if (apf)