summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-01-23 11:37:37 +0000
committerRoy Marples <roy@marples.name>2019-01-23 11:37:37 +0000
commit9c5d198072450e7019b3947e85d8f90e82f97445 (patch)
treef78e46f684e3923330adc9b2b396d3dbcfc7c14b /src/if.c
parentc9463d17ed1dc7ea1b8e7b55476838c0f0a267e1 (diff)
downloaddhcpcd-9c5d198072450e7019b3947e85d8f90e82f97445.tar.xz
DHCP: Remove #defines for functions when INET is disabled
This allows us to optimise the code better and hopefull become less error prone.
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/if.c b/src/if.c
index fabf99f3..c0d26301 100644
--- a/src/if.c
+++ b/src/if.c
@@ -81,8 +81,10 @@ if_free(struct interface *ifp)
#ifdef IPV4LL
ipv4ll_free(ifp);
#endif
+#ifdef INET
dhcp_free(ifp);
ipv4_free(ifp);
+#endif
dhcp6_free(ifp);
ipv6nd_free(ifp);
ipv6_free(ifp);
@@ -728,11 +730,12 @@ if_cmp(const struct interface *si, const struct interface *ti)
return -1;
if (si->carrier < ti->carrier)
return 1;
-
+#ifdef INET
if (D_STATE_RUNNING(si) && !D_STATE_RUNNING(ti))
return -1;
if (!D_STATE_RUNNING(si) && D_STATE_RUNNING(ti))
return 1;
+#endif
if (RS_STATE_RUNNING(si) && !RS_STATE_RUNNING(ti))
return -1;
if (!RS_STATE_RUNNING(si) && RS_STATE_RUNNING(ti))