do not touch ra_addr if it is NULL. from IIJ SEIL team

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2001-01-02 15:17:19 +00:00
parent 7d9e9f8884
commit 41027e03dd

View File

@ -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;