summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-01-23 13:01:19 +0000
committerRoy Marples <roy@marples.name>2019-01-23 13:01:19 +0000
commit09144e2db83d24d1e869a55a8a452b96eca9dd30 (patch)
tree61cb8ee45697ffec768ef5243a13b795424574ed /src/if.c
parent68135c5d0a130ba301ca2e4552ba3131d92be05f (diff)
downloaddhcpcd-09144e2db83d24d1e869a55a8a452b96eca9dd30.tar.xz
DHCP6: Remove #defines for functions when DHCP6 is disabled
This allows us to optimise the code better and hopefully become less error prone.
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/if.c b/src/if.c
index c0d26301..f6d7ab09 100644
--- a/src/if.c
+++ b/src/if.c
@@ -85,7 +85,9 @@ if_free(struct interface *ifp)
dhcp_free(ifp);
ipv4_free(ifp);
#endif
+#ifdef DHCP6
dhcp6_free(ifp);
+#endif
ipv6nd_free(ifp);
ipv6_free(ifp);
rt_freeif(ifp);
@@ -740,10 +742,12 @@ if_cmp(const struct interface *si, const struct interface *ti)
return -1;
if (!RS_STATE_RUNNING(si) && RS_STATE_RUNNING(ti))
return 1;
+#ifdef DHCP6
if (D6_STATE_RUNNING(si) && !D6_STATE_RUNNING(ti))
return -1;
if (!D6_STATE_RUNNING(si) && D6_STATE_RUNNING(ti))
return 1;
+#endif
#ifdef INET
/* Special attention needed here due to states and IPv4LL. */