Allows us to delete in-use subnet routes on FreeBSD.
Some BSD systems do not allow the manipulation of automatically added subnet
routes. You can find discussion here:
http://mail-index.netbsd.org/tech-net/2008/12/03/msg000896.html
-BSD systems where this has been fixed are:
+BSD systems where this has been fixed or is known to work are:
NetBSD-5.0
+ FreeBSD-10.0
Some BSD systems protect against IPv6 NS/NA messages by ensuring that the
source address matches an address/prefix on the interface.
Occured in NetBSD-5.0, fixed in NetBSD-6.99.29
Occured in OpenBSD-4.2, fixed in OpenBSD-5.0
-On FreeBSD-10 dhcpcd cannot delete IPv4 subnet routes.
-
We try and detect how dhcpcd should interact with system services at runtime.
If we cannot auto-detect how do to this, or it is wrong then
you can change this by passing shell commands to --serviceexists,
}
#endif
-#ifdef __FreeBSD__
- syslog(LOG_WARNING, "FreeBSD errors that are worked around:");
- syslog(LOG_WARNING, "IPv4 subnet routes cannot be deleted");
-#endif
-
/* When running dhcpcd against a single interface, we need to retain
* the old behaviour of waiting for an IP address */
if (ctx.ifc == 1 && !(ctx.options & DHCPCD_BACKGROUND))
} else
rtm.hdr.rtm_type = RTM_DELETE;
rtm.hdr.rtm_flags = RTF_UP;
+#ifdef RTM_PINNED
+ if (rtm.hdr.rtm_type != RTM_ADD)
+ rtm.hdr.rtm_flags |= RTF_PINNED;
+#endif
#ifdef SIOCGIFPRIORITY
rtm.hdr.rtm_priority = rt->metric;
#endif
else
rtm.hdr.rtm_type = RTM_DELETE;
rtm.hdr.rtm_flags = RTF_UP | (int)rt->flags;
+#ifdef RTM_PINNED
+ if (rtm.hdr.rtm_type != RTM_ADD)
+ rtm.hdr.rtm_flags |= RTF_PINNED;
+#endif
rtm.hdr.rtm_addrs = RTA_DST | RTA_NETMASK;
#ifdef SIOCGIFPRIORITY
rtm.hdr.rtm_priority = rt->metric;