diff options
| -rw-r--r-- | usr.sbin/arp/arp.8 | 35 | ||||
| -rw-r--r-- | usr.sbin/arp/arp.c | 8 |
2 files changed, 24 insertions, 19 deletions
diff --git a/usr.sbin/arp/arp.8 b/usr.sbin/arp/arp.8 index dc6c01b91689..80fcae55c465 100644 --- a/usr.sbin/arp/arp.8 +++ b/usr.sbin/arp/arp.8 @@ -47,18 +47,18 @@ .Fl a .Nm .Fl d Ar hostname -.Op Ar proxy +.Op Cm proxy .Nm .Fl d .Fl a .Nm .Fl s Ar hostname ether_addr -.Op Ar temp -.Op Ar pub +.Op Cm temp +.Op Cm pub .Nm .Fl S Ar hostname ether_addr -.Op Ar temp -.Op Ar pub +.Op Cm temp +.Op Cm pub .Nm .Fl f Ar filename .Sh DESCRIPTION @@ -75,7 +75,7 @@ The host may be specified by name or by number, using Internet dot notation. .Pp Available options: -.Bl -tag -width Ds +.Bl -tag -width indent .It Fl a The program displays or deletes all of the current .Tn ARP @@ -87,7 +87,7 @@ with the .Fl d flag. The -.Dq Li proxy +.Cm proxy keyword is sometimes required when deleting published ARP entries. This flag may be combined with the .Fl a @@ -105,10 +105,10 @@ with the Ethernet address .Ar ether_addr . The Ethernet address is given as six hex bytes separated by colons. The entry will be permanent unless the word -.Ar temp +.Cm temp is given in the command. If the word -.Ar pub +.Cm pub is given, the entry will be "published"; i.e., this system will act as an .Tn ARP @@ -116,14 +116,19 @@ server, responding to requests for .Ar hostname even though the host address is not its own. -In this case the ether_addr can be given as ``auto'' +In this case the +.Ar ether_addr +can be given as +.Cm auto in which case the interfaces on this host will be examined, and if one of them is found to occupy the same subnet, its -ether_addr will be used. +Ethernet address will be used. .It Fl S Ar hostname ether_addr Is just like .Fl s -except any existing arp entry for this host will be deleted first. +except any existing +.Tn ARP +entry for this host will be deleted first. .It Fl f Causes the file .Ar filename @@ -132,10 +137,10 @@ to be read and multiple entries to be set in the tables. Entries in the file should be of the form .Pp -.Bd -filled -offset indent -compact +.Bd -ragged -offset indent -compact .Ar hostname ether_addr -.Op Ar temp -.Op Ar pub +.Op Cm temp +.Op Cm pub .Ed .Pp with argument meanings as given above. diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 3afd37df8775..15e8aecd4945 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -291,6 +291,8 @@ set(int argc, char **argv) ea = (u_char *)LLADDR(&sdl_m); if (doing_proxy && !strcmp(eaddr, "auto")) { if (!get_ether_addr(sin->sin_addr.s_addr, ea)) { + printf("no interface found for %s\n", + inet_ntoa(sin->sin_addr)); return (1); } sdl_m.sdl_alen = 6; @@ -372,10 +374,10 @@ delete(char *host, char *info) register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; struct sockaddr_dl *sdl; - if (info && strncmp(info, "pro", 3) ) - export_only = 1; getsocket(); sin_m = blank_sin; + if (info && strncmp(info, "pro", 3) == 0) + sin_m.sin_other = SIN_PROXY; sin->sin_addr.s_addr = inet_addr(host); if (sin->sin_addr.s_addr == -1) { if (!(hp = gethostbyname(host))) { @@ -433,7 +435,6 @@ search(u_long addr, void (*action)(struct sockaddr_dl *sdl, struct rt_msghdr *rtm; struct sockaddr_inarp *sin; struct sockaddr_dl *sdl; - extern int h_errno; mib[0] = CTL_NET; mib[1] = PF_ROUTE; @@ -469,7 +470,6 @@ print_entry(struct sockaddr_dl *sdl, struct sockaddr_inarp *sin, struct rt_msghdr *rtm) { char *host; - extern int h_errno; struct hostent *hp; int seg; |
