From: Roy Marples Date: Sat, 13 Dec 2008 09:40:27 +0000 (+0000) Subject: Try and make the subnet route identical to the kernel one. X-Git-Tag: v5.0.0~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e346dd7ccc9fff2c6d5e3e187601cb9eac696b21;p=thirdparty%2Fdhcpcd.git Try and make the subnet route identical to the kernel one. --- diff --git a/if-bsd.c b/if-bsd.c index 8909fd96..9bf8a4ed 100644 --- 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);