From: Ben Pfaff Date: Mon, 5 May 2008 19:08:00 +0000 (-0700) Subject: Fix compilation on Linux 2.6.20: declare NLMSG_DEFAULT_SIZE with this kernel. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff9464d2ad9b6aae4310932b58a8cc246caf213d;p=openvswitch Fix compilation on Linux 2.6.20: declare NLMSG_DEFAULT_SIZE with this kernel. NLMSG_DEFAULT_SIZE was introduced in 2.6.20-rc1 in commit 339bf98ff, "[NETLINK]: Do precise netlink message allocations where possible", but we only defined it for kernels 2.6.18 and earlier. This change fixes up the discrepancy. --- diff --git a/datapath/linux-2.6/compat-2.6/include/linux/netlink.h b/datapath/linux-2.6/compat-2.6/include/linux/netlink.h index f1588af0..c5f83bd0 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/netlink.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/netlink.h @@ -6,10 +6,12 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#ifndef NLMSG_DEFAULT_SIZE #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) #define nlmsg_new(s, f) nlmsg_new_proper((s), (f)) static inline struct sk_buff *nlmsg_new_proper(int size, gfp_t flags) {