Setting ipv6 route flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I realized that in route.c the inet6_rtm_new_route() function
the 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 relaized 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? If yes, why?
Attached is a one-liner patch that I use now to solve this for me.
It is against an usagi kernel but the issue is the same with stock
2.6.x kernels.

Thanks,
Gabor Fekete


--------------------------Hirdetés-----------------------------
INTERNETES NYELVTANULÁS!Tanulj ANGOLUL, NÉMETÜL kedvezményes áron a Médiabóval!3 Féle intenzitás; 3 Szint; Hanganyag CD-k; Ingyenes konzultáció!http://www.mediabo.hu/akcio/vipmail/jelentkezesi_lap.html
--- 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;
 

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux