diff -ur dhcpcd-3.0.8/dhcp.c dhcpcd-3.0.8/dhcp.c --- dhcpcd-3.0.8/dhcp.c 2006-12-21 21:11:10.000000000 +0000 +++ dhcpcd-3.0.8/dhcp.c 2006-12-23 16:33:13.000000000 +0000 @@ -165,8 +165,8 @@ *p++ = DHCP_CSR; /* RFC 3442 states classless static routes should be before routers * and static routes as classless static routes override them both */ - *p++ = DHCP_ROUTERS; *p++ = DHCP_STATICROUTE; + *p++ = DHCP_ROUTERS; *p++ = DHCP_HOSTNAME; *p++ = DHCP_DNSSEARCH; *p++ = DHCP_DNSDOMAIN; diff -ur dhcpcd-3.0.8/interface.c dhcpcd-3.0.8/interface.c --- dhcpcd-3.0.8/interface.c 2006-12-21 21:11:10.000000000 +0000 +++ dhcpcd-3.0.8/interface.c 2006-12-23 16:32:28.000000000 +0000 @@ -318,7 +318,7 @@ rtm.hdr.rtm_type = change ? RTM_CHANGE : del ? RTM_DELETE : RTM_ADD; rtm.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; - if (netmask.s_addr == 0xffffffff) + if (netmask.s_addr == INADDR_BROADCAST) rtm.hdr.rtm_flags |= RTF_HOST; rtm.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; @@ -610,9 +610,18 @@ dstd = strdup (inet_ntoa (destination)); gend = strdup (inet_ntoa (netmask)); - logger (LOG_INFO, "%s route to %s (%s) via %s, metric %d", - change ? "changing" : del ? "removing" : "adding", - dstd, gend, inet_ntoa (gateway), metric); + if (gateway.s_addr == destination.s_addr) + logger (LOG_INFO, "%s route to %s (%s) metric %d", + change ? "changing" : del ? "removing" : "adding", + dstd, gend, metric); + else if (destination.s_addr == INADDR_ANY && netmask.s_addr == INADDR_ANY) + logger (LOG_INFO, "%s default route via %s", + change ? "changing" : del ? "removing" : "adding", + inet_ntoa (gateway)); + else + logger (LOG_INFO, "%s route to %s (%s) via %s, metric %d", + change ? "changing" : del ? "removing" : "adding", + dstd, gend, inet_ntoa (gateway), metric); if (dstd) free (dstd); if (gend) @@ -636,7 +645,8 @@ { nlm.hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL; nlm.rt.rtm_protocol = RTPROT_BOOT; - if (gateway.s_addr == 0) + if (gateway.s_addr == INADDR_ANY || + gateway.s_addr == destination.s_addr) nlm.rt.rtm_scope = RT_SCOPE_LINK; else nlm.rt.rtm_scope = RT_SCOPE_UNIVERSE; @@ -652,7 +662,7 @@ add_attr_l (&nlm.hdr, sizeof (nlm), RTA_DST, &destination.s_addr, sizeof (destination.s_addr)); - if (gateway.s_addr != 0) + if (gateway.s_addr != 0 && gateway.s_addr != destination.s_addr) add_attr_l (&nlm.hdr, sizeof (nlm), RTA_GATEWAY, &gateway.s_addr, sizeof (gateway.s_addr));