summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-08-08 16:38:23 +0000
committerume <ume@FreeBSD.org>2003-08-08 16:38:23 +0000
commit52b4a696e076a7e2fb7dd05bd2f6feec997189cd (patch)
tree7be70b3ddc544d1f57f42ae1973bd9dbb08e2484 /usr.sbin/rtadvd
parent0586a616afbf29cdfe5a32513eeed50868ca9926 (diff)
downloadFreeBSD-src-52b4a696e076a7e2fb7dd05bd2f6feec997189cd.zip
FreeBSD-src-52b4a696e076a7e2fb7dd05bd2f6feec997189cd.tar.gz
__FUNCTION__ --> __func__
Obtained from: KAME MFC after: 1 week
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r--usr.sbin/rtadvd/advcap.c2
-rw-r--r--usr.sbin/rtadvd/config.c106
-rw-r--r--usr.sbin/rtadvd/dump.c2
-rw-r--r--usr.sbin/rtadvd/if.c20
-rw-r--r--usr.sbin/rtadvd/rrenum.c38
-rw-r--r--usr.sbin/rtadvd/rtadvd.c154
-rw-r--r--usr.sbin/rtadvd/timer.c6
7 files changed, 164 insertions, 164 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
OpenPOWER on IntegriCloud