compat: backport definition of NLMSG_DEFAULT_SIZE
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Fri, 29 Jun 2012 20:40:15 +0000 (13:40 -0700)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Fri, 29 Jun 2012 20:40:15 +0000 (13:40 -0700)
This backports the definition of NLMSG_DEFAULT_SIZE
defined in this commit:

commit 58050fce3530939372e6c2f4b4beb76fcb4caa65
Author: Thomas Graf <tgraf@suug.ch>
Date:   Thu Jun 28 03:57:45 2012 +0000

    net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()

    Using NLMSG_GOODSIZE results in multiple pages being used as
    nlmsg_new() will automatically add the size of the netlink
    header to the payload thus exceeding the page limit.

    NLMSG_DEFAULT_SIZE takes this into account.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
include/linux/compat-3.6.h

index 8cdfa87749186876347470228469e36f14a65d0d..9da8ec5009197c2dc79df36a47cef62a0b55c015 100644 (file)
@@ -5,6 +5,10 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
 
+#include <net/genetlink.h>
+
+#define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN)
+
 /*
  * Backports 
  *