diff mbox

[OpenWrt-Devel] netifd: Prevent flapping IPv6 routes

Message ID 1442574790-24055-1-git-send-email-kristian.evensen@gmail.com
State Accepted
Headers show

Commit Message

Kristian Evensen Sept. 18, 2015, 11:13 a.m. UTC
From: Kristian Evensen <kristian.evensen@gmail.com>

Comparing valid_until will always return false as the value is updated for each
route update message. This causes IPv6 routes to jump more around than House of
Pain, which might have undesirable consequences for user-space and user-space
applications.

Removing the valid_until comparison when setting keep fixes this problem, and
seems to have no side-effects. I am no IPv6 expert, but I see that valid of the
route is updated correctly and route is deleted if I block the route update
messages.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
---
 interface-ip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/interface-ip.c b/interface-ip.c
index 8eb2ff3..4a2ee35 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -591,7 +591,7 @@  interface_update_proto_route(struct vlist_tree *tree,
 	if (node_old && node_new)
 		keep = !memcmp(&route_old->nexthop, &route_new->nexthop, sizeof(route_old->nexthop)) &&
 			(route_old->mtu == route_new->mtu) && (route_old->type == route_new->type) &&
-			(route_old->valid_until == route_new->valid_until) && !route_old->failed;
+			!route_old->failed;
 
 	if (node_old) {
 		if (!(route_old->flags & DEVADDR_EXTERNAL) && route_old->enabled && !keep)