From 3e7ec8ed402fca35161589100b7de09f23bd21ce Mon Sep 17 00:00:00 2001 From: ume Date: Tue, 2 Jan 2001 15:17:19 +0000 Subject: [PATCH] do not touch ra_addr if it is NULL. from IIJ SEIL team Obtained from: KAME --- sys/netinet6/in6_prefix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/in6_prefix.c b/sys/netinet6/in6_prefix.c index b75a72fed1d1..1eaea506bf98 100644 --- a/sys/netinet6/in6_prefix.c +++ b/sys/netinet6/in6_prefix.c @@ -603,14 +603,16 @@ add_each_addr(struct socket *so, struct rr_prefix *rpp, struct rp_addr *rap) if (ia6 != NULL) { if (ia6->ia6_ifpr == NULL) { /* link this addr and the prefix each other */ - IFAFREE(&rap->ra_addr->ia_ifa); + if (rap->ra_addr) + IFAFREE(&rap->ra_addr->ia_ifa); rap->ra_addr = ia6; rap->ra_addr->ia_ifa.ifa_refcnt++; ia6->ia6_ifpr = rp2ifpr(rpp); return; } if (ia6->ia6_ifpr == rp2ifpr(rpp)) { - IFAFREE(&rap->ra_addr->ia_ifa); + if (rap->ra_addr) + IFAFREE(&rap->ra_addr->ia_ifa); rap->ra_addr = ia6; rap->ra_addr->ia_ifa.ifa_refcnt++; return;