summaryrefslogtreecommitdiffstats
path: root/iptables/nft-arp.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-01-31 16:12:55 +0100
committerFlorian Westphal <fw@strlen.de>2019-01-31 22:54:12 +0100
commit84331e3ed3f8eb9d53c00c221113ad16b209968a (patch)
tree3c23a42a1c372c7f803684cbd7b7f21d1ab25313 /iptables/nft-arp.c
parent2c3f7a2cd6fd8325b3a84e280cce945c6c20b87f (diff)
arptables-nft: Don't print default h-len/h-type values
Default values for --h-len and --h-type being printed for rules where user didn't provide them is unexpected and confusing. The drawback is the opposite: If user provided either of them with their default value, they are later omitted when listing rules. Though since unlike legacy arptables we can't distinguish between not specified and specified with default value, we can't fix both - so choose to optimize for the more likely case. Fixes: 5aecb2d8bfdda ("arptables: pre-init hlen and ethertype") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft-arp.c')
-rw-r--r--iptables/nft-arp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
index 3dc0b953..438646de 100644
--- a/iptables/nft-arp.c
+++ b/iptables/nft-arp.c
@@ -537,7 +537,7 @@ after_devsrc:
after_devdst:
- if (fw->arp.arhln_mask != 0) {
+ if (fw->arp.arhln_mask != 255 || fw->arp.arhln != 6) {
printf("%s%s", sep, fw->arp.invflags & ARPT_INV_ARPHLN
? "! " : "");
printf("--h-length %d", fw->arp.arhln);
@@ -561,7 +561,7 @@ after_devdst:
sep = " ";
}
- if (fw->arp.arhrd_mask != 0) {
+ if (fw->arp.arhrd_mask != 65535 || fw->arp.arhrd != htons(1)) {
uint16_t tmp = ntohs(fw->arp.arhrd);
printf("%s%s", sep, fw->arp.invflags & ARPT_INV_ARPHRD