From a10bfcd45d602a114cacad4e651b55cd4b351624 Mon Sep 17 00:00:00 2001 From: melifaro Date: Sun, 13 Dec 2015 16:37:01 +0000 Subject: [PATCH] Fix PINNED routes handling. Before r291643, adding new interface prefix had the following logic: try_add: EEXIST && (PINNED) { try_del(w/o PINNED flag) if (OK) try_add(PINNED) } In r291643, deletion was performed w/ PINNED flag held which leaded to new interface prefixes (like ::1) overriding older ones. Fix this by requesting deletion w/o RTF_PINNED. PR: kern/205285 Submitted by: Fabian Keil --- sys/net/route.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/route.c b/sys/net/route.c index 6b19eddbad87..86f99ee93df9 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1586,7 +1586,10 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, */ struct sockaddr *info_dst = info->rti_info[RTAX_DST]; info->rti_info[RTAX_DST] = ndst; + /* Do not delete existing PINNED(interface) routes */ + info->rti_flags &= ~RTF_PINNED; rt_old = rt_unlinkrte(rnh, info, &error); + info->rti_flags |= RTF_PINNED; info->rti_info[RTAX_DST] = info_dst; if (rt_old != NULL) rn = rnh->rnh_addaddr(ndst, netmask, rnh,