]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Try and make the subnet route identical to the kernel one.
authorRoy Marples <roy@marples.name>
Sat, 13 Dec 2008 09:40:27 +0000 (09:40 +0000)
committerRoy Marples <roy@marples.name>
Sat, 13 Dec 2008 09:40:27 +0000 (09:40 +0000)
if-bsd.c

index 8909fd963b8a99f1c6aa769227ea83b072a28486..9bf8a4edab44165ccd8ae3489eb5cfeee58b431b 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -203,14 +203,16 @@ if_route(const struct interface *iface, const struct in_addr *dest,
        }
 
        ADDADDR(dest);
-       if (rtm.hdr.rtm_flags & RTF_HOST ||
-           !(rtm.hdr.rtm_flags & RTF_STATIC))
-       {
+       if (rtm.hdr.rtm_flags & RTF_HOST) {
                /* Make us a link layer socket for the host gateway */
                memset(&su, 0, sizeof(su));
                su.sdl.sdl_len = sizeof(struct sockaddr_dl);
                link_addr(iface->name, &su.sdl);
                ADDSU(su);
+       } else if (!(rtm.hdr.rtm_flags & RTF_STATIC)) {
+               memset(&su, 0, sizeof(su));
+               su.sdl.sdl_index = if_nametoindex(iface->name);
+               ADDSU(su);
        } else
                ADDADDR(gate);