Print a warning when blackhole and reject are used together.
Update arp.8 manual page syntax. PR: 125896 Submitted by: Marc Olzheim <marcolz@stack.nl> Approved by: sam
This commit is contained in:
parent
46e6dd8ffb
commit
2293dac2ac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186485
@ -28,7 +28,7 @@
|
|||||||
.\" @(#)arp.8 8.1 (Berkeley) 6/6/93
|
.\" @(#)arp.8 8.1 (Berkeley) 6/6/93
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd March 18, 2008
|
.Dd December 25, 2008
|
||||||
.Dt ARP 8
|
.Dt ARP 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -53,14 +53,12 @@
|
|||||||
.Nm
|
.Nm
|
||||||
.Fl s Ar hostname ether_addr
|
.Fl s Ar hostname ether_addr
|
||||||
.Op Cm temp
|
.Op Cm temp
|
||||||
.Op Cm reject
|
.Op Cm blackhole No \&| Cm reject
|
||||||
.Op Cm blackhole
|
|
||||||
.Op Cm pub Op Cm only
|
.Op Cm pub Op Cm only
|
||||||
.Nm
|
.Nm
|
||||||
.Fl S Ar hostname ether_addr
|
.Fl S Ar hostname ether_addr
|
||||||
.Op Cm temp
|
.Op Cm temp
|
||||||
.Op Cm reject
|
.Op Cm blackhole No \&| Cm reject
|
||||||
.Op Cm blackhole
|
|
||||||
.Op Cm pub Op Cm only
|
.Op Cm pub Op Cm only
|
||||||
.Nm
|
.Nm
|
||||||
.Fl f Ar filename
|
.Fl f Ar filename
|
||||||
@ -182,7 +180,8 @@ in the file should be of the form
|
|||||||
.Bd -ragged -offset indent -compact
|
.Bd -ragged -offset indent -compact
|
||||||
.Ar hostname ether_addr
|
.Ar hostname ether_addr
|
||||||
.Op Cm temp
|
.Op Cm temp
|
||||||
.Op Cm pub
|
.Op Cm blackhole No \&| Cm reject
|
||||||
|
.Op Cm pub Op Cm only
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
with argument meanings as given above.
|
with argument meanings as given above.
|
||||||
|
@ -330,8 +330,14 @@ set(int argc, char **argv)
|
|||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
} else if (strncmp(argv[0], "blackhole", 9) == 0) {
|
} else if (strncmp(argv[0], "blackhole", 9) == 0) {
|
||||||
|
if (flags & RTF_REJECT) {
|
||||||
|
printf("Choose one of blackhole or reject, not both.\n");
|
||||||
|
}
|
||||||
flags |= RTF_BLACKHOLE;
|
flags |= RTF_BLACKHOLE;
|
||||||
} else if (strncmp(argv[0], "reject", 6) == 0) {
|
} else if (strncmp(argv[0], "reject", 6) == 0) {
|
||||||
|
if (flags & RTF_BLACKHOLE) {
|
||||||
|
printf("Choose one of blackhole or reject, not both.\n");
|
||||||
|
}
|
||||||
flags |= RTF_REJECT;
|
flags |= RTF_REJECT;
|
||||||
} else if (strncmp(argv[0], "trail", 5) == 0) {
|
} else if (strncmp(argv[0], "trail", 5) == 0) {
|
||||||
/* XXX deprecated and undocumented feature */
|
/* XXX deprecated and undocumented feature */
|
||||||
@ -648,8 +654,8 @@ usage(void)
|
|||||||
" arp [-n] [-i interface] -a",
|
" arp [-n] [-i interface] -a",
|
||||||
" arp -d hostname [pub]",
|
" arp -d hostname [pub]",
|
||||||
" arp -d [-i interface] -a",
|
" arp -d [-i interface] -a",
|
||||||
" arp -s hostname ether_addr [temp] [reject] [blackhole] [pub [only]]",
|
" arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
|
||||||
" arp -S hostname ether_addr [temp] [reject] [blackhole] [pub [only]]",
|
" arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
|
||||||
" arp -f filename");
|
" arp -f filename");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user