diff options
| author | Roy Marples <roy@marples.name> | 2016-10-25 15:33:02 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-10-25 15:33:02 +0000 |
| commit | 609ea901d1cc8388776822b5803ee1c4a7f1baf4 (patch) | |
| tree | 6591811871241cc9c3462a7ce7a82b03759a0423 /if.c | |
| parent | 780602be948eb87bd6822940403b0a182d5fd7a4 (diff) | |
| download | dhcpcd-609ea901d1cc8388776822b5803ee1c4a7f1baf4.tar.xz | |
Remove address family specific routing and introduce address family
agnostic routing.
This makes the platform drivers simpler and reduces some code duplication.
Needs a lot of testing.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -82,6 +82,7 @@ if_free(struct interface *ifp) dhcp6_free(ifp); ipv6nd_free(ifp); ipv6_free(ifp); + rt_freeif(ifp); free_options(ifp->options); free(ifp); } @@ -454,9 +455,6 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) break; } ifp->hwlen = sdl->sdl_alen; -#ifndef CLLADDR -# define CLLADDR(s) (const void *)((s)->sdl_data + (s)->sdl_nlen) -#endif memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen); #elif AF_PACKET sll = (const void *)ifa->ifa_addr; @@ -633,6 +631,18 @@ if_findindex(struct if_head *ifaces, unsigned int idx) return if_findindexname(ifaces, idx, NULL); } +struct interface * +if_loopback(struct dhcpcd_ctx *ctx) +{ + struct interface *ifp; + + TAILQ_FOREACH(ifp, ctx->ifaces, next) { + if (ifp->flags & IFF_LOOPBACK) + return ifp; + } + return NULL; +} + int if_domtu(const struct interface *ifp, short int mtu) { |
