else
rt->net.s_addr = INADDR_BROADCAST;
COPYOUT(rt->gate, rti_info[RTAX_GATEWAY]);
-#ifdef SIOCGIFPRIORITY
- rt->metric = rtm->rtm_priority;
-#endif
if (rtm->rtm_index)
rt->iface = if_findindex(ctx, rtm->rtm_index);
if (cmd != RTM_ADD)
rtm.hdr.rtm_flags |= RTF_PINNED;
#endif
-#ifdef SIOCGIFPRIORITY
- rtm.hdr.rtm_priority = rt->metric;
-#endif
if (cmd != RTM_DELETE) {
rtm.hdr.rtm_addrs |= RTA_IFA | RTA_IFP;
rt->net.s_addr != state->net.s_addr ||
rt->dest.s_addr != (state->addr.s_addr & state->net.s_addr))
rtm.hdr.rtm_flags |= RTF_STATIC;
+ else {
+#ifdef RTF_CLONING
+ rtm.hdr.rtm_flags |= RTF_CLONING;
+#endif
+ }
}
if (rt->dest.s_addr == rt->gate.s_addr &&
rt->net.s_addr == INADDR_BROADCAST)
} else
ipv6_mask(&rt->net, 128);
COPYOUT6(rt->gate, rti_info[RTAX_GATEWAY]);
-#ifdef SIOCGIFPRIORITY
- rt->metric = rtm->rtm_priority;
-#endif
if (rtm->rtm_index)
rt->iface = if_findindex(ctx, rtm->rtm_index);
rtm.hdr.rtm_flags |= RTF_PINNED;
#endif
rtm.hdr.rtm_addrs = RTA_DST | RTA_NETMASK;
-#ifdef SIOCGIFPRIORITY
- rtm.hdr.rtm_priority = rt->metric;
-#endif
/* None interface subnet routes are static. */
if (IN6_IS_ADDR_UNSPECIFIED(&rt->gate)) {
#ifdef RTF_CLONING
rtm.hdr.rtm_flags |= RTF_CLONING;
#endif
- } else
+ } else
rtm.hdr.rtm_flags |= RTF_GATEWAY | RTF_STATIC;
if (cmd == RTM_ADD)
#ifndef INTERFACE_H
#define INTERFACE_H
-#include <sys/ioctl.h> /* for SIOCGIFPRIORITY */
-
#include <net/if.h>
#include <net/route.h> /* for RTM_ADD et all */
#include <netinet/in.h>
-/* Some systems have route metrics */
+/* Some systems have route metrics.
+ * OpenBSD route priority is not this. */
#ifndef HAVE_ROUTE_METRIC
-# if defined(__linux__) || defined(SIOCGIFPRIORITY)
+# if defined(__linux__)
# define HAVE_ROUTE_METRIC 1
# endif
#endif