diff options
author | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-03-09 14:51:05 +0000 |
---|---|---|
committer | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-03-09 14:51:05 +0000 |
commit | 32387b216d1ce3f37b54bd8cbc91cb37fd6ad65b (patch) | |
tree | 21bd27c88ac1ea128e5a1f4b3955cdb452efb141 | |
parent | 690a43db7ea2982825c18e58c248814007d0a665 (diff) | |
download | src-32387b216d1ce3f37b54bd8cbc91cb37fd6ad65b.tar.gz src-32387b216d1ce3f37b54bd8cbc91cb37fd6ad65b.zip |
Added several socket close() which were mistakenly forgotten.
Reported by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Notes
Notes:
svn path=/head/; revision=57852
-rw-r--r-- | usr.sbin/rtadvd/config.c | 1 | ||||
-rw-r--r-- | usr.sbin/rtadvd/if.c | 1 | ||||
-rw-r--r-- | usr.sbin/rtadvd/rrenum.c | 15 |
3 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index 0e5f80d0633a..964c79c144b5 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -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; } diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index 98aefeef7581..81aa47d33761 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -170,6 +170,7 @@ if_getflags(int ifindex, int oifflags) close(s); return (oifflags & ~IFF_UP); } + close(s); return (ifr.ifr_flags); } diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c index ec69ff2a3048..f4c71f1a5cd4 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -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; } |