summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet6/in6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 10f7473..ea01b1f 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -214,14 +214,16 @@ static void
in6_ifaddloop(struct ifaddr *ifa)
{
struct rtentry *rt;
+ int need_loop;
/* If there is no loopback entry, allocate one. */
rt = rtalloc1(ifa->ifa_addr, 0, 0);
- if (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 ||
- (rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0)
- in6_ifloop_request(RTM_ADD, ifa);
+ need_loop = (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 ||
+ (rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0);
if (rt)
rtfree(rt);
+ if (need_loop)
+ in6_ifloop_request(RTM_ADD, ifa);
}
/*
OpenPOWER on IntegriCloud