CT: add "none" as parameter for --ctevents
Pablo Neira Ayuso
maintainerPATCH 1/1 CT: add "none" as parameter for --ctevents
This allows not to deliver any event. This can be useful if you want no events for some protocols, for example:
iptables -I PREROUTING -t raw -p udp -j CT --ctevents none
Thus, no events for UDP traffic are delivered to user-space.
--- extensions/libxt_CT.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
extensions/libxt_CT.c +5 -1
@@ -68,7 +68,7 @@ static uint32_t ct_parse_events(const struct event_tbl *tbl, unsigned int size,strcpy (str, events);while ((t =strsep (&e,"," ))) {for (i =0 ; i < size; i++) { -if (strcmp (t, tbl[i].name)) +if (!strcmp (t,"none" ) ||strcmp (t, tbl[i].name))continue ; mask |=1 << tbl[i].event;break ;
@@ -87,6 +87,10 @@ static void ct_print_events(const char *pfx, const struct event_tbl *tbl,const char *sep ="" ;unsigned int i; +if (mask ==0 ) { +printf ("none " ); +return ; + }printf ("%s " , pfx);for (i =0 ; i < size; i++) {if (mask & (1 << tbl[i].event)) {
Pablo Neira Ayuso
maintainerQuoted 6 lines · Pablo Neira Ayuso
This allows not to deliver any event. This can be useful if you want no events for some protocols, for example:
iptables -I PREROUTING -t raw -p udp -j CT --ctevents none
Thus, no events for UDP traffic are delivered to user-space.
This patch is broken, I'll fix it and resend, sorry.
Am 31.01.2011 23:48, schrieb Pablo Neira Ayuso:
Quoted 6 lines
This allows not to deliver any event. This can be useful if you want no events for some protocols, for example:
iptables -I PREROUTING -t raw -p udp -j CT --ctevents none
Thus, no events for UDP traffic are delivered to user-space.
Looks fine to me.