OK, This time without typos. Hi,
I realized that in net/ipv6/route.c in the inet6_rtm_new_route() function the call to inet6_rtm_to_rtmsg() does not take into account the user supplied flags. This way it seems to be not possible to set the RTF_DEFAULT flag of a default route (dest address being "any"). It is true that the new route will end up in the default route list anyway but then the ip6_route_output() function will not call rt6_best_dflt(). I realized it when I had to modify the default route selection algorithm. The kernel rt6_add_dflt_router() function properly sets the RTF_DEFAULT flag but user space functions cannot set it using netlink (e.g. iproute does not set it either). Is it the intended behaviour? Attached is a one-liner patch that I use now to solve this for me. Thanks, Gabor Fekete -- Gabor Fekete [EMAIL PROTECTED] -- http://www.fastmail.fm - The professional email service
--- linux26/net/ipv6/route.c 2005-10-13 11:25:24.000000000 +0300 +++ linux26-new/net/ipv6/route.c 2005-11-16 22:37:05.000000000 +0200 @@ -1651,7 +1651,7 @@ rtmsg->rtmsg_dst_len = r->rtm_dst_len; rtmsg->rtmsg_src_len = r->rtm_src_len; - rtmsg->rtmsg_flags = RTF_UP; + rtmsg->rtmsg_flags = RTF_UP | r->rtm_flags; if (r->rtm_type == RTN_UNREACHABLE) rtmsg->rtmsg_flags |= RTF_REJECT;