Skip to content

Commit 99560fe

Browse files
committed
pfctl: Do not warn if there is no Ethernet anchor
Avoid emitting a warning if there is no Ethernet anchor. If the anchor --regardless of its type-- is nonexistent, should be caught earlier. This can be misleading when there is a layer 3 anchor but not an Ethernet anchor, giving the user the impression that there is no layer 3 anchor with that name. PR: 280516 Approved by: kp MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D53360
1 parent a943a96 commit 99560fe

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

sbin/pfctl/pfctl.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,10 +3167,7 @@ pfctl_show_eth_anchors(int dev, int opts, char *anchorname)
31673167
int ret;
31683168

31693169
if ((ret = pfctl_get_eth_rulesets_info(dev, &ri, anchorname)) != 0) {
3170-
if (ret == ENOENT)
3171-
fprintf(stderr, "Anchor '%s' not found.\n",
3172-
anchorname);
3173-
else
3170+
if (ret != ENOENT)
31743171
errc(1, ret, "DIOCGETETHRULESETS");
31753172
return (-1);
31763173
}

tests/sys/netpfil/pf/anchor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ deeply_nested_body()
157157

158158
atf_check -s exit:0 -o \
159159
inline:" foo\n foo/bar\n foo/bar/foobar\n foo/bar/quux\n foo/baz\n foo/qux\n" \
160-
-e ignore jexec alcatraz pfctl -sA
160+
jexec alcatraz pfctl -sA
161161

162162
atf_check -s exit:0 -o inline:" foo/bar/foobar\n foo/bar/quux\n" \
163-
-e ignore jexec alcatraz pfctl -a foo/bar -sA
163+
jexec alcatraz pfctl -a foo/bar -sA
164164
}
165165

166166
deeply_nested_cleanup()

0 commit comments

Comments
 (0)