summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-07-25 17:20:41 +0100
committerRoy Marples <roy@marples.name>2019-07-25 17:20:41 +0100
commitfc22030db0f8adbfb104cdbbd9bde792ebd1a627 (patch)
tree26503e1614f8ec2ebb8d5cd60e2a4fdbd1550849 /src/ipv6.c
parent514c4d72f5cd72aedae70e2e40e325a62e5740ff (diff)
downloaddhcpcd-fc22030db0f8adbfb104cdbbd9bde792ebd1a627.tar.xz
Remove ND6 Advertisement from SMALL builds.
This is quite a saving and is only used for IP6 address sharing which only works on NetBSD.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index e33f0bdf..0a3ba8c1 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -616,8 +616,10 @@ ipv6_deleteaddr(struct ipv6_addr *ia)
}
}
+#ifdef ND6_ADVERTISE
/* Advertise the address if it exists on another interface. */
ipv6nd_advertise(ia);
+#endif
}
static int
@@ -625,8 +627,10 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now)
{
struct interface *ifp;
uint32_t pltime, vltime;
- bool vltime_was_zero;
__printflike(1, 2) void (*logfunc)(const char *, ...);
+#ifndef SMALL
+ bool vltime_was_zero;
+#endif
#ifdef __sun
struct ipv6_state *state;
struct ipv6_addr *ia2;
@@ -694,7 +698,9 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now)
" seconds",
ifp->name, ia->prefix_pltime, ia->prefix_vltime);
+#ifndef SMALL
vltime_was_zero = ia->prefix_vltime == 0;
+#endif
if (if_address6(RTM_NEWADDR, ia) == -1) {
logerr(__func__);
/* Restore real pltime and vltime */
@@ -758,9 +764,11 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now)
}
#endif
+#ifdef ND6_ADVERTISE
/* Re-advertise the preferred address to be safe. */
if (!vltime_was_zero)
ipv6nd_advertise(ia);
+#endif
return 0;
}
@@ -1081,9 +1089,11 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx,
case RTM_DELADDR:
if (ia != NULL) {
TAILQ_REMOVE(&state->addrs, ia, next);
+#ifdef ND6_ADVERTISE
/* Advertise the address if it exists on
* another interface. */
ipv6nd_advertise(ia);
+#endif
/* We'll free it at the end of the function. */
}
break;