FreeBSD Bugzilla – Attachment 116547 Details for
Bug 158500
[patch] Add -p to arp(8) to hide permanent entries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
arp.diff
arp.diff (text/plain), 2.41 KB, created by
Jille
on 2011-06-29 19:30:26 UTC
(
hide
)
Description:
arp.diff
Filename:
MIME Type:
Creator:
Jille
Created:
2011-06-29 19:30:26 UTC
Size:
2.41 KB
patch
obsolete
>Index: arp.c >=================================================================== >--- arp.c (revision 204041) >+++ arp.c (working copy) >@@ -99,6 +99,7 @@ > static int valid_type(int type); > > static int nflag; /* no reverse dns lookups */ >+static int pflag = 0; /* hide permanemt entries */ > static char *rifname; > > static int expire_time, flags, doing_proxy, proxy_only; >@@ -119,7 +120,7 @@ > int rtn = 0; > int aflag = 0; /* do it for all entries */ > >- while ((ch = getopt(argc, argv, "andfsSi:")) != -1) >+ while ((ch = getopt(argc, argv, "andfpsSi:")) != -1) > switch(ch) { > case 'a': > aflag = 1; >@@ -130,6 +131,9 @@ > case 'n': > nflag = 1; > break; >+ case 'p': >+ pflag = 1; >+ break; > case 'S': > SETFUNC(F_REPLACE); > break; >@@ -161,6 +165,10 @@ > err(1, "if_nametoindex(%s)", rifname); > } > } >+ if (pflag) { >+ if (func != F_GET && !(func == F_DELETE && aflag)) >+ errx(1, "-p not applicable to this operation"); >+ } > switch (func) { > case F_GET: > if (aflag) { >@@ -540,6 +548,10 @@ > if (rifname && if_indextoname(sdl->sdl_index, ifname) && > strcmp(ifname, rifname)) > continue; >+ if (pflag) { >+ if (rtm->rtm_rmx.rmx_expire == 0) >+ continue; >+ } > if (addr) { > if (addr != sin2->sin_addr.s_addr) > continue; >@@ -653,10 +665,10 @@ > usage(void) > { > fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", >- "usage: arp [-n] [-i interface] hostname", >- " arp [-n] [-i interface] -a", >+ "usage: arp [-np] [-i interface] hostname", >+ " arp [-np] [-i interface] -a", > " arp -d hostname [pub]", >- " arp -d [-i interface] -a", >+ " arp -d [-p] [-i interface] -a", > " arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]", > " arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]", > " arp -f filename"); >Index: arp.8 >=================================================================== >--- arp.8 (revision 204041) >+++ arp.8 (working copy) >@@ -36,11 +36,11 @@ > .Nd address resolution display and control > .Sh SYNOPSIS > .Nm >-.Op Fl n >+.Op Fl np > .Op Fl i Ar interface > .Ar hostname > .Nm >-.Op Fl n >+.Op Fl np > .Op Fl i Ar interface > .Fl a > .Nm >@@ -48,6 +48,7 @@ > .Op Cm pub > .Nm > .Fl d >+.Op Fl p > .Op Fl i Ar interface > .Fl a > .Nm >@@ -111,6 +112,8 @@ > Show network addresses as numbers (normally > .Nm > attempts to display addresses symbolically). >+.It Fl p >+Hide permanent entries. > .It Fl s Ar hostname ether_addr > Create an > .Tn ARP
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 158500
: 116547