Subject: Re: [PATCH 6/8 v2] netfilter: fix string extension for case insensitive pattern matching

From: Patrick McHardy <[email-masked]>
Date: Thu, 26 Jun 2008 13:34:18 +0200

Joonwoo Park wrote:
> netfilter: fix string extension for case insensitive pattern matching
> 
> The flag XT_STRING_FLAG_IGNORECASE indicates case insensitive string
> matching.
> netfilter can find cmd.exe, Cmd.exe, cMd.exe and etc easily.
> 
> Also this patch won't break compatibility since we have 2 bytes space
> between invert and config, due to config was 8 bytes aligned.
> So we can put a new value 'flags' in xt_string_info between invert and
> config safely.
> If previous version of iptables interact with this kernel, to kernel
> side, flags will be set to zero and to user side, flags will be ignored.

This makes it hard for userspace to know whether insensitive
search is supported or not, similar for possible future flag
additions.

Please

- add a new revision for userspace to know whether flags are
   supported at all. You don't need to duplicate the checkentry
   function for this since the structure layout didn't change,
   you can simply parse flags dependant on match->revision.
   Userspace can use the existance of the new revision as
   indication that flags are supported.

- check for unknown flags and return an error