summaryrefslogtreecommitdiffstats
path: root/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-09-06 10:03:08 +0000
committerRoy Marples <roy@marples.name>2016-09-06 10:03:08 +0000
commit527a983d2667effb8998bdbde6149b48501da6ee (patch)
tree2ffbb82731b4e4a935d15f00290c0bdcf15cb715 /if-bsd.c
parentdf46ce682bd37e947e42f695151998cc0ec91b76 (diff)
downloaddhcpcd-527a983d2667effb8998bdbde6149b48501da6ee.tar.xz
Rename var to avoid a global on OpenBSD.
Diffstat (limited to 'if-bsd.c')
-rw-r--r--if-bsd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/if-bsd.c b/if-bsd.c
index 26f5c3a8..8bc4b496 100644
--- 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);
}