datapath: Make VERIFY_NUL_STRING verify the string length too.
authorBen Pfaff <blp@nicira.com>
Thu, 20 Jan 2011 00:16:08 +0000 (16:16 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Jan 2011 05:08:37 +0000 (21:08 -0800)
commit7897d3fa21ec370997e4f108b01de2664bec0a67
tree0ab11d70d60209b129220eaf65438119490932e7
parentc283069c71adc49c182a1ac569a05e2dca949eda
datapath: Make VERIFY_NUL_STRING verify the string length too.

It's better to use HAVE_NLA_NUL_STRING than a version check because the
Xen 2.6.18 kernels backport NLA_NUL_STRING and the nla_policy changes.

Just defining NLA_NUL_STRING to an innocuous value doesn't work, because
Linux before 2.6.19 doesn't define a 'len' member in struct nla_policy at
all (it was named 'minlen' and had different semantics), so attempting to
initialize it caused compile errors.

Grouping things this way also makes it clearer what needs to be deleted
when upstreaming.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/brc_procfs.c
datapath/brc_procfs.h
datapath/brcompat.c
datapath/linux-2.6/compat-2.6/include/net/netlink.h