]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Rename var to avoid a global on OpenBSD.
authorRoy Marples <roy@marples.name>
Tue, 6 Sep 2016 10:03:08 +0000 (10:03 +0000)
committerRoy Marples <roy@marples.name>
Tue, 6 Sep 2016 10:03:08 +0000 (10:03 +0000)
if-bsd.c

index 26f5c3a8aaae573b1f91148775d3eff68d0bba19..8bc4b496d9bfae9759c5dc38f47a551b67b83dc4 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -1288,7 +1288,7 @@ static void
 if_ifinfo(struct dhcpcd_ctx *ctx, const struct if_msghdr *ifm)
 {
        struct interface *ifp;
-       int link;
+       int link_state;
 #ifdef IPV6_POLLADDRFLAG
        struct ipv6_state *state;
        struct ipv6_addr *ia;
@@ -1299,11 +1299,11 @@ if_ifinfo(struct dhcpcd_ctx *ctx, const struct if_msghdr *ifm)
                return;
        switch (ifm->ifm_data.ifi_link_state) {
        case LINK_STATE_DOWN:
-               link = LINK_DOWN;
+               link_state = LINK_DOWN;
                break;
        case LINK_STATE_UP:
-               /* Some BSD's don't take the link down on downed interface. */
-               link = ifm->ifm_flags & IFF_UP ? LINK_UP : LINK_DOWN;
+               /* dhcpcd considers the link down if IFF_UP is not set. */
+               link_state = ifm->ifm_flags & IFF_UP ? LINK_UP : LINK_DOWN;
 
 #ifdef IPV6_POLLADDRFLAG
                /* We need to update the address flags incase they were
@@ -1320,10 +1320,10 @@ if_ifinfo(struct dhcpcd_ctx *ctx, const struct if_msghdr *ifm)
                 * IFF_RUNNING as some drivers that don't handle link state also
                 * don't set IFF_RUNNING when this routing message is generated.
                 * As such, it is a race ...*/
-               link = LINK_UNKNOWN;
+               link_state = LINK_UNKNOWN;
                break;
        }
-       dhcpcd_handlecarrier(ctx, link,
+       dhcpcd_handlecarrier(ctx, link_state,
            (unsigned int)ifm->ifm_flags, ifp->name);
 }