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/rtadvd | |
parent | 6c92a002e822dbdbbbac9bc364854c2a215f8842 (diff) |
Kill __FUNCTION__.
ok itojun@
Diffstat (limited to 'usr.sbin/rtadvd')
-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 |
7 files changed, 153 insertions, 153 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 |