diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2002-06-10 19:57:36 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2002-06-10 19:57:36 +0000 |
commit | 35fd31a5849815bd4c982dfe259e378df50ccb9f (patch) | |
tree | 823dedb2be9a4ffb9ae1ce239d21c19a346f6318 /usr.sbin | |
parent | 6c92a002e822dbdbbbac9bc364854c2a215f8842 (diff) |
Kill __FUNCTION__.
ok itojun@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rtadvd/advcap.c | 4 | ||||
-rw-r--r-- | usr.sbin/rtadvd/config.c | 76 | ||||
-rw-r--r-- | usr.sbin/rtadvd/dump.c | 4 | ||||
-rw-r--r-- | usr.sbin/rtadvd/if.c | 22 | ||||
-rw-r--r-- | usr.sbin/rtadvd/rrenum.c | 40 | ||||
-rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 150 | ||||
-rw-r--r-- | usr.sbin/rtadvd/timer.c | 10 | ||||
-rw-r--r-- | usr.sbin/rtsold/dump.c | 4 | ||||
-rw-r--r-- | usr.sbin/rtsold/if.c | 36 | ||||
-rw-r--r-- | usr.sbin/rtsold/probe.c | 18 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 44 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 42 |
12 files changed, 225 insertions, 225 deletions
diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c index 891ed8e97cf..62cd5321cfb 100644 --- a/usr.sbin/rtadvd/advcap.c +++ b/usr.sbin/rtadvd/advcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: advcap.c,v 1.7 2002/05/29 14:34:05 itojun Exp $ */ +/* $OpenBSD: advcap.c,v 1.8 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: advcap.c,v 1.9 2002/05/29 14:28:35 itojun Exp $ */ /* @@ -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 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); } diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c index 49c7565ff81..401e97fc688 100644 --- a/usr.sbin/rtadvd/dump.c +++ b/usr.sbin/rtadvd/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.5 2002/05/29 14:34:05 itojun Exp $ */ +/* $OpenBSD: dump.c,v 1.6 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: dump.c,v 1.27 2002/05/29 14:23:55 itojun Exp $ */ /* @@ -208,7 +208,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 540d7a5d592..27247e7bb27 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.13 2002/06/09 00:56:09 deraadt Exp $ */ +/* $OpenBSD: if.c,v 1.14 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: if.c,v 1.17 2001/01/21 15:27:30 itojun Exp $ */ /* @@ -184,7 +184,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); } @@ -192,7 +192,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); } @@ -229,7 +229,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) break; default: syslog(LOG_ERR, "<%s> unsupported link type(%d)", - __FUNCTION__, sdl->sdl_type); + __func__, sdl->sdl_type); exit(1); } @@ -266,7 +266,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; } @@ -485,16 +485,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; @@ -520,7 +520,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); } @@ -528,7 +528,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; } @@ -551,7 +551,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 ed6aa47ccdb..6ef891bf395 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrenum.c,v 1.9 2002/05/29 14:34:05 itojun Exp $ */ +/* $OpenBSD: rrenum.c,v 1.10 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: rrenum.c,v 1.11 2002/05/21 14:26:55 itojun Exp $ */ /* @@ -85,7 +85,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 */ @@ -95,14 +95,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; } @@ -126,7 +126,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; @@ -162,7 +162,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; } @@ -194,7 +194,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 */ @@ -247,7 +247,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); } @@ -275,7 +275,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; } @@ -307,7 +307,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; @@ -315,7 +315,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; } @@ -342,7 +342,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; } @@ -350,7 +350,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; } @@ -359,7 +359,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; } @@ -369,7 +369,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; @@ -410,7 +410,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; } @@ -422,7 +422,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), @@ -432,7 +432,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), @@ -453,7 +453,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), @@ -476,7 +476,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 4101cb00d98..ce5d47f34e2 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.21 2002/06/09 00:56:09 deraadt Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.22 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */ /* @@ -227,7 +227,7 @@ main(argc, argv) if (pidfile(NULL) < 0) { syslog(LOG_ERR, "<%s> failed to open the pid log file, run anyway.", - __FUNCTION__); + __func__); } maxfd = sock; @@ -274,13 +274,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, selectfdp, NULL, NULL, @@ -288,7 +288,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 */ @@ -323,7 +323,7 @@ die() if (dflag > 1) { syslog(LOG_DEBUG, "<%s> cease to be an advertising router", - __FUNCTION__); + __func__); } for (ra = ralist; ra; ra = ra->next) { @@ -354,7 +354,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)) { /* @@ -366,7 +366,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); @@ -403,7 +403,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; @@ -414,7 +414,7 @@ rtmsg_input() syslog(LOG_DEBUG, "<%s> route changed on " "non advertising interface(%s)", - __FUNCTION__, + __func__, if_indextoname(ifindex, ifname)); } continue; @@ -437,7 +437,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); @@ -447,7 +447,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); @@ -472,7 +472,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); @@ -482,7 +482,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); @@ -505,7 +505,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; @@ -516,13 +516,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 */ @@ -579,13 +579,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; } @@ -596,7 +596,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; } @@ -605,7 +605,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; } @@ -615,7 +615,7 @@ rtadvd_input() if (i < 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() 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)); @@ -643,7 +643,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)); @@ -653,7 +653,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); @@ -670,7 +670,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)); @@ -680,7 +680,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)); @@ -690,7 +690,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); @@ -702,7 +702,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, @@ -716,7 +716,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; } @@ -733,7 +733,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)); @@ -745,7 +745,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)); @@ -762,7 +762,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; } @@ -776,7 +776,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; } @@ -826,7 +826,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; } @@ -867,7 +867,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)); @@ -880,7 +880,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)); @@ -894,7 +894,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)); @@ -908,7 +908,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, @@ -922,7 +922,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, @@ -936,7 +936,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, @@ -951,7 +951,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, @@ -966,7 +966,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, @@ -981,7 +981,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), @@ -1036,7 +1036,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, @@ -1049,7 +1049,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, @@ -1077,7 +1077,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, @@ -1092,7 +1092,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, @@ -1113,7 +1113,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, @@ -1128,7 +1128,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, @@ -1203,20 +1203,20 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (hdr->nd_opt_len == 0) { syslog(LOG_ERR, "<%s> bad ND option length(0) (type = %d)", - __FUNCTION__, hdr->nd_opt_type); + __func__, hdr->nd_opt_type); 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; } @@ -1228,7 +1228,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; @@ -1243,7 +1243,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; @@ -1291,7 +1291,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); } @@ -1299,12 +1299,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); } @@ -1315,14 +1315,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 @@ -1333,14 +1333,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 @@ -1353,7 +1353,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); } @@ -1364,7 +1364,7 @@ sock_open() &mreq.ipv6mr_multiaddr.s6_addr) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)", - __FUNCTION__); + __func__); exit(1); } while (ra) { @@ -1372,7 +1372,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; @@ -1386,7 +1386,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; @@ -1395,7 +1395,7 @@ sock_open() == 0) { syslog(LOG_ERR, "<%s> invalid interface: %s", - __FUNCTION__, mcastif); + __func__, mcastif); exit(1); } } else @@ -1404,7 +1404,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); @@ -1437,7 +1437,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); } } @@ -1466,7 +1466,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; } @@ -1498,14 +1498,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)); } } @@ -1525,7 +1525,7 @@ struct rainfo *rainfo; if (i < 0) { syslog(LOG_ERR, "<%s> unicast sendmsg on %s: %s", - __FUNCTION__, rainfo->ifname, + __func__, rainfo->ifname, strerror(errno)); } } @@ -1560,7 +1560,7 @@ ra_timeout(void *data) syslog(LOG_DEBUG, "<%s> RA timer on %s is expired", - __FUNCTION__, rai->ifname); + __func__, rai->ifname); ra_output(rai); } @@ -1597,7 +1597,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 8e6ccfd12cc..1f6249d6c0f 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.7 2002/05/29 14:34:05 itojun Exp $ */ +/* $OpenBSD: timer.c,v 1.8 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: timer.c,v 1.7 2002/05/21 14:26:55 itojun Exp $ */ /* @@ -65,7 +65,7 @@ rtadvd_add_timer(void (*timeout)(void *), if ((newtimer = malloc(sizeof(*newtimer))) == NULL) { syslog(LOG_ERR, - "<%s> can't allocate memory", __FUNCTION__); + "<%s> can't allocate memory", __func__); exit(1); } @@ -73,12 +73,12 @@ rtadvd_add_timer(void (*timeout)(void *), if (timeout == NULL) { syslog(LOG_ERR, - "<%s> timeout function unspecified", __FUNCTION__); + "<%s> timeout function unspecified", __func__); exit(1); } if (update == NULL) { syslog(LOG_ERR, - "<%s> update function unspecified", __FUNCTION__); + "<%s> update function unspecified", __func__); exit(1); } newtimer->expire = timeout; @@ -167,7 +167,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 da69e608b95..2fa4c16e7d7 100644 --- a/usr.sbin/rtsold/dump.c +++ b/usr.sbin/rtsold/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.9 2002/05/31 21:24:27 itojun Exp $ */ +/* $OpenBSD: dump.c,v 1.10 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: dump.c,v 1.10 2002/05/31 10:10:03 itojun Exp $ */ /* @@ -98,7 +98,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 f4dfa1e9213..0ff535e0fa7 100644 --- a/usr.sbin/rtsold/if.c +++ b/usr.sbin/rtsold/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.12 2002/05/31 21:24:28 itojun Exp $ */ +/* $OpenBSD: if.c,v 1.13 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: if.c,v 1.18 2002/05/31 10:10:03 itojun Exp $ */ /* @@ -89,38 +89,38 @@ 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__, "%s is ready", name); + 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; } @@ -137,7 +137,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); } @@ -157,7 +157,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); @@ -229,7 +229,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); } @@ -318,12 +318,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); } @@ -342,7 +342,7 @@ get_llflag(const char *name) strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_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); } @@ -367,12 +367,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); } @@ -380,7 +380,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); } @@ -403,7 +403,7 @@ get_llflag(const char *name) strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_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 91ed3dace4e..f34d8d88baa 100644 --- a/usr.sbin/rtsold/probe.c +++ b/usr.sbin/rtsold/probe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: probe.c,v 1.7 2002/05/31 21:24:28 itojun Exp $ */ +/* $OpenBSD: probe.c,v 1.8 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: probe.c,v 1.14 2002/05/31 10:10:03 itojun Exp $ */ /* @@ -69,18 +69,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); } @@ -105,13 +105,13 @@ defrouter_probe(struct ifinfo *ifinfo) int ifindex = ifinfo->sdl->sdl_index; 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; } memset(&dr, 0, 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; } @@ -120,7 +120,7 @@ defrouter_probe(struct ifinfo *ifinfo) 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-link-local address(%s)", inet_ntop(AF_INET6, @@ -172,11 +172,11 @@ sendprobe(struct in6_addr *addr, struct ifinfo *ifinfo) cm->cmsg_len = CMSG_LEN(sizeof(int)); 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)); } diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index a4052ac67ca..900563dfacc 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsol.c,v 1.8 2002/05/31 21:24:28 itojun Exp $ */ +/* $OpenBSD: rtsol.c,v 1.9 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: rtsol.c,v 1.15 2002/05/31 10:10:03 itojun Exp $ */ /* @@ -80,12 +80,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); } @@ -94,13 +94,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); } @@ -109,14 +109,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); } @@ -127,14 +127,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); } @@ -145,7 +145,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); } @@ -202,7 +202,7 @@ sendpacket(struct ifinfo *ifinfo) cm->cmsg_len = CMSG_LEN(sizeof(int)); memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); - warnmsg(LOG_DEBUG, __FUNCTION__, + warnmsg(LOG_DEBUG, __func__, "send RS on %s, whose state is %d", ifinfo->ifname, ifinfo->state); @@ -214,7 +214,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)); } @@ -234,7 +234,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; } @@ -254,18 +254,18 @@ rtsol_input(int s) } if (ifindex == 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to get receiving interface"); return; } if (hlimp == NULL) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to get receiving hop limit"); return; } if (i < sizeof(struct nd_router_advert)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "packet size(%d) is too short", i); return; } @@ -273,7 +273,7 @@ rtsol_input(int s) 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), @@ -282,7 +282,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), @@ -291,7 +291,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, @@ -301,7 +301,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), @@ -312,7 +312,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), @@ -320,7 +320,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), ifi->ifname, ifi->state); diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 8b02e68008c..7754690b958 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsold.c,v 1.23 2002/05/31 22:09:14 itojun Exp $ */ +/* $OpenBSD: rtsold.c,v 1.24 2002/06/10 19:57:35 espie Exp $ */ /* $KAME: rtsold.c,v 1.51 2002/05/31 22:00:11 itojun Exp $ */ /* @@ -203,14 +203,14 @@ main(argc, argv) * uses the socket. */ if ((s = sockopen()) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "failed to open a socket"); + warnmsg(LOG_ERR, __func__, "failed to open a socket"); exit(1); /*NOTREACHED*/ } maxfd = s; #ifdef USE_RTSOCK if ((rtsock = rtsock_open()) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, "failed to open a socket"); + warnmsg(LOG_ERR, __func__, "failed to open a socket"); exit(1); /*NOTREACHED*/ } @@ -230,7 +230,7 @@ main(argc, argv) /* configuration per interface */ if (ifinit()) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to initilizatoin interfaces"); exit(1); /*NOTREACHED*/ @@ -239,7 +239,7 @@ main(argc, argv) argv = autoifprobe(); while (argv && *argv) { if (ifconfig(*argv)) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to initialize %s", *argv); exit(1); /*NOTREACHED*/ @@ -249,7 +249,7 @@ main(argc, argv) /* setup for probing default routers */ if (probe_init()) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to setup for probing routers"); exit(1); /*NOTREACHED*/ @@ -258,7 +258,7 @@ main(argc, argv) /* dump the current pid */ if (!once) { if (pidfile(NULL) < 0) { - warnmsg(LOG_ERR, __FUNCTION__, + warnmsg(LOG_ERR, __func__, "failed to open a pid log file: %s", strerror(errno)); } @@ -299,7 +299,7 @@ main(argc, argv) e = select(maxfd + 1, selectfdp, 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; @@ -326,19 +326,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); } @@ -459,7 +459,7 @@ make_packet(struct ifinfo *ifinfo) char *buf; 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); } @@ -468,7 +468,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); } @@ -504,7 +504,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); @@ -529,7 +529,7 @@ rtsol_check_timer() ifinfo->active = 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, @@ -558,7 +558,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); ifinfo->probes = 0; @@ -574,7 +574,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)) /* this may occur when the interval is too small */ @@ -583,7 +583,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); @@ -639,7 +639,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; @@ -648,14 +648,14 @@ 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 { gettimeofday(&now, NULL); 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); |