Skip to contentSkip to conversation

ipv6: protocol for address routes

RFC Applied Stephen Hemminger 2 participants 3 messages Aug 19, 2008 – Aug 23, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 ipv6: protocol for address routes

This fixes a problem spotted with zebra, but not sure if it is necessary a kernel problem. With IPV6 when an address is added to an interface, Zebra creates a duplicate RIB entry, one as a connected route, and other as a kernel route.

When an address is added to an interface the RTN_NEWADDR message causes Zebra to create a connected route. In IPV4 when an address is added to an interface a RTN_NEWROUTE message is set to user space with the protocol RTPROT_KERNEL. Zebra ignores these messages, because it already has the connected route.

The problem is that route created in IPV6 has route protocol == RTPROT_BOOT. Was this a design decision or a bug? This fixes it. Same patch applies to both net-2.6 and stable.

net/ipv6/addrconf.c +1 -0
@@ -1688,6 +1688,7 @@ addrconf_prefix_route(struct in6_addr *p
 		.fc_dst_len = plen,
 		.fc_flags = RTF_UP | flags,
 		.fc_nlinfo.nl_net = dev_net(dev),
+		.fc_protocol = RTPROT_KERNEL,
 	};
 
 	ipv6_addr_copy(&cfg.fc_dst, pfx);
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Tue, 19 Aug 2008 08:54:41 -0700

Quoted 9 lines

This fixes a problem spotted with zebra, but not sure if it is necessary a kernel problem. With IPV6 when an address is added to an interface, Zebra creates a duplicate RIB entry, one as a connected route, and other as a kernel route.

When an address is added to an interface the RTN_NEWADDR message causes Zebra to create a connected route. In IPV4 when an address is added to an interface a RTN_NEWROUTE message is set to user space with the protocol RTPROT_KERNEL. Zebra ignores these messages, because it already has the connected route.

Quoted 5 lines

The problem is that route created in IPV6 has route protocol == RTPROT_BOOT. Was this a design decision or a bug? This fixes it. Same patch applies to both net-2.6 and stable.

I don't have any strong opinion and it seems correct to me.

Anyone else have any thoughts before I apply this?

Quoted 14 lines
net/ipv6/addrconf.c +1 -1
@@ -1688,6 +1688,7 @@ addrconf_prefix_route(struct in6_addr *p
 		.fc_dst_len = plen,
 		.fc_flags = RTF_UP | flags,
 		.fc_nlinfo.nl_net = dev_net(dev),
+		.fc_protocol = RTPROT_KERNEL,
 	};
 
 	ipv6_addr_copy(&cfg.fc_dst, pfx);
--

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#2 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Tue, 19 Aug 2008 08:54:41 -0700

Quoted 11 lines

This fixes a problem spotted with zebra, but not sure if it is necessary a kernel problem. With IPV6 when an address is added to an interface, Zebra creates a duplicate RIB entry, one as a connected route, and other as a kernel route.

When an address is added to an interface the RTN_NEWADDR message causes Zebra to create a connected route. In IPV4 when an address is added to an interface a RTN_NEWROUTE message is set to user space with the protocol RTPROT_KERNEL. Zebra ignores these messages, because it already has the connected route.

Quoted 5 lines

The problem is that route created in IPV6 has route protocol == RTPROT_BOOT. Was this a design decision or a bug? This fixes it. Same patch applies to both net-2.6 and stable.

I've applied this to net-2.6, thanks Stephen.