summaryrefslogtreecommitdiff
path: root/usr.sbin/rtadvd/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rtadvd/config.c')
-rw-r--r--usr.sbin/rtadvd/config.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index b487bfe0e6a..95573b37862 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.17 2002/06/09 02:15:54 deraadt Exp $ */
+/* $OpenBSD: config.c,v 1.18 2002/06/10 19:57:35 espie Exp $ */
/* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */
/*
@@ -105,7 +105,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));
@@ -127,7 +127,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;
@@ -138,7 +138,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);
}
/*
@@ -148,7 +148,7 @@ getconfig(intface)
if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) {
syslog(LOG_ERR,
"<%s> maxinterval (%ld) on %s is invalid "
- "(must be between %e and %u)", __FUNCTION__, val,
+ "(must be between %e and %u)", __func__, val,
intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL);
exit(1);
}
@@ -158,7 +158,7 @@ getconfig(intface)
syslog(LOG_ERR,
"<%s> mininterval (%ld) on %s is invalid "
"(must be between %e and %d)",
- __FUNCTION__, val, intface, MIN_MININTERVAL,
+ __func__, val, intface, MIN_MININTERVAL,
(tmp->maxinterval * 3) / 4);
exit(1);
}
@@ -177,7 +177,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 (%02x) on %s",
- __FUNCTION__, tmp->rtpref, intface);
+ __func__, tmp->rtpref, intface);
exit(1);
}
@@ -186,7 +186,7 @@ getconfig(intface)
syslog(LOG_ERR,
"<%s> router lifetime (%ld) on %s is invalid "
"(must be 0 or between %d and %d)",
- __FUNCTION__, val, intface, tmp->maxinterval,
+ __func__, val, intface, tmp->maxinterval,
tmp->maxinterval, MAXROUTERLIFETIME);
exit(1);
}
@@ -203,7 +203,7 @@ getconfig(intface)
"<%s> non zero router lifetime is specified for %s, "
"which must not be allowed for hosts. you must "
"change router lifetime or enable IPv6 forwarding.",
- __FUNCTION__, intface);
+ __func__, intface);
exit(1);
}
tmp->lifetime = val & 0xffff;
@@ -213,7 +213,7 @@ getconfig(intface)
syslog(LOG_ERR,
"<%s> reachable time (%ld) on %s is invalid "
"(must be no greater than %d)",
- __FUNCTION__, val, intface, MAXREACHABLETIME);
+ __func__, val, intface, MAXREACHABLETIME);
exit(1);
}
tmp->reachabletime = (u_int32_t)val;
@@ -221,7 +221,7 @@ getconfig(intface)
MAYHAVE(val64, "retrans", DEF_ADVRETRANSTIMER);
if (val64 < 0 || val64 > 0xffffffff) {
syslog(LOG_ERR, "<%s> retrans time (%lld) on %s out of range",
- __FUNCTION__, (long long)val64, intface);
+ __func__, (long long)val64, intface);
exit(1);
}
tmp->retranstimer = (u_int32_t)val64;
@@ -229,7 +229,7 @@ getconfig(intface)
if (agetnum("hapref") != -1 || agetnum("hatime") != -1) {
syslog(LOG_ERR,
"<%s> mobile-ip6 configuration not supported",
- __FUNCTION__);
+ __func__);
exit(1);
}
/* prefix information */
@@ -248,7 +248,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);
@@ -263,7 +263,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));
@@ -280,28 +280,28 @@ 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 on %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);
makeentry(entbuf, sizeof(entbuf), i, "prefixlen",
added);
@@ -309,7 +309,7 @@ getconfig(intface)
if (val < 0 || val > 128) {
syslog(LOG_ERR, "<%s> prefixlen (%ld) for %s "
"on %s out of range",
- __FUNCTION__, val, addr, intface);
+ __func__, val, addr, intface);
exit(1);
}
pfx->prefixlen = (int)val;
@@ -326,7 +326,7 @@ getconfig(intface)
if (val64 < 0 || val64 > 0xffffffff) {
syslog(LOG_ERR, "<%s> vltime (%lld) for "
"%s/%d on %s is out of range",
- __FUNCTION__, (long long)val64,
+ __func__, (long long)val64,
addr, pfx->prefixlen, intface);
exit(1);
}
@@ -346,7 +346,7 @@ getconfig(intface)
syslog(LOG_ERR,
"<%s> pltime (%lld) for %s/%d on %s "
"is out of range",
- __FUNCTION__, (long long)val64,
+ __func__, (long long)val64,
addr, pfx->prefixlen, intface);
exit(1);
}
@@ -366,7 +366,7 @@ getconfig(intface)
if (val < 0 || val > 0xffffffff) {
syslog(LOG_ERR,
"<%s> mtu (%ld) on %s out of range",
- __FUNCTION__, val, intface);
+ __func__, val, intface);
exit(1);
}
tmp->linkmtu = (u_int32_t)val;
@@ -381,7 +381,7 @@ getconfig(intface)
syslog(LOG_ERR,
"<%s> advertised link mtu (%lu) on %s is invalid (must "
"be between least MTU (%d) and physical link MTU (%d)",
- __FUNCTION__, (unsigned long)tmp->linkmtu, intface,
+ __func__, (unsigned long)tmp->linkmtu, intface,
IPV6_MMTU, tmp->phymtu);
exit(1);
}
@@ -417,7 +417,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) {
@@ -437,7 +437,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 (plen == 128) /* XXX */
@@ -451,7 +451,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));
@@ -469,12 +469,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;
@@ -527,7 +527,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));
@@ -542,7 +542,7 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr)
insque(prefix, &rai->prefix);
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);
@@ -574,7 +574,7 @@ delete_prefix(struct rainfo *rai, 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);
free(prefix);
@@ -594,13 +594,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;
@@ -614,7 +614,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);
@@ -640,7 +640,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);
}
@@ -671,7 +671,7 @@ make_packet(struct rainfo *rainfo)
syslog(LOG_INFO,
"<%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;
@@ -685,7 +685,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) {
@@ -794,7 +794,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);
}