]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Stop using link_addr(3).
authorRoy Marples <roy@marples.name>
Fri, 27 Feb 2015 14:21:01 +0000 (14:21 +0000)
committerRoy Marples <roy@marples.name>
Fri, 27 Feb 2015 14:21:01 +0000 (14:21 +0000)
Instead just set the sdl_index to specify which interface the route is for.

dhcpcd.h
if-bsd.c
if.c

index 8fcf33b9e2b692ec3ece494c27bd81d9303c981f..30617ecd3893cf855c0385a463fe6008a71810f2 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -66,9 +66,6 @@ struct interface {
        unsigned int index;
        unsigned int flags;
        sa_family_t family;
-#ifdef __FreeBSD__
-       struct sockaddr_storage linkaddr;
-#endif
        unsigned char hwaddr[HWADDR_LEN];
        uint8_t hwlen;
        unsigned int metric;
index 20002c637c35bedec19f7fd4289074ac07600722..389bcc516b9ea20baa92e0cceecea968ecf1c575 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -153,13 +153,11 @@ static void
 if_linkaddr(struct sockaddr_dl *sdl, const struct interface *ifp)
 {
 
-#ifdef __FreeBSD__
-       memcpy(sdl, &ifp->linkaddr, sizeof(*sdl));
-       sdl->sdl_nlen = sdl->sdl_alen = sdl->sdl_slen = 0;
-#else
+       memset(sdl, 0, sizeof(*sdl));
+       sdl->sdl_family = AF_LINK;
        sdl->sdl_len = sizeof(*sdl);
-       link_addr(ifp->name, sdl);
-#endif
+       sdl->sdl_nlen = sdl->sdl_alen = sdl->sdl_slen = 0;
+       sdl->sdl_index = (unsigned short)ifp->index;
 }
 #endif
 
diff --git a/if.c b/if.c
index 26d0386cf454f78b7784cbf29ceaf397292cd853..36e77fb6f6a31fd8a6be441436c1229754b65d7a 100644 (file)
--- a/if.c
+++ b/if.c
@@ -328,9 +328,6 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
                        }
 #endif
 
-#ifdef __FreeBSD__
-                       memcpy(&ifp->linkaddr, sdl, sdl->sdl_len);
-#endif
                        ifp->index = sdl->sdl_index;
                        switch(sdl->sdl_type) {
 #ifdef IFT_BRIDGE