]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile warnings.
authorRoy Marples <roy@marples.name>
Fri, 8 Apr 2016 20:50:58 +0000 (20:50 +0000)
committerRoy Marples <roy@marples.name>
Fri, 8 Apr 2016 20:50:58 +0000 (20:50 +0000)
ipv4ll.c
ipv4ll.h

index caee1ecbf3d24562ed1cb1ce75d0a5e68b4dc5a3..7be32d64678269b1e7bbafd190dbdd12a7b8f223 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -445,12 +445,12 @@ ipv4ll_freedrop(struct interface *ifp, int drop)
        }
 }
 
-int
-ipv4ll_handlert(struct dhcpcd_ctx *ctx, __unused int cmd, const struct rt *rt)
-{
 /* This may cause issues in BSD systems, where running as a single dhcpcd
  * daemon would solve this issue easily. */
 #ifdef HAVE_ROUTE_METRIC
+int
+ipv4ll_handlert(struct dhcpcd_ctx *ctx, __unused int cmd, const struct rt *rt)
+{
        struct interface *ifp;
 
        /* Only interested in default route changes. */
@@ -466,7 +466,7 @@ ipv4ll_handlert(struct dhcpcd_ctx *ctx, __unused int cmd, const struct rt *rt)
                if_initrt(ifp);
                ipv4_buildroutes(ctx);
        }
-#endif
 
        return 0;
 }
+#endif
index 37093f38eef73542315c380b70ed014f9d767868..8350f534a398e8b70c6cc5a9b77c63ce44b919a9 100644 (file)
--- a/ipv4ll.h
+++ b/ipv4ll.h
@@ -65,7 +65,11 @@ ssize_t ipv4ll_env(char **, const char *, const struct interface *);
 void ipv4ll_start(void *);
 void ipv4ll_claimed(void *);
 void ipv4ll_handle_failure(void *);
+#ifdef HAVE_ROUTE_METRIC
 int ipv4ll_handlert(struct dhcpcd_ctx *, int, const struct rt *);
+#else
+#define ipv4ll_handlert(a, b, c) (0)
+#endif
 
 #define ipv4ll_free(ifp) ipv4ll_freedrop((ifp), 0);
 #define ipv4ll_drop(ifp) ipv4ll_freedrop((ifp), 1);