Skip to contentSkip to conversation

IP SET target iptables fix

PATCH Michal Pokrywka 1 participant 1 message Mar 17, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,
Current iptables target needs to test for IP_SET_INVALID_ID when printing or saving rules from kernel, currently it errors "iptables v1.3.1:
Set id 65535 in kernel doesn't exist."

Patch below fixes this problem:

extensions/libipt_SET.c 2005-03-17 14:18:43.055537000 +0100 renamed from extensions/libipt_SET.c 2005-03-17 14:16:26.005537000 +0100 +2 -0
diff -Nru iptables-1.3.1.orig/extensions/libipt_SET.c iptables-1.3.1/extensions/libipt_SET.c
@@ -121,6 +121,8 @@
  int i;
  char setname[IP_SET_MAXNAMELEN];
  
+ if (info->index == IP_SET_INVALID_ID)
+     return;
  get_set_byid(setname, info->index);
  printf("%s %s", prefix, setname);
  for (i = 0; i < IP_SET_MAX_BINDINGS; i++) {