diff options
author | brian <brian@cvs.openbsd.org> | 2001-07-31 15:20:20 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2001-07-31 15:20:20 +0000 |
commit | a4644a1daf8c7db34fe3623ec334b8ae712464fa (patch) | |
tree | f19e9073d2653cb69aa2ca993e379296d4569320 /usr.sbin/ppp | |
parent | 7e869dd08f73eb663a8c4425642b53a970c07585 (diff) |
Remove an irritating diagnostic emitted to LogPHASE when a
static proxy arp entry is deleted.
Rename a function (for consistency) and remove some whitespace
(for readability).
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ppp/arp.c | 20 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/arp.h | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/mp.c | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/usr.sbin/ppp/ppp/arp.c b/usr.sbin/ppp/ppp/arp.c index 602165d8f15..6b3286f9686 100644 --- a/usr.sbin/ppp/ppp/arp.c +++ b/usr.sbin/ppp/ppp/arp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: arp.c,v 1.8 2000/11/02 00:54:33 brian Exp $ + * $OpenBSD: arp.c,v 1.9 2001/07/31 15:20:19 brian Exp $ * */ @@ -104,7 +104,7 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s) */ memset(&arpmsg, 0, sizeof arpmsg); - if (!get_ether_addr(s, addr, &arpmsg.hwa)) { + if (!arp_EtherAddr(s, addr, &arpmsg.hwa, 0)) { log_Printf(LogWARN, "%s: Cannot determine ethernet address for proxy ARP\n", inet_ntoa(addr)); return 0; @@ -144,7 +144,6 @@ arp_ProxySub(struct bundle *bundle, struct in_addr addr, int add, int s) int arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s) { - return (arp_ProxySub(bundle, addr, 1, s)); } @@ -154,7 +153,6 @@ arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s) int arp_ClearProxy(struct bundle *bundle, struct in_addr addr, int s) { - return (arp_ProxySub(bundle, addr, 0, s)); } @@ -178,7 +176,7 @@ arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s) * Get the hardware address of an interface on the same subnet as our local * address. */ - if (!get_ether_addr(s, addr, &dls.sdl)) { + if (!arp_EtherAddr(s, addr, &dls.sdl, 1)) { log_Printf(LOG_PHASE_BIT, "Cannot determine ethernet address for " "proxy ARP\n"); return 0; @@ -220,12 +218,13 @@ arp_ClearProxy(struct bundle *bundle, struct in_addr addr, int s) /* - * get_ether_addr - get the hardware address of an interface on the + * arp_EtherAddr - get the hardware address of an interface on the * the same subnet as ipaddr. */ int -get_ether_addr(int s, struct in_addr ipaddr, struct sockaddr_dl *hwaddr) +arp_EtherAddr(int s, struct in_addr ipaddr, struct sockaddr_dl *hwaddr, + int verbose) { int mib[6], skip; size_t needed; @@ -243,7 +242,7 @@ get_ether_addr(int s, struct in_addr ipaddr, struct sockaddr_dl *hwaddr) mib[5] = 0; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { - log_Printf(LogERROR, "get_ether_addr: sysctl: estimate: %s\n", + log_Printf(LogERROR, "arp_EtherAddr: sysctl: estimate: %s\n", strerror(errno)); return 0; } @@ -299,8 +298,9 @@ get_ether_addr(int s, struct in_addr ipaddr, struct sockaddr_dl *hwaddr) if ((ifa->sin_addr.s_addr & netmask->sin_addr.s_addr) == (ipaddr.s_addr & netmask->sin_addr.s_addr)) { - log_Printf(LogPHASE, "Found interface %.*s for %s\n", - dl->sdl_alen, dl->sdl_data, inet_ntoa(ipaddr)); + log_Printf(verbose ? LogPHASE : LogDEBUG, + "Found interface %.*s for %s\n", dl->sdl_alen, + dl->sdl_data, inet_ntoa(ipaddr)); memcpy(hwaddr, dl, dl->sdl_len); free(buf); return 1; diff --git a/usr.sbin/ppp/ppp/arp.h b/usr.sbin/ppp/ppp/arp.h index 3b15cebfc1b..484f1f87045 100644 --- a/usr.sbin/ppp/ppp/arp.h +++ b/usr.sbin/ppp/ppp/arp.h @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: arp.h,v 1.4 2001/06/13 21:33:40 brian Exp $ + * $OpenBSD: arp.h,v 1.5 2001/07/31 15:20:19 brian Exp $ */ struct sockaddr_dl; @@ -33,4 +33,4 @@ struct bundle; extern int arp_ClearProxy(struct bundle *, struct in_addr, int); extern int arp_SetProxy(struct bundle *, struct in_addr, int); -extern int get_ether_addr(int, struct in_addr, struct sockaddr_dl *); +extern int arp_EtherAddr(int, struct in_addr, struct sockaddr_dl *, int); diff --git a/usr.sbin/ppp/ppp/mp.c b/usr.sbin/ppp/ppp/mp.c index 73c69cec417..dae878ab1f8 100644 --- a/usr.sbin/ppp/ppp/mp.c +++ b/usr.sbin/ppp/ppp/mp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: mp.c,v 1.22 2001/07/03 22:23:56 brian Exp $ + * $OpenBSD: mp.c,v 1.23 2001/07/31 15:20:19 brian Exp $ */ #include <sys/param.h> @@ -998,7 +998,7 @@ mp_SetEnddisc(struct cmdargs const *arg) log_Printf(LogERROR, "set enddisc: socket(): %s\n", strerror(errno)); return 2; } - if (get_ether_addr(s, addr, &hwaddr)) { + if (arp_EtherAddr(s, addr, &hwaddr, 1)) { mp->cfg.enddisc.class = ENDDISC_MAC; memcpy(mp->cfg.enddisc.address, hwaddr.sdl_data + hwaddr.sdl_nlen, hwaddr.sdl_alen); |