summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/arp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-07-31 15:19:07 +0000
committerbrian <brian@FreeBSD.org>2001-07-31 15:19:07 +0000
commit160b405b91c3562b55c42216ca9100b40bd7542e (patch)
treeda754efd1880096505b490f78d835e000adcab55 /usr.sbin/ppp/arp.c
parentf08bb448bdf44804388976655f9a625d3860818a (diff)
downloadFreeBSD-src-160b405b91c3562b55c42216ca9100b40bd7542e.zip
FreeBSD-src-160b405b91c3562b55c42216ca9100b40bd7542e.tar.gz
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). MFC after: 1 week
Diffstat (limited to 'usr.sbin/ppp/arp.c')
-rw-r--r--usr.sbin/ppp/arp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c
index 9d89c0d..e5dcea1 100644
--- a/usr.sbin/ppp/arp.c
+++ b/usr.sbin/ppp/arp.c
@@ -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;
OpenPOWER on IntegriCloud