nlm.rt.rtm_scope = RT_SCOPE_LINK;
else
nlm.rt.rtm_scope = RT_SCOPE_UNIVERSE;
- nlm.rt.rtm_type = RTN_UNICAST;
+ if (rt->rt_flags & RTF_REJECT)
+ nlm.rt.rtm_type = RTN_UNREACHABLE;
+ else
+ nlm.rt.rtm_type = RTN_UNICAST;
}
#define ADDSA(type, sa) \
sa_in6_init(&rt->rt_netmask, &netmask);
if (addr->flags & IPV6_AF_DELEGATEDPFX) {
rt->rt_flags |= RTF_REJECT;
+ /* Linux does not like a gateway for a reject route. */
+#ifndef __linux__
sa_in6_init(&rt->rt_gateway, &in6addr_loopback);
+#endif
} else
rt->rt_gateway.sa_family = AF_UNSPEC;
sa_in6_init(&rt->rt_ifa, &addr->addr);