From e9424a8733e9cade22fc37cadcb86988038b4b76 Mon Sep 17 00:00:00 2001 From: ecki Date: Mon, 16 May 2005 04:30:17 +0000 Subject: [PATCH] desupport dontpub in arp.8 and arp -? (Debian Bug #203396) --- arp.c | 32 ++++++++++++++++---------------- man/en_US/arp.8 | 15 +++++++++------ 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/arp.c b/arp.c index 5c20449e1..b02c74baa 100644 --- a/arp.c +++ b/arp.c @@ -8,7 +8,7 @@ * NET-3 Networking Distribution for the LINUX operating * system. * - * Version: $Id: arp.c,v 1.23 2003/02/08 19:56:25 ecki Exp $ + * Version: $Id: arp.c,v 1.24 2005/05/16 04:30:17 ecki Exp $ * * Maintainer: Bernd 'eckes' Eckenfels, * @@ -148,7 +148,7 @@ static int arp_del(char **args) continue; } if (!strcmp(*args, "dontpub")) { -#ifdef HAVE_ATF_DONTPUB +#ifdef ATF_DONTPUB req.arp_flags |= ATF_DONTPUB; #else ENOSUPP("arp", "ATF_DONTPUB"); @@ -157,7 +157,7 @@ static int arp_del(char **args) continue; } if (!strcmp(*args, "auto")) { -#ifdef HAVE_ATF_MAGIC +#ifdef ATF_MAGIC req.arp_flags |= ATF_MAGIC; #else ENOSUPP("arp", "ATF_MAGIC"); @@ -205,21 +205,21 @@ static int arp_del(char **args) /* Call the kernel. */ if (flags & 2) { if (opt_v) - fprintf(stderr, "arp: SIOCDARP(nopub)\n"); + fprintf(stderr, "arp: SIOCDARP(dontpub)\n"); if (ioctl(sockfd, SIOCDARP, &req) < 0) { if ((errno == ENXIO) || (errno == ENOENT)) { if (flags & 1) - goto nopub; + goto dontpub; printf(_("No ARP entry for %s\n"), host); return (-1); } - perror("SIOCDARP(nopub)"); + perror("SIOCDARP(dontpub)"); return (-1); } else deleted = 1; } if (!deleted && (flags & 1)) { - nopub: + dontpub: req.arp_flags |= ATF_PUBL; if (opt_v) fprintf(stderr, "arp: SIOCDARP(pub)\n"); @@ -323,7 +323,7 @@ static int arp_set(char **args) continue; } if (!strcmp(*args, "dontpub")) { -#ifdef HAVE_ATF_DONTPUB +#ifdef ATF_DONTPUB flags |= ATF_DONTPUB; #else ENOSUPP("arp", "ATF_DONTPUB"); @@ -332,7 +332,7 @@ static int arp_set(char **args) continue; } if (!strcmp(*args, "auto")) { -#ifdef HAVE_ATF_MAGIC +#ifdef ATF_MAGIC flags |= ATF_MAGIC; #else ENOSUPP("arp", "ATF_MAGIC"); @@ -451,11 +451,11 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas strcat(flags, "M"); if (arp_flags & ATF_PUBL) strcat(flags, "P"); -#ifdef HAVE_ATF_MAGIC +#ifdef ATF_MAGIC if (arp_flags & ATF_MAGIC) strcat(flags, "A"); #endif -#ifdef HAVE_ATF_DONTPUB +#ifdef ATF_DONTPUB if (arp_flags & ATF_DONTPUB) strcat(flags, "!"); #endif @@ -506,11 +506,11 @@ static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, c printf("PERM "); if (arp_flags & ATF_PUBL) printf("PUB "); -#ifdef HAVE_ATF_MAGIC +#ifdef ATF_MAGIC if (arp_flags & ATF_MAGIC) printf("AUTO "); #endif -#ifdef HAVE_ATF_DONTPUB +#ifdef ATF_DONTPUB if (arp_flags & ATF_DONTPUB) printf("DONTPUB "); #endif @@ -618,10 +618,10 @@ static void version(void) static void usage(void) { fprintf(stderr, _("Usage:\n arp [-vn] [] [-i ] [-a] [] <-Display ARP cache\n")); - fprintf(stderr, _(" arp [-v] [-i ] -d [pub][nopub] <-Delete ARP entry\n")); + fprintf(stderr, _(" arp [-v] [-i ] -d [pub] <-Delete ARP entry\n")); fprintf(stderr, _(" arp [-vnD] [] [-i ] -f [] <-Add entry from file\n")); - fprintf(stderr, _(" arp [-v] [] [-i ] -s [temp][nopub] <-Add entry\n")); - fprintf(stderr, _(" arp [-v] [] [-i ] -Ds [netmask ] pub <-''-\n\n")); + fprintf(stderr, _(" arp [-v] [] [-i ] -s [temp] <-Add entry\n")); + fprintf(stderr, _(" arp [-v] [] [-i ] -Ds [netmask ] pub <-''-\n\n")); fprintf(stderr, _(" -a display (all) hosts in alternative (BSD) style\n")); fprintf(stderr, _(" -s, --set set a new ARP entry\n")); diff --git a/man/en_US/arp.8 b/man/en_US/arp.8 index ff840a4f1..3709cf67e 100644 --- a/man/en_US/arp.8 +++ b/man/en_US/arp.8 @@ -1,4 +1,4 @@ -.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Programmer's Manual" +.TH ARP 8 "2005-05-16" "net-tools" "Linux Programmer's Manual" .SH NAME arp \- manipulate the system ARP cache .SH SYNOPSIS @@ -111,8 +111,8 @@ datagrams will be routed. Manually create an ARP address mapping entry for host .B hostname with hardware address set to -.BR hw_addr . -The format of the hardware address is dependent on the hardware +.B hw_addr +. The format of the hardware address is dependent on the hardware class, but for most classes one can assume that the usual presentation can be used. For the Ethernet class, this is 6 bytes in hexadecimal, separated by colons. When adding proxy arp entries (that is those with @@ -132,14 +132,17 @@ As of kernel 2.2.0 it is no longer possible to set an ARP entry for an entire subnet. Linux instead does automagic proxy arp when a route exists and it is forwarding. See .BR arp (7) -for details. +for details. Also the +.B dontpub +option which is available for delete and set operations cannot be +used with 2.4 and newer kernels. .TP .B "\-f filename, \-\-file filename" Similar to the .B \-s option, only this time the address info is taken from file -.BR filename . -This can be used if ARP entries for a lot of hosts have to be +.B filename +. This can be used if ARP entries for a lot of hosts have to be set up. The name of the data file is very often .IR /etc/ethers , but this is not official. If no filename is specified /etc/ethers -- 2.11.4.GIT