diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rtadvd/advcap.c | 2 | ||||
-rw-r--r-- | usr.sbin/rtadvd/config.c | 106 | ||||
-rw-r--r-- | usr.sbin/rtadvd/dump.c | 2 | ||||
-rw-r--r-- | usr.sbin/rtadvd/if.c | 20 | ||||
-rw-r--r-- | usr.sbin/rtadvd/rrenum.c | 38 | ||||
-rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 154 | ||||
-rw-r--r-- | usr.sbin/rtadvd/timer.c | 6 | ||||
-rw-r--r-- | usr.sbin/rtsold/dump.c | 2 | ||||
-rw-r--r-- | usr.sbin/rtsold/if.c | 34 | ||||
-rw-r--r-- | usr.sbin/rtsold/probe.c | 16 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsock.c | 10 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 42 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 30 |
13 files changed, 231 insertions, 231 deletions
diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c index d46cb89..856beaa 100644 --- a/usr.sbin/rtadvd/advcap.c +++ b/usr.sbin/rtadvd/advcap.c @@ -139,7 +139,7 @@ getent(bp, name, cp) } if (tf < 0) { syslog(LOG_INFO, - "<%s> open: %s", __FUNCTION__, strerror(errno)); + "<%s> open: %s", __func__, strerror(errno)); return (-2); } for (;;) { diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index 44b7693..bc56cd3 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -116,7 +116,7 @@ getconfig(intface) "<%s> %s isn't defined in the configuration file" " or the configuration file doesn't exist." " Treat it as default", - __FUNCTION__, intface); + __func__, intface); } tmp = (struct rainfo *)malloc(sizeof(*ralist)); @@ -139,7 +139,7 @@ getconfig(intface) if ((tmp->sdl = if_nametosdl(intface)) == NULL) { syslog(LOG_ERR, "<%s> can't get information of %s", - __FUNCTION__, intface); + __func__, intface); exit(1); } tmp->ifindex = tmp->sdl->sdl_index; @@ -150,7 +150,7 @@ getconfig(intface) tmp->phymtu = IPV6_MMTU; syslog(LOG_WARNING, "<%s> can't get interface mtu of %s. Treat as %d", - __FUNCTION__, intface, IPV6_MMTU); + __func__, intface, IPV6_MMTU); } /* @@ -160,7 +160,7 @@ getconfig(intface) if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) { syslog(LOG_ERR, "<%s> maxinterval must be between %e and %u", - __FUNCTION__, MIN_MAXINTERVAL, MAX_MAXINTERVAL); + __func__, MIN_MAXINTERVAL, MAX_MAXINTERVAL); exit(1); } tmp->maxinterval = (u_int)val; @@ -168,7 +168,7 @@ getconfig(intface) if (val < MIN_MININTERVAL || val > (tmp->maxinterval * 3) / 4) { syslog(LOG_ERR, "<%s> mininterval must be between %e and %d", - __FUNCTION__, + __func__, MIN_MININTERVAL, (tmp->maxinterval * 3) / 4); exit(1); @@ -192,7 +192,7 @@ getconfig(intface) tmp->rtpref = val & ND_RA_FLAG_RTPREF_MASK; if (tmp->rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid router preference on %s", - __FUNCTION__, intface); + __func__, intface); exit(1); } @@ -201,7 +201,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> router lifetime on %s must be 0 or" " between %d and %d", - __FUNCTION__, intface, + __func__, intface, tmp->maxinterval, MAXROUTERLIFETIME); exit(1); } @@ -217,7 +217,7 @@ getconfig(intface) syslog(LOG_WARNING, "<%s> non zero router lifetime is specified for %s, " "which must not be allowed for hosts.", - __FUNCTION__, intface); + __func__, intface); exit(1); } tmp->lifetime = val & 0xffff; @@ -226,7 +226,7 @@ getconfig(intface) if (val > MAXREACHABLETIME) { syslog(LOG_ERR, "<%s> reachable time must be no greater than %d", - __FUNCTION__, MAXREACHABLETIME); + __func__, MAXREACHABLETIME); exit(1); } tmp->reachabletime = (u_int32_t)val; @@ -234,7 +234,7 @@ getconfig(intface) MAYHAVE(val64, "retrans", DEF_ADVRETRANSTIMER); if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, - "<%s> retrans time out of range", __FUNCTION__); + "<%s> retrans time out of range", __func__); exit(1); } tmp->retranstimer = (u_int32_t)val64; @@ -243,7 +243,7 @@ getconfig(intface) if (agetstr("hapref", &bp) || agetstr("hatime", &bp)) { syslog(LOG_ERR, "<%s> mobile-ip6 configuration not supported", - __FUNCTION__); + __func__); exit(1); } #else @@ -252,7 +252,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> mobile-ip6 configuration without " "proper command line option", - __FUNCTION__); + __func__); exit(1); } } else { @@ -266,7 +266,7 @@ getconfig(intface) if (tmp->hatime <= 0) { syslog(LOG_ERR, "<%s> home agent lifetime must be greater than 0", - __FUNCTION__); + __func__); exit(1); } } @@ -289,7 +289,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> conflicting prefix configuration for %s: " "automatic and manual config at the same time", - __FUNCTION__, intface); + __func__, intface); exit(1); } get_prefix(tmp); @@ -305,7 +305,7 @@ getconfig(intface) if ((pfx = malloc(sizeof(struct prefix))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate enough memory", - __FUNCTION__); + __func__); exit(1); } memset(pfx, 0, sizeof(*pfx)); @@ -322,7 +322,7 @@ getconfig(intface) if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen out of range", - __FUNCTION__); + __func__); exit(1); } pfx->prefixlen = (int)val; @@ -352,7 +352,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> vltime out of range", - __FUNCTION__); + __func__); exit(1); } pfx->validlifetime = (u_int32_t)val64; @@ -371,7 +371,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> pltime out of range", - __FUNCTION__); + __func__); exit(1); } pfx->preflifetime = (u_int32_t)val64; @@ -391,35 +391,35 @@ getconfig(intface) syslog(LOG_ERR, "<%s> need %s as a prefix for " "interface %s", - __FUNCTION__, entbuf, intface); + __func__, entbuf, intface); exit(1); } if (inet_pton(AF_INET6, addr, &pfx->prefix) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed for %s", - __FUNCTION__, addr); + __func__, addr); exit(1); } if (IN6_IS_ADDR_MULTICAST(&pfx->prefix)) { syslog(LOG_ERR, "<%s> multicast prefix(%s) must " "not be advertised (IF=%s)", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } if (IN6_IS_ADDR_LINKLOCAL(&pfx->prefix)) syslog(LOG_NOTICE, "<%s> link-local prefix(%s) will be" " advertised on %s", - __FUNCTION__, addr, intface); + __func__, addr, intface); } } MAYHAVE(val, "mtu", 0); if (val < 0 || val > 0xffffffff) { syslog(LOG_ERR, - "<%s> mtu out of range", __FUNCTION__); + "<%s> mtu out of range", __func__); exit(1); } tmp->linkmtu = (u_int32_t)val; @@ -434,7 +434,7 @@ getconfig(intface) syslog(LOG_ERR, "<%s> advertised link mtu must be between" " least MTU and physical link MTU", - __FUNCTION__); + __func__); exit(1); } @@ -443,7 +443,7 @@ getconfig(intface) MAYHAVE(val, "routes", 0); if (val < 0 || val > 0xffffffff) { syslog(LOG_ERR, - "<%s> number of route information improper", __FUNCTION__); + "<%s> number of route information improper", __func__); exit(1); } tmp->routes = val; @@ -456,7 +456,7 @@ getconfig(intface) if ((rti = malloc(sizeof(struct rtinfo))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate enough memory", - __FUNCTION__); + __func__); exit(1); } memset(rti, 0, sizeof(*rti)); @@ -469,7 +469,7 @@ getconfig(intface) if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen out of range", - __FUNCTION__); + __func__); exit(1); } rti->prefixlen = (int)val; @@ -479,7 +479,7 @@ getconfig(intface) rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK; if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid route preference", - __FUNCTION__); + __func__); exit(1); } @@ -494,7 +494,7 @@ getconfig(intface) if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> rtrltime out of range", - __FUNCTION__); + __func__); exit(1); } rti->ltime = (u_int32_t)val64; @@ -505,13 +505,13 @@ getconfig(intface) syslog(LOG_ERR, "<%s> need %s as a route for " "interface %s", - __FUNCTION__, entbuf, intface); + __func__, entbuf, intface); exit(1); } if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed for %s", - __FUNCTION__, addr); + __func__, addr); exit(1); } #if 0 @@ -525,14 +525,14 @@ getconfig(intface) syslog(LOG_ERR, "<%s> multicast route (%s) must " "not be advertised (IF=%s)", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } if (IN6_IS_ADDR_LINKLOCAL(&rti->prefix)) { syslog(LOG_NOTICE, "<%s> link-local route (%s) must " "not be advertised on %s", - __FUNCTION__, addr, intface); + __func__, addr, intface); exit(1); } #endif @@ -564,7 +564,7 @@ get_prefix(struct rainfo *rai) if (getifaddrs(&ifap) < 0) { syslog(LOG_ERR, "<%s> can't get interface addresses", - __FUNCTION__); + __func__); exit(1); } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { @@ -585,7 +585,7 @@ get_prefix(struct rainfo *rai) if (plen < 0 || plen > 128) { syslog(LOG_ERR, "<%s> failed to get prefixlen " "or prefix is invalid", - __FUNCTION__); + __func__); exit(1); } if (find_prefix(rai, a, plen)) { @@ -597,7 +597,7 @@ get_prefix(struct rainfo *rai) if ((pp = malloc(sizeof(*pp))) == NULL) { syslog(LOG_ERR, "<%s> can't get allocate buffer for prefix", - __FUNCTION__); + __func__); exit(1); } memset(pp, 0, sizeof(*pp)); @@ -614,12 +614,12 @@ get_prefix(struct rainfo *rai) if (!inet_ntop(AF_INET6, &pp->prefix, ntopbuf, sizeof(ntopbuf))) { - syslog(LOG_ERR, "<%s> inet_ntop failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> inet_ntop failed", __func__); exit(1); } syslog(LOG_DEBUG, "<%s> add %s/%d to prefix list on %s", - __FUNCTION__, ntopbuf, pp->prefixlen, rai->ifname); + __func__, ntopbuf, pp->prefixlen, rai->ifname); /* set other fields with protocol defaults */ pp->validlifetime = DEF_ADVVALIDLIFETIME; @@ -673,7 +673,7 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr) if ((prefix = malloc(sizeof(*prefix))) == NULL) { syslog(LOG_ERR, "<%s> memory allocation failed", - __FUNCTION__); + __func__); return; /* XXX: error or exit? */ } memset(prefix, 0, sizeof(*prefix)); @@ -689,7 +689,7 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr) prefix->rainfo = rai; syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s", - __FUNCTION__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, + __func__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), ipr->ipr_plen, rai->ifname); @@ -722,7 +722,7 @@ delete_prefix(struct prefix *prefix) remque(prefix); syslog(LOG_DEBUG, "<%s> prefix %s/%d was deleted on %s", - __FUNCTION__, inet_ntop(AF_INET6, &prefix->prefix, + __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname); if (prefix->timer) @@ -741,12 +741,12 @@ invalidate_prefix(struct prefix *prefix) if (prefix->timer) { /* sanity check */ syslog(LOG_ERR, "<%s> assumption failure: timer already exists", - __FUNCTION__); + __func__); exit(1); } syslog(LOG_DEBUG, "<%s> prefix %s/%d was invalidated on %s, " - "will expire in %ld seconds", __FUNCTION__, + "will expire in %ld seconds", __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname, (long)prefix_timo); @@ -754,7 +754,7 @@ invalidate_prefix(struct prefix *prefix) prefix->timer = rtadvd_add_timer(prefix_timeout, NULL, prefix, NULL); if (prefix->timer == NULL) { syslog(LOG_ERR, "<%s> failed to add a timer for a prefix. " - "remove the prefix", __FUNCTION__); + "remove the prefix", __func__); delete_prefix(prefix); } timo.tv_sec = prefix_timo; @@ -781,12 +781,12 @@ update_prefix(struct prefix * prefix) if (prefix->timer == NULL) { /* sanity check */ syslog(LOG_ERR, "<%s> assumption failure: timer does not exist", - __FUNCTION__); + __func__); exit(1); } syslog(LOG_DEBUG, "<%s> prefix %s/%d was re-enabled on %s", - __FUNCTION__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, + __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname); /* stop the expiration timer */ @@ -805,13 +805,13 @@ init_prefix(struct in6_prefixreq *ipr) int s; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } if (ioctl(s, SIOCGIFPREFIX_IN6, (caddr_t)ipr) < 0) { - syslog(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX %s", __FUNCTION__, + syslog(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX %s", __func__, strerror(errno)); ipr->ipr_vltime = DEF_ADVVALIDLIFETIME; @@ -825,7 +825,7 @@ init_prefix(struct in6_prefixreq *ipr) syslog(LOG_WARNING, "<%s> Added prefix(%s)'s origin %d is" "lower than PR_ORIG_RR(router renumbering)." - "This should not happen if I am router", __FUNCTION__, + "This should not happen if I am router", __func__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf, sizeof(ntopbuf)), ipr->ipr_origin); close(s); @@ -851,7 +851,7 @@ make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen) memset(&ipr, 0, sizeof(ipr)); if (if_indextoname(ifindex, ipr.ipr_name) == NULL) { syslog(LOG_ERR, "<%s> Prefix added interface No.%d doesn't" - "exist. This should not happen! %s", __FUNCTION__, + "exist. This should not happen! %s", __func__, ifindex, strerror(errno)); exit(1); } @@ -889,7 +889,7 @@ make_packet(struct rainfo *rainfo) "<%s> link-layer address option has" " null length on %s." " Treat as not included.", - __FUNCTION__, rainfo->ifname); + __func__, rainfo->ifname); rainfo->advlinkopt = 0; } packlen += lladdroptlen; @@ -914,7 +914,7 @@ make_packet(struct rainfo *rainfo) if ((buf = malloc(packlen)) == NULL) { syslog(LOG_ERR, "<%s> can't get enough memory for an RA packet", - __FUNCTION__); + __func__); exit(1); } if (rainfo->ra_data) { @@ -1077,7 +1077,7 @@ getinet6sysctl(int code) if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s>: failed to get ip6 sysctl(%d): %s", - __FUNCTION__, code, + __func__, code, strerror(errno)); return(-1); } diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c index cb451f6..b6d2298 100644 --- a/usr.sbin/rtadvd/dump.c +++ b/usr.sbin/rtadvd/dump.c @@ -241,7 +241,7 @@ rtadvd_dump_file(dumpfile) { if ((fp = fopen(dumpfile, "w")) == NULL) { syslog(LOG_WARNING, "<%s> open a dump file(%s)", - __FUNCTION__, dumpfile); + __func__, dumpfile); return; } diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index c6aa2e6..daf06aa 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -195,7 +195,7 @@ if_getflags(int ifindex, int oifflags) int s; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); return (oifflags & ~IFF_UP); } @@ -203,7 +203,7 @@ if_getflags(int ifindex, int oifflags) if_indextoname(ifindex, ifr.ifr_name); if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { syslog(LOG_ERR, "<%s> ioctl:SIOCGIFFLAGS: failed for %s", - __FUNCTION__, ifr.ifr_name); + __func__, ifr.ifr_name); close(s); return (oifflags & ~IFF_UP); } @@ -239,7 +239,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) default: syslog(LOG_ERR, "<%s> unsupported link type(%d)", - __FUNCTION__, sdl->sdl_type); + __func__, sdl->sdl_type); exit(1); } @@ -276,7 +276,7 @@ get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter) /* just for safety */ if (!rtm->rtm_msglen) { syslog(LOG_WARNING, "<%s> rtm_msglen is 0 " - "(buf=%p lim=%p rtm=%p)", __FUNCTION__, + "(buf=%p lim=%p rtm=%p)", __func__, buf, lim, rtm); break; } @@ -495,16 +495,16 @@ get_iflist(char **buf, size_t *size) if (sysctl(mib, 6, NULL, size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s> sysctl: iflist size get failed", - __FUNCTION__); + __func__); exit(1); } if ((*buf = malloc(*size)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> malloc failed", __func__); exit(1); } if (sysctl(mib, 6, *buf, size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s> sysctl: iflist get failed", - __FUNCTION__); + __func__); exit(1); } return; @@ -530,7 +530,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) /* roughly estimate max list size of pointers to each if_msghdr */ malloc_size = (bufsize/iflentry_size) * sizeof(size_t); if ((*ifmlist_p = (struct if_msghdr **)malloc(malloc_size)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __FUNCTION__); + syslog(LOG_ERR, "<%s> malloc failed", __func__); exit(1); } @@ -538,7 +538,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) for (ifm = (struct if_msghdr *)buf; ifm < (struct if_msghdr *)lim;) { if (ifm->ifm_msglen == 0) { syslog(LOG_WARNING, "<%s> ifm_msglen is 0 " - "(buf=%p lim=%p ifm=%p)", __FUNCTION__, + "(buf=%p lim=%p ifm=%p)", __func__, buf, lim, ifm); return; } @@ -561,7 +561,7 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize) /* just for safety */ if (!ifam->ifam_msglen) { syslog(LOG_WARNING, "<%s> ifa_msglen is 0 " - "(buf=%p lim=%p ifam=%p)", __FUNCTION__, + "(buf=%p lim=%p ifam=%p)", __func__, buf, lim, ifam); return; } diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c index a5fbe20..bca75ac 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -88,7 +88,7 @@ rr_pco_check(int len, struct rr_pco_match *rpm) if ((rpm->rpm_len - 3) < 0 || /* must be at least 3 */ (rpm->rpm_len - 3) & 0x3) { /* must be multiple of 4 */ syslog(LOG_WARNING, "<%s> rpm_len %d is not 4N * 3", - __FUNCTION__, rpm->rpm_len); + __func__, rpm->rpm_len); return 1; } /* rpm->rpm_code must be valid value */ @@ -98,14 +98,14 @@ rr_pco_check(int len, struct rr_pco_match *rpm) case RPM_PCO_SETGLOBAL: break; default: - syslog(LOG_WARNING, "<%s> unknown rpm_code %d", __FUNCTION__, + syslog(LOG_WARNING, "<%s> unknown rpm_code %d", __func__, rpm->rpm_code); return 1; } /* rpm->rpm_matchlen must be 0 to 128 inclusive */ if (rpm->rpm_matchlen > 128) { syslog(LOG_WARNING, "<%s> rpm_matchlen %d is over 128", - __FUNCTION__, rpm->rpm_matchlen); + __func__, rpm->rpm_matchlen); return 1; } @@ -129,7 +129,7 @@ rr_pco_check(int len, struct rr_pco_match *rpm) if (checklen > 128) { syslog(LOG_WARNING, "<%s> sum of rpu_uselen %d and" " rpu_keeplen %d is %d(over 128)", - __FUNCTION__, rpu->rpu_uselen, + __func__, rpu->rpu_uselen, rpu->rpu_keeplen, rpu->rpu_uselen + rpu->rpu_keeplen); return 1; @@ -165,7 +165,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm, irr->irr_useprefix.sin6_addr = in6addr_any; if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 && errno != EADDRNOTAVAIL) - syslog(LOG_ERR, "<%s> ioctl: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> ioctl: %s", __func__, strerror(errno)); return; } @@ -197,7 +197,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm, if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 && errno != EADDRNOTAVAIL) - syslog(LOG_ERR, "<%s> ioctl: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> ioctl: %s", __func__, strerror(errno)); /* very adhoc: should be rewritten */ @@ -250,7 +250,7 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm) return 1; if (s == -1 && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } @@ -278,7 +278,7 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm) if (errno == ENXIO) return 0; else if (errno) { - syslog(LOG_ERR, "<%s> if_indextoname: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> if_indextoname: %s", __func__, strerror(errno)); return 1; } @@ -310,7 +310,7 @@ do_rr(int len, struct icmp6_router_renum *rr) if (len < sizeof(struct rr_pco_match)) { tooshort: syslog(LOG_ERR, "<%s> pkt too short. left len = %d. " - "gabage at end of pkt?", __FUNCTION__, len); + "gabage at end of pkt?", __func__, len); return 1; } rpmlen = rpm->rpm_len << 3; @@ -318,7 +318,7 @@ do_rr(int len, struct icmp6_router_renum *rr) goto tooshort; if (do_pco(rr, rpmlen, rpm)) { - syslog(LOG_WARNING, "<%s> invalid PCO", __FUNCTION__); + syslog(LOG_WARNING, "<%s> invalid PCO", __func__); goto next; } @@ -345,7 +345,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (len < (sizeof(struct icmp6_router_renum) + sizeof(struct rr_pco_match))) { syslog(LOG_ERR, "<%s> rr_command len %d is too short", - __FUNCTION__, len); + __func__, len); return 1; } @@ -353,7 +353,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (IN6_IS_ADDR_MULTICAST(dst) && !IN6_IS_ADDR_MC_LINKLOCAL(dst) && !IN6_IS_ADDR_MC_SITELOCAL(dst)) { syslog(LOG_ERR, "<%s> dst mcast addr %s is illegal", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, dst, ntopbuf, INET6_ADDRSTRLEN)); return 1; } @@ -362,7 +362,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if (rro.rro_seqnum > rr->rr_seqnum) { syslog(LOG_WARNING, "<%s> rcvd old seqnum %d from %s", - __FUNCTION__, (u_int32_t)ntohl(rr->rr_seqnum), + __func__, (u_int32_t)ntohl(rr->rr_seqnum), inet_ntop(AF_INET6, from, ntopbuf, INET6_ADDRSTRLEN)); return 1; } @@ -372,7 +372,7 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from, if ((rr->rr_flags & ICMP6_RR_FLAGS_REQRESULT) != 0) syslog(LOG_WARNING, "<%s> rcvd duped segnum %d from %s", - __FUNCTION__, rr->rr_segnum, + __func__, rr->rr_segnum, inet_ntop(AF_INET6, from, ntopbuf, INET6_ADDRSTRLEN)); return 0; @@ -413,7 +413,7 @@ rr_command_input(int len, struct icmp6_router_renum *rr, return; failed: - syslog(LOG_ERR, "<%s> received RR was invalid", __FUNCTION__); + syslog(LOG_ERR, "<%s> received RR was invalid", __func__); return; } @@ -425,7 +425,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, syslog(LOG_DEBUG, "<%s> RR received from %s to %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN), @@ -435,7 +435,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, if (len < sizeof(struct icmp6_router_renum)) { syslog(LOG_NOTICE, "<%s>: RR short message (size %d) from %s to %s on %s", - __FUNCTION__, len, + __func__, len, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN), @@ -456,7 +456,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, syslog(LOG_NOTICE, "<%s>: RR message with invalid destination (%s) " "from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &dst, ntopbuf[0], INET6_ADDRSTRLEN), inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[1], INET6_ADDRSTRLEN), @@ -479,7 +479,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi, break; default: syslog(LOG_ERR, "<%s> received unknown code %d", - __FUNCTION__, rr->rr_code); + __func__, rr->rr_code); break; } diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 2e392e4..dffcab6 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -247,7 +247,7 @@ main(argc, argv) if ((pidfp = fopen(pidfilename, "w")) == NULL) { syslog(LOG_ERR, "<%s> failed to open a log file(%s), run anyway.", - __FUNCTION__, pidfilename); + __func__, pidfilename); } else { fprintf(pidfp, "%d\n", pid); fclose(pidfp); @@ -286,13 +286,13 @@ main(argc, argv) if (timeout != NULL) { syslog(LOG_DEBUG, "<%s> set timer to %ld:%ld. waiting for " - "inputs or timeout", __FUNCTION__, + "inputs or timeout", __func__, (long int)timeout->tv_sec, (long int)timeout->tv_usec); } else { syslog(LOG_DEBUG, "<%s> there's no timer. waiting for inputs", - __FUNCTION__); + __func__); } if ((i = select(maxfd + 1, &select_fd, @@ -300,7 +300,7 @@ main(argc, argv) /* EINTR would occur upon SIGUSR1 for status dump */ if (errno != EINTR) syslog(LOG_ERR, "<%s> select: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); continue; } if (i == 0) /* timeout */ @@ -335,7 +335,7 @@ die() if (dflag > 1) { syslog(LOG_DEBUG, "<%s> cease to be an advertising router\n", - __FUNCTION__); + __func__); } for (ra = ralist; ra; ra = ra->next) { @@ -366,7 +366,7 @@ rtmsg_input() n = read(rtsock, msg, sizeof(msg)); if (dflag > 1) { syslog(LOG_DEBUG, "<%s> received a routing message " - "(type = %d, len = %d)", __FUNCTION__, rtmsg_type(msg), n); + "(type = %d, len = %d)", __func__, rtmsg_type(msg), n); } if (n > rtmsg_len(msg)) { /* @@ -378,7 +378,7 @@ rtmsg_input() "<%s> received data length is larger than " "1st routing message len. multiple messages? " "read %d bytes, but 1st msg len = %d", - __FUNCTION__, n, rtmsg_len(msg)); + __func__, n, rtmsg_len(msg)); #if 0 /* adjust length */ n = rtmsg_len(msg); @@ -415,7 +415,7 @@ rtmsg_input() if (dflag > 1) { syslog(LOG_DEBUG, "<%s:%d> unknown rtmsg %d on %s", - __FUNCTION__, __LINE__, type, + __func__, __LINE__, type, if_indextoname(ifindex, ifname)); } continue; @@ -426,7 +426,7 @@ rtmsg_input() syslog(LOG_DEBUG, "<%s> route changed on " "non advertising interface(%s)", - __FUNCTION__, + __func__, if_indextoname(ifindex, ifname)); } continue; @@ -449,7 +449,7 @@ rtmsg_input() if (plen < 4 || plen > 127) { syslog(LOG_INFO, "<%s> new interface route's" "plen %d is invalid for a prefix", - __FUNCTION__, plen); + __func__, plen); break; } prefix = find_prefix(rai, addr, plen); @@ -465,7 +465,7 @@ rtmsg_input() "<%s> new prefix(%s/%d) " "added on %s, " "but it was already in list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, addr, (char *)addrbuf, INET6_ADDRSTRLEN), plen, rai->ifname); @@ -490,7 +490,7 @@ rtmsg_input() syslog(LOG_INFO, "<%s> deleted interface route's " "plen %d is invalid for a prefix", - __FUNCTION__, plen); + __func__, plen); break; } prefix = find_prefix(rai, addr, plen); @@ -500,7 +500,7 @@ rtmsg_input() "<%s> prefix(%s/%d) was " "deleted on %s, " "but it was not in list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, addr, (char *)addrbuf, INET6_ADDRSTRLEN), plen, rai->ifname); @@ -523,7 +523,7 @@ rtmsg_input() if (dflag > 1) { syslog(LOG_DEBUG, "<%s:%d> unknown rtmsg %d on %s", - __FUNCTION__, __LINE__, type, + __func__, __LINE__, type, if_indextoname(ifindex, ifname)); } return; @@ -534,13 +534,13 @@ rtmsg_input() (iflist[ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_INFO, "<%s> interface %s becomes down. stop timer.", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); rtadvd_remove_timer(&rai->timer); } else if ((oldifflags & IFF_UP) == 0 && /* DOWN to UP */ (iflist[ifindex]->ifm_flags & IFF_UP) != 0) { syslog(LOG_INFO, "<%s> interface %s becomes up. restart timer.", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); rai->initcounter = 0; /* reset the counter */ rai->waiting = 0; /* XXX */ @@ -597,13 +597,13 @@ rtadvd_input() if (ifindex == 0) { syslog(LOG_ERR, "<%s> failed to get receiving interface", - __FUNCTION__); + __func__); return; } if (hlimp == NULL) { syslog(LOG_ERR, "<%s> failed to get receiving hop limit", - __FUNCTION__); + __func__); return; } @@ -614,7 +614,7 @@ rtadvd_input() if ((iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_INFO, "<%s> received data on a disabled interface (%s)", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -623,7 +623,7 @@ rtadvd_input() if (i < sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) { syslog(LOG_ERR, "<%s> packet size(%d) is too short", - __FUNCTION__, i); + __func__, i); return; } @@ -633,7 +633,7 @@ rtadvd_input() if (i < sizeof(struct icmp6_hdr)) { syslog(LOG_ERR, "<%s> packet size(%d) is too short", - __FUNCTION__, i); + __func__, i); return; } @@ -651,7 +651,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS with invalid hop limit(%d) " "received from %s on %s", - __FUNCTION__, *hlimp, + __func__, *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -661,7 +661,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS with invalid ICMP6 code(%d) " "received from %s on %s", - __FUNCTION__, icp->icmp6_code, + __func__, icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -671,7 +671,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RS from %s on %s does not have enough " "length (len = %d)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf), i); @@ -688,7 +688,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA with invalid hop limit(%d) " "received from %s on %s", - __FUNCTION__, *hlimp, + __func__, *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -698,7 +698,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA with invalid ICMP6 code(%d) " "received from %s on %s", - __FUNCTION__, icp->icmp6_code, + __func__, icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -708,7 +708,7 @@ rtadvd_input() syslog(LOG_NOTICE, "<%s> RA from %s on %s does not have enough " "length (len = %d)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf), i); @@ -720,7 +720,7 @@ rtadvd_input() if (accept_rr == 0) { syslog(LOG_ERR, "<%s> received a router renumbering " "message, but not allowed to be accepted", - __FUNCTION__); + __func__); break; } rr_input(i, (struct icmp6_router_renum *)icp, pi, &from, @@ -734,7 +734,7 @@ rtadvd_input() * before setting ICMP6 type filter(see sock_open()). */ syslog(LOG_ERR, "<%s> invalid icmp type(%d)", - __FUNCTION__, icp->icmp6_type); + __func__, icp->icmp6_type); return; } @@ -751,7 +751,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_DEBUG, "<%s> RS received from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -763,7 +763,7 @@ rs_input(int len, struct nd_router_solicit *rs, &ndopts, NDOPT_FLAG_SRCLINKADDR)) { syslog(LOG_DEBUG, "<%s> ND option check failed for an RS from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -780,7 +780,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_ERR, "<%s> RS from unspecified src on %s has a link-layer" " address option", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); goto done; } @@ -794,7 +794,7 @@ rs_input(int len, struct nd_router_solicit *rs, if (ra == NULL) { syslog(LOG_INFO, "<%s> RS received on non advertising interface(%s)", - __FUNCTION__, + __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf)); goto done; } @@ -844,7 +844,7 @@ rs_input(int len, struct nd_router_solicit *rs, syslog(LOG_DEBUG, "<%s> random delay is larger than " "the rest of normal timer", - __FUNCTION__); + __func__); interval = *rest; } @@ -885,7 +885,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_DEBUG, "<%s> RA received from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -898,7 +898,7 @@ ra_input(int len, struct nd_router_advert *ra, NDOPT_FLAG_PREFIXINFO | NDOPT_FLAG_MTU)) { syslog(LOG_ERR, "<%s> ND option check failed for an RA from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -912,7 +912,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> received RA from %s on non-advertising" " interface(%s)", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); @@ -926,7 +926,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> CurHopLimit inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, ra->nd_ra_curhoplimit, inet_ntop(AF_INET6, &from->sin6_addr, @@ -940,7 +940,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> M flag inconsistent on %s:" " %s from %s, %s from us", - __FUNCTION__, + __func__, rai->ifname, on_off[!rai->managedflg], inet_ntop(AF_INET6, &from->sin6_addr, @@ -954,7 +954,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> O flag inconsistent on %s:" " %s from %s, %s from us", - __FUNCTION__, + __func__, rai->ifname, on_off[!rai->otherflg], inet_ntop(AF_INET6, &from->sin6_addr, @@ -969,7 +969,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> ReachableTime inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, reachabletime, inet_ntop(AF_INET6, &from->sin6_addr, @@ -984,7 +984,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> RetranceTimer inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, retranstimer, inet_ntop(AF_INET6, &from->sin6_addr, @@ -999,7 +999,7 @@ ra_input(int len, struct nd_router_advert *ra, syslog(LOG_INFO, "<%s> MTU option value inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, rai->ifname, mtu, inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -1054,7 +1054,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, syslog(LOG_INFO, "<%s> link-local prefix %s/%d is advertised " "from %s on %s", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1067,7 +1067,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, pinfo->nd_opt_pi_prefix_len)) == NULL) { syslog(LOG_INFO, "<%s> prefix %s/%d from %s on %s is not in our list", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1095,7 +1095,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> prefeerred lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" " %d from %s, %ld from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1110,7 +1110,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> prefeerred lifetime for %s/%d" " inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1131,7 +1131,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> valid lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" " %d from %s, %ld from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1146,7 +1146,7 @@ prefix_check(struct nd_opt_prefix_info *pinfo, "<%s> valid lifetime for %s/%d" " inconsistent on %s:" " %d from %s, %d from us", - __FUNCTION__, + __func__, inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf, INET6_ADDRSTRLEN), pinfo->nd_opt_pi_prefix_len, @@ -1209,7 +1209,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, for (; limit > 0; limit -= optlen) { if (limit < sizeof(struct nd_opt_hdr)) { - syslog(LOG_INFO, "<%s> short option header", __FUNCTION__); + syslog(LOG_INFO, "<%s> short option header", __func__); goto bad; } @@ -1217,26 +1217,26 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (hdr->nd_opt_len == 0) { syslog(LOG_INFO, "<%s> bad ND option length(0) (type = %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); goto bad; } optlen = hdr->nd_opt_len << 3; if (optlen > limit) { - syslog(LOG_INFO, "<%s> short option", __FUNCTION__); + syslog(LOG_INFO, "<%s> short option", __func__); goto bad; } if (hdr->nd_opt_type > ND_OPT_MTU) { syslog(LOG_INFO, "<%s> unknown ND option(type %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); continue; } if ((ndopt_flags[hdr->nd_opt_type] & optflags) == 0) { syslog(LOG_INFO, "<%s> unexpected ND option(type %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); continue; } @@ -1249,7 +1249,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, ((hdr->nd_opt_type == ND_OPT_PREFIX_INFORMATION && optlen != sizeof(struct nd_opt_prefix_info)))) { syslog(LOG_INFO, "<%s> invalid option length", - __FUNCTION__); + __func__); continue; } @@ -1262,7 +1262,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (ndopts->nd_opt_array[hdr->nd_opt_type]) { syslog(LOG_INFO, "<%s> duplicated ND option (type = %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); } ndopts->nd_opt_array[hdr->nd_opt_type] = hdr; break; @@ -1277,7 +1277,7 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, } if ((pfxlist = malloc(sizeof(*pfxlist))) == NULL) { syslog(LOG_ERR, "<%s> can't allocate memory", - __FUNCTION__); + __func__); goto bad; } pfxlist->next = ndopts->nd_opts_list; @@ -1325,7 +1325,7 @@ sock_open() CMSG_SPACE(sizeof(int)); rcvcmsgbuf = (u_char *)malloc(rcvcmsgbuflen); if (rcvcmsgbuf == NULL) { - syslog(LOG_ERR, "<%s> not enough core", __FUNCTION__); + syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); } @@ -1333,12 +1333,12 @@ sock_open() CMSG_SPACE(sizeof(int)); sndcmsgbuf = (u_char *)malloc(sndcmsgbuflen); if (sndcmsgbuf == NULL) { - syslog(LOG_ERR, "<%s> not enough core", __FUNCTION__); + syslog(LOG_ERR, "<%s> not enough core", __func__); exit(1); } if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - syslog(LOG_ERR, "<%s> socket: %s", __FUNCTION__, + syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno)); exit(1); } @@ -1349,14 +1349,14 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_RECVPKTINFO: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_PKTINFO: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #endif @@ -1367,14 +1367,14 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_RECVHOPLIMIT: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(sock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on)) < 0) { syslog(LOG_ERR, "<%s> IPV6_HOPLIMIT: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } #endif @@ -1387,7 +1387,7 @@ sock_open() if (setsockopt(sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, sizeof(filt)) < 0) { syslog(LOG_ERR, "<%s> IICMP6_FILTER: %s", - __FUNCTION__, strerror(errno)); + __func__, strerror(errno)); exit(1); } @@ -1398,7 +1398,7 @@ sock_open() &mreq.ipv6mr_multiaddr.s6_addr) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } while (ra) { @@ -1406,7 +1406,7 @@ sock_open() if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP(link) on %s: %s", - __FUNCTION__, ra->ifname, strerror(errno)); + __func__, ra->ifname, strerror(errno)); exit(1); } ra = ra->next; @@ -1420,7 +1420,7 @@ sock_open() if (inet_pton(AF_INET6, ALLROUTERS_SITE, &in6a_site_allrouters) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } mreq.ipv6mr_multiaddr = in6a_site_allrouters; @@ -1429,7 +1429,7 @@ sock_open() == 0) { syslog(LOG_ERR, "<%s> invalid interface: %s", - __FUNCTION__, mcastif); + __func__, mcastif); exit(1); } } else @@ -1438,7 +1438,7 @@ sock_open() &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP(site) on %s: %s", - __FUNCTION__, + __func__, mcastif ? mcastif : ralist->ifname, strerror(errno)); exit(1); @@ -1471,7 +1471,7 @@ rtsock_open() { if ((rtsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) { syslog(LOG_ERR, - "<%s> socket: %s", __FUNCTION__, strerror(errno)); + "<%s> socket: %s", __func__, strerror(errno)); exit(1); } } @@ -1500,7 +1500,7 @@ struct rainfo *rainfo; if ((iflist[rainfo->ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_DEBUG, "<%s> %s is not up, skip sending RA", - __FUNCTION__, rainfo->ifname); + __func__, rainfo->ifname); return; } @@ -1532,14 +1532,14 @@ struct rainfo *rainfo; syslog(LOG_DEBUG, "<%s> send RA on %s, # of waitings = %d", - __FUNCTION__, rainfo->ifname, rainfo->waiting); + __func__, rainfo->ifname, rainfo->waiting); i = sendmsg(sock, &sndmhdr, 0); if (i < 0 || i != rainfo->ra_datalen) { if (i < 0) { syslog(LOG_ERR, "<%s> sendmsg on %s: %s", - __FUNCTION__, rainfo->ifname, + __func__, rainfo->ifname, strerror(errno)); } } @@ -1559,7 +1559,7 @@ struct rainfo *rainfo; if (i < 0) { syslog(LOG_ERR, "<%s> unicast sendmsg on %s: %s", - __FUNCTION__, rainfo->ifname, + __func__, rainfo->ifname, strerror(errno)); } } @@ -1594,7 +1594,7 @@ ra_timeout(void *data) syslog(LOG_DEBUG, "<%s> RA timer on %s is expired", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); ra_output(rai); @@ -1633,7 +1633,7 @@ ra_timer_update(void *data, struct timeval *tm) syslog(LOG_DEBUG, "<%s> RA timer on %s is set to %ld:%ld", - __FUNCTION__, rai->ifname, + __func__, rai->ifname, (long int)tm->tv_sec, (long int)tm->tv_usec); return; diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index 646b5ee..73b7fe1 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -67,7 +67,7 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout) __P((void *)), if ((newtimer = malloc(sizeof(*newtimer))) == NULL) { syslog(LOG_ERR, - "<%s> can't allocate memory", __FUNCTION__); + "<%s> can't allocate memory", __func__); exit(1); } @@ -75,7 +75,7 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout) __P((void *)), if (timeout == NULL) { syslog(LOG_ERR, - "<%s> timeout function unspecfied", __FUNCTION__); + "<%s> timeout function unspecfied", __func__); exit(1); } newtimer->expire = timeout; @@ -168,7 +168,7 @@ rtadvd_timer_rest(struct rtadvd_timer *timer) if (TIMEVAL_LEQ(timer->tm, now)) { syslog(LOG_DEBUG, "<%s> a timer must be expired, but not yet", - __FUNCTION__); + __func__); returnval.tv_sec = returnval.tv_usec = 0; } else diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c index 0f75971..7915d92 100644 --- a/usr.sbin/rtsold/dump.c +++ b/usr.sbin/rtsold/dump.c @@ -100,7 +100,7 @@ rtsold_dump_file(dumpfile) char *dumpfile; { if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __FUNCTION__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", dumpfile, strerror(errno)); return; } diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c index 4566b73..27690ca 100644 --- a/usr.sbin/rtsold/if.c +++ b/usr.sbin/rtsold/if.c @@ -101,40 +101,40 @@ interface_up(char *name) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { - warnmsg(LOG_WARNING, __FUNCTION__, "ioctl(SIOCGIFFLAGS): %s", + warnmsg(LOG_WARNING, __func__, "ioctl(SIOCGIFFLAGS): %s", strerror(errno)); return(-1); } if (!(ifr.ifr_flags & IFF_UP)) { ifr.ifr_flags |= IFF_UP; if (ioctl(ifsock, SIOCSIFFLAGS, (caddr_t)&ifr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCSIFFLAGS): %s", strerror(errno)); } return(-1); } - warnmsg(LOG_DEBUG, __FUNCTION__, "checking if %s is ready...", name); + warnmsg(LOG_DEBUG, __func__, "checking if %s is ready...", name); llflag = get_llflag(name); if (llflag < 0) { - warnmsg(LOG_WARNING, __FUNCTION__, + warnmsg(LOG_WARNING, __func__, "get_llflag() failed, anyway I'll try"); return 0; } if (!(llflag & IN6_IFF_NOTREADY)) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "%s is ready", name); return(0); } else { if (llflag & IN6_IFF_TENTATIVE) { - warnmsg(LOG_DEBUG, __FUNCTION__, "%s is tentative", + warnmsg(LOG_DEBUG, __func__, "%s is tentative", name); return IFS_TENTATIVE; } if (llflag & IN6_IFF_DUPLICATED) - warnmsg(LOG_DEBUG, __FUNCTION__, "%s is duplicated", + warnmsg(LOG_DEBUG, __func__, "%s is duplicated", name); return -1; } @@ -151,7 +151,7 @@ interface_status(struct ifinfo *ifinfo) memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGIFFLAGS) on %s: %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s", ifname, strerror(errno)); return(-1); } @@ -171,7 +171,7 @@ interface_status(struct ifinfo *ifinfo) if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "ioctl(SIOCGIFMEDIA) on %s: %s", ifname, strerror(errno)); return(-1); @@ -244,7 +244,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) memcpy(addr, LLADDR(sdl), ETHER_ADDR_LEN); break; default: - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "unsupported link type(%d)", sdl->sdl_type); exit(1); } @@ -333,12 +333,12 @@ get_llflag(const char *name) int s; if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket(SOCK_DGRAM): %s", + warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", strerror(errno)); exit(1); } if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __FUNCTION__, "etifaddrs: %s", + warnmsg(LOG_ERR, __func__, "etifaddrs: %s", strerror(errno)); exit(1); } @@ -357,7 +357,7 @@ get_llflag(const char *name) strcpy(ifr6.ifr_name, name); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); exit(1); } @@ -382,12 +382,12 @@ get_llflag(const char *name) maxif = if_maxindex() + 1; iflist = (struct ifreq *)malloc(maxif * BUFSIZ); /* XXX */ if (iflist == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "not enough core"); + warnmsg(LOG_ERR, __func__, "not enough core"); exit(1); } if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket(SOCK_DGRAM): %s", + warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", strerror(errno)); exit(1); } @@ -395,7 +395,7 @@ get_llflag(const char *name) ifconf.ifc_req = iflist; ifconf.ifc_len = maxif * BUFSIZ; /* XXX */ if (ioctl(s, SIOCGIFCONF, &ifconf) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGIFCONF): %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFCONF): %s", strerror(errno)); exit(1); } @@ -419,7 +419,7 @@ get_llflag(const char *name) strcpy(ifr6.ifr_name, name); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); exit(1); } diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c index 34bb66e..c7b07e2 100644 --- a/usr.sbin/rtsold/probe.c +++ b/usr.sbin/rtsold/probe.c @@ -73,18 +73,18 @@ probe_init() if (sndcmsgbuf == NULL && (sndcmsgbuf = (u_char *)malloc(scmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "malloc failed"); + warnmsg(LOG_ERR, __func__, "malloc failed"); return(-1); } if ((probesock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return(-1); } /* make the socket send-only */ if (shutdown(probesock, 0)) { - warnmsg(LOG_ERR, __FUNCTION__, "shutdown: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "shutdown: %s", strerror(errno)); return(-1); } @@ -109,13 +109,13 @@ defrouter_probe(int ifindex) u_char ntopbuf[INET6_ADDRSTRLEN]; if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return; } bzero(&dr, sizeof(dr)); strcpy(dr.ifname, "lo0"); /* dummy interface */ if (ioctl(s, SIOCGDRLST_IN6, (caddr_t)&dr) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "ioctl(SIOCGDRLST_IN6): %s", + warnmsg(LOG_ERR, __func__, "ioctl(SIOCGDRLST_IN6): %s", strerror(errno)); goto closeandend; } @@ -124,7 +124,7 @@ defrouter_probe(int ifindex) if (ifindex && dr.defrouter[i].if_index == ifindex) { /* sanity check */ if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "default router list contains a " "non-linklocal address(%s)", inet_ntop(AF_INET6, @@ -179,12 +179,12 @@ sendprobe(struct in6_addr *addr, int ifindex) memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); } - warnmsg(LOG_DEBUG, __FUNCTION__, "probe a router %s on %s", + warnmsg(LOG_DEBUG, __func__, "probe a router %s on %s", inet_ntop(AF_INET6, addr, ntopbuf, INET6_ADDRSTRLEN), if_indextoname(ifindex, ifnamebuf)); if (sendmsg(probesock, &sndmhdr, 0)) - warnmsg(LOG_ERR, __FUNCTION__, "sendmsg on %s: %s", + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", if_indextoname(ifindex, ifnamebuf), strerror(errno)); return; diff --git a/usr.sbin/rtsold/rtsock.c b/usr.sbin/rtsold/rtsock.c index f1c4be8..429b78b 100644 --- a/usr.sbin/rtsold/rtsock.c +++ b/usr.sbin/rtsold/rtsock.c @@ -112,7 +112,7 @@ rtsock_input(s) break; if (dflag > 1) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "rtmsg type %d, len=%lu", rtm->rtm_type, (u_long)len); } @@ -121,7 +121,7 @@ rtsock_input(s) if (rtm->rtm_type != rtsock_dispatch[idx].type) continue; if (rtm->rtm_msglen < rtsock_dispatch[idx].minlen) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "rtmsg type %d too short!", rtm->rtm_type); continue; } @@ -156,16 +156,16 @@ rtsock_input_ifannounce(s, rtm, lim) * we may be able to do a name-based interface match, * and call ifreconfig() to enable the interface again. */ - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "interface %s inserted", ifan->ifan_name); break; case IFAN_DEPARTURE: - warnmsg(LOG_WARNING, __FUNCTION__, + warnmsg(LOG_WARNING, __func__, "interface %s removed", ifan->ifan_name); ifinfo = find_ifinfo(ifan->ifan_index); if (ifinfo) { if (dflag > 1) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "bring interface %s to DOWN state", ifan->ifan_name); } diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 5086ea9..0543bca 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -82,12 +82,12 @@ sockopen() sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)); if (rcvcmsgbuf == NULL && (rcvcmsgbuf = malloc(rcvcmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "malloc for receive msghdr failed"); return(-1); } if (sndcmsgbuf == NULL && (sndcmsgbuf = malloc(sndcmsglen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "malloc for send msghdr failed"); return(-1); } @@ -96,13 +96,13 @@ sockopen() sin6_allrouters.sin6_len = sizeof(sin6_allrouters); if (inet_pton(AF_INET6, ALLROUTER, &sin6_allrouters.sin6_addr.s6_addr) != 1) { - warnmsg(LOG_ERR, __FUNCTION__, "inet_pton failed for %s", + warnmsg(LOG_ERR, __func__, "inet_pton failed for %s", ALLROUTER); return(-1); } if ((rssock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "socket: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return(-1); } @@ -111,14 +111,14 @@ sockopen() #ifdef IPV6_RECVPKTINFO if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVPKTINFO: %s", + warnmsg(LOG_ERR, __func__, "IPV6_RECVPKTINFO: %s", strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_PKTINFO: %s", + warnmsg(LOG_ERR, __func__, "IPV6_PKTINFO: %s", strerror(errno)); exit(1); } @@ -129,14 +129,14 @@ sockopen() #ifdef IPV6_RECVHOPLIMIT if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVHOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "IPV6_RECVHOPLIMIT: %s", strerror(errno)); exit(1); } #else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "IPV6_HOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "IPV6_HOPLIMIT: %s", strerror(errno)); exit(1); } @@ -147,7 +147,7 @@ sockopen() ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filt); if (setsockopt(rssock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, sizeof(filt)) == -1) { - warnmsg(LOG_ERR, __FUNCTION__, "setsockopt(ICMP6_FILTER): %s", + warnmsg(LOG_ERR, __func__, "setsockopt(ICMP6_FILTER): %s", strerror(errno)); return(-1); } @@ -204,7 +204,7 @@ sendpacket(struct ifinfo *ifinfo) } warnmsg(LOG_DEBUG, - __FUNCTION__, "send RS on %s, whose state is %d", + __func__, "send RS on %s, whose state is %d", ifinfo->ifname, ifinfo->state); i = sendmsg(rssock, &sndmhdr, 0); @@ -215,7 +215,7 @@ sendpacket(struct ifinfo *ifinfo) * network cards on a mobile node. We ignore it. */ if (errno != ENETDOWN || dflag > 0) - warnmsg(LOG_ERR, __FUNCTION__, "sendmsg on %s: %s", + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", ifinfo->ifname, strerror(errno)); } @@ -237,7 +237,7 @@ rtsol_input(int s) /* get message */ if ((i = recvmsg(s, &rcvmhdr, 0)) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "recvmsg: %s", strerror(errno)); + warnmsg(LOG_ERR, __func__, "recvmsg: %s", strerror(errno)); return; } @@ -259,25 +259,25 @@ rtsol_input(int s) if (ifindex == 0) { warnmsg(LOG_ERR, - __FUNCTION__, "failed to get receiving interface"); + __func__, "failed to get receiving interface"); return; } if (hlimp == NULL) { warnmsg(LOG_ERR, - __FUNCTION__, "failed to get receiving hop limit"); + __func__, "failed to get receiving hop limit"); return; } if (i < sizeof(struct nd_router_advert)) { warnmsg(LOG_ERR, - __FUNCTION__, "packet size(%d) is too short", i); + __func__, "packet size(%d) is too short", i); return; } icp = (struct icmp6_hdr *)rcvmhdr.msg_iov[0].iov_base; if (icp->icmp6_type != ND_ROUTER_ADVERT) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "invalid icmp type(%d) from %s on %s", icp->icmp6_type, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -286,7 +286,7 @@ rtsol_input(int s) } if (icp->icmp6_code != 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "invalid icmp code(%d) from %s on %s", icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -295,7 +295,7 @@ rtsol_input(int s) } if (*hlimp != 255) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "invalid RA with hop limit(%d) from %s on %s", *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, @@ -305,7 +305,7 @@ rtsol_input(int s) } if (pi && !IN6_IS_ADDR_LINKLOCAL(&from.sin6_addr)) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "invalid RA with non link-local source from %s on %s", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -316,7 +316,7 @@ rtsol_input(int s) /* xxx: more validation? */ if ((ifi = find_ifinfo(pi->ipi6_ifindex)) == NULL) { - warnmsg(LOG_NOTICE, __FUNCTION__, + warnmsg(LOG_NOTICE, __func__, "received RA from %s on an unexpeced IF(%s)", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), @@ -324,7 +324,7 @@ rtsol_input(int s) return; } - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "received RA from %s on %s, state is %d", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 82a7560..e3b9a61 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -259,7 +259,7 @@ main(argc, argv) FILE *fp; if ((fp = fopen(pidfilename, "w")) == NULL) - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to open a log file(%s): %s", pidfilename, strerror(errno)); else { @@ -300,7 +300,7 @@ main(argc, argv) e = select(maxfd + 1, &select_fd, NULL, NULL, timeout); if (e < 1) { if (e < 0 && errno != EINTR) { - warnmsg(LOG_ERR, __FUNCTION__, "select: %s", + warnmsg(LOG_ERR, __func__, "select: %s", strerror(errno)); } continue; @@ -325,19 +325,19 @@ ifconfig(char *ifname) int flags; if ((sdl = if_nametosdl(ifname)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to get link layer information for %s", ifname); return(-1); } if (find_ifinfo(sdl->sdl_index)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "interface %s was already configured", ifname); free(sdl); return(-1); } if ((ifinfo = malloc(sizeof(*ifinfo))) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, "memory allocation failed"); + warnmsg(LOG_ERR, __func__, "memory allocation failed"); free(sdl); return(-1); } @@ -435,7 +435,7 @@ make_packet(struct ifinfo *ifinfo) size_t packlen = sizeof(struct nd_router_solicit), lladdroptlen = 0; if ((lladdroptlen = lladdropt_length(ifinfo->sdl)) == 0) { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "link-layer address option has null length" " on %s. Treat as not included.", ifinfo->ifname); } @@ -444,7 +444,7 @@ make_packet(struct ifinfo *ifinfo) /* allocate buffer */ if ((buf = malloc(packlen)) == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "memory allocation failed for %s", ifinfo->ifname); return(-1); } @@ -480,7 +480,7 @@ rtsol_check_timer() for (ifinfo = iflist; ifinfo; ifinfo = ifinfo->next) { if (TIMEVAL_LEQ(ifinfo->expire, now)) { if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "timer expiration on %s, " "state = %d", ifinfo->ifname, ifinfo->state); @@ -506,7 +506,7 @@ rtsol_check_timer() interface_status(ifinfo); if (oldstatus != ifinfo->active) { - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "%s status is changed" " from %d to %d", ifinfo->ifname, @@ -536,7 +536,7 @@ rtsol_check_timer() if (ifinfo->probes < MAX_RTR_SOLICITATIONS) sendpacket(ifinfo); else { - warnmsg(LOG_INFO, __FUNCTION__, + warnmsg(LOG_INFO, __func__, "No answer " "after sending %d RSs", ifinfo->probes); @@ -553,7 +553,7 @@ rtsol_check_timer() } if (TIMEVAL_EQ(rtsol_timer, tm_max)) { - warnmsg(LOG_DEBUG, __FUNCTION__, "there is no timer"); + warnmsg(LOG_DEBUG, __func__, "there is no timer"); return(NULL); } else if (TIMEVAL_LT(rtsol_timer, now)) @@ -563,7 +563,7 @@ rtsol_check_timer() TIMEVAL_SUB(&rtsol_timer, &now, &returnval); if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, "New timer is %ld:%08ld", + warnmsg(LOG_DEBUG, __func__, "New timer is %ld:%08ld", (long)returnval.tv_sec, (long)returnval.tv_usec); return(&returnval); @@ -621,7 +621,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) } break; default: - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "illegal interface state(%d) on %s", ifinfo->state, ifinfo->ifname); return; @@ -630,7 +630,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) /* reset the timer */ if (TIMEVAL_EQ(ifinfo->timer, tm_max)) { ifinfo->expire = tm_max; - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "stop timer for %s", ifinfo->ifname); } else { @@ -638,7 +638,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) TIMEVAL_ADD(&now, &ifinfo->timer, &ifinfo->expire); if (dflag > 1) - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "set timer for %s to %d:%d", ifinfo->ifname, (int)ifinfo->timer.tv_sec, (int)ifinfo->timer.tv_usec); |