]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Link local routes should not be static.
authorRoy Marples <roy@marples.name>
Tue, 13 Nov 2007 10:22:45 +0000 (10:22 +0000)
committerRoy Marples <roy@marples.name>
Tue, 13 Nov 2007 10:22:45 +0000 (10:22 +0000)
interface.c

index 6177380fb493f080b40e39cab216a50c6b543baf..9fbe007a589db89e301cf3d7dfe435d33f017bb3 100644 (file)
@@ -560,7 +560,10 @@ static int do_route (const char *ifname,
        rtm.hdr.rtm_version = RTM_VERSION;
        rtm.hdr.rtm_seq = ++seq;
        rtm.hdr.rtm_type = change ? RTM_CHANGE : del ? RTM_DELETE : RTM_ADD;
-       rtm.hdr.rtm_flags = RTF_UP | RTF_STATIC;
+       rtm.hdr.rtm_flags = RTF_UP;
+       if (ntohl (destination.s_addr) != LINKLOCAL_ADDR &&
+               ntohl (netmask.s_addr) != LINKLOCAL_MASK)
+               rtm.hdr.rtm_flags |= RTF_STATIC;
 
        /* This order is important */
        rtm.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;