Added several socket close() which were mistakenly forgotten.
Reported by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
This commit is contained in:
parent
690a43db7e
commit
32387b216d
@ -513,6 +513,7 @@ init_prefix(struct in6_prefixreq *ipr)
|
||||
"This should not happen if I am router", __FUNCTION__,
|
||||
inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf,
|
||||
sizeof(ntopbuf)), ipr->ipr_origin);
|
||||
close(s);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -170,6 +170,7 @@ if_getflags(int ifindex, int oifflags)
|
||||
close(s);
|
||||
return (oifflags & ~IFF_UP);
|
||||
}
|
||||
close(s);
|
||||
return (ifr.ifr_flags);
|
||||
}
|
||||
|
||||
|
@ -206,12 +206,6 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm)
|
||||
if ((rr_pco_check(len, rpm) != NULL))
|
||||
return 1;
|
||||
|
||||
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
|
||||
syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(&irr, 0, sizeof(irr));
|
||||
irr.irr_origin = PR_ORIG_RR;
|
||||
irr.irr_m_len = rpm->rpm_matchlen;
|
||||
@ -260,6 +254,12 @@ do_rr(int len, struct icmp6_router_renum *rr)
|
||||
/* get iflist block from kernel again, to get up-to-date information */
|
||||
init_iflist();
|
||||
|
||||
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
|
||||
syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while (cp < lim) {
|
||||
int rpmlen;
|
||||
|
||||
@ -268,6 +268,7 @@ do_rr(int len, struct icmp6_router_renum *rr)
|
||||
tooshort:
|
||||
syslog(LOG_ERR, "<%s> pkt too short. left len = %d. "
|
||||
"gabage at end of pkt?", __FUNCTION__, len);
|
||||
close(s);
|
||||
return 1;
|
||||
}
|
||||
rpmlen = rpm->rpm_len << 3;
|
||||
@ -283,7 +284,7 @@ do_rr(int len, struct icmp6_router_renum *rr)
|
||||
cp += rpmlen;
|
||||
len -= rpmlen;
|
||||
}
|
||||
|
||||
close(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user