summaryrefslogtreecommitdiffstats
path: root/iptables/nft-arp.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-05-05 18:07:38 +0200
committerPhil Sutter <phil@nwl.cc>2022-05-11 12:02:19 +0200
commit8ff84eaf987d74603a88b02632bd00187defcf8d (patch)
tree5a5f56fb4dd4ec09e72271387edb604c73b53e37 /iptables/nft-arp.c
parentadbfec0b3e3275ea5e7c933b630756cf01a4f8c6 (diff)
xshared: Move arp_opcodes into shared space
It will be referenced by xtables_printhelp() if printing for arptables and therefore must be present in legacy as well even if unused. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-arp.c')
-rw-r--r--iptables/nft-arp.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
index 65bd965e..e6e4d2d8 100644
--- a/iptables/nft-arp.c
+++ b/iptables/nft-arp.c
@@ -25,22 +25,8 @@
#include <linux/netfilter/nf_tables.h>
#include "nft-shared.h"
-#include "nft-arp.h"
#include "nft.h"
-
-/* a few names */
-char *arp_opcodes[] =
-{
- "Request",
- "Reply",
- "Request_Reverse",
- "Reply_Reverse",
- "DRARP_Request",
- "DRARP_Reply",
- "DRARP_Error",
- "InARP_Request",
- "ARP_NAK",
-};
+#include "xshared.h"
static bool need_devaddr(struct arpt_devaddr_info *info)
{
@@ -429,7 +415,7 @@ after_devdst:
printf("%s%s", sep, fw->arp.invflags & IPT_INV_ARPOP
? "! " : "");
- if (tmp <= NUMOPCODES && !(format & FMT_NUMERIC))
+ if (tmp <= ARP_NUMOPCODES && !(format & FMT_NUMERIC))
printf("--opcode %s", arp_opcodes[tmp-1]);
else
printf("--opcode %d", tmp);
@@ -660,11 +646,11 @@ static void nft_arp_post_parse(int command,
&cs->arp.arp.arpop_mask, 10)) {
int i;
- for (i = 0; i < NUMOPCODES; i++)
+ for (i = 0; i < ARP_NUMOPCODES; i++)
if (!strcasecmp(arp_opcodes[i],
args->arp_opcode))
break;
- if (i == NUMOPCODES)
+ if (i == ARP_NUMOPCODES)
xtables_error(PARAMETER_PROBLEM,
"Problem with specified opcode");
cs->arp.arp.arpop = htons(i+1);