From 2f7f6025147bc3364913d969b4bc33509aeb04f3651b8ae8958bfba71a8e27b6 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 00:03:39 +0000 Subject: [PATCH 1/8] Enable builds for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=8 --- libnetfilter_acct.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index d6e11d8..a0ddf97 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -29,7 +29,11 @@ BuildRequires: autoconf BuildRequires: automake >= 1.6 BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 +%if 0%{?suse_version} >= 1210 || 0%{?fedora_version} >= 15 BuildRequires: pkgconfig(libmnl) >= 1.0.0 +%else +BuildRequires: libmnl-devel >= 1.0.0 +%endif Summary: Userspace library for the in-kernel Netfilter counters License: LGPL-2.1+ Group: Productivity/Networking/Security From 51d0a350d96cf0f35817e3b206b715eafe43fbd976c7bd8154108652c27516fc Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 01:09:55 +0000 Subject: [PATCH 2/8] Enable builds for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=9 --- libnetfilter_acct.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index a0ddf97..a3bbdd0 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -84,11 +84,11 @@ rm -f "%buildroot/%_libdir"/*.la; %files -n %lname %defattr(-,root,root) -%_libdir/libnetfilter_acct.so.* +%_libdir/libnetfilter_acct.so.1* %files devel %defattr(-,root,root) -%_includedir/libnetfilter_acct* +%_includedir/%name-%version %_libdir/libnetfilter_acct.so %_libdir/pkgconfig/libnetfilter_acct.pc From e57269efb4d2f85a5c0c75f19a19bdcb3ab3660bd06795b751bce5f542de3f2e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 01:11:38 +0000 Subject: [PATCH 3/8] Packaging fixes for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=10 --- libnetfilter_acct.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index a3bbdd0..c7c8c17 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -75,7 +75,7 @@ fi; make %{?_smp_mflags} %install -%makeinstall +make install DESTDIR="%buildroot"; rm -f "%buildroot/%_libdir"/*.la; %post -n %lname -p /sbin/ldconfig From ce3b86ba3bd34b056fbaa7e08679548b91a5b90a7dd412a7c2f6c44d957912f5 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 17:54:11 +0000 Subject: [PATCH 4/8] Packaging fixes for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=11 --- libnetfilter_acct.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index c7c8c17..23d46e3 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -20,23 +20,25 @@ Name: libnetfilter_acct %define lname %{name}1 Version: 1.0.0 Release: 0 +Summary: Userspace library for the in-kernel Netfilter counters +License: LGPL-2.1+ +Group: Productivity/Networking/Security Url: http://netfilter.org/projects/libnetfilter_acct/ + Source: %name-%version.tar.bz2 Source2: %name-%version.tar.bz2.sig Source3: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake >= 1.6 +BuildRequires: glibc-devel >= 2.9 BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 -%if 0%{?suse_version} >= 1210 || 0%{?fedora_version} >= 15 +%if 0%{?suse_version} >= 1210 || 0%{?fedora_version} BuildRequires: pkgconfig(libmnl) >= 1.0.0 %else BuildRequires: libmnl-devel >= 1.0.0 %endif -Summary: Userspace library for the in-kernel Netfilter counters -License: LGPL-2.1+ -Group: Productivity/Networking/Security %description This library provides the programming interface (API) to the From 2db753567ad71ecc75cba5e8dd44678eef041a974f70c3b327b7dc23c4057583 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 18:03:55 +0000 Subject: [PATCH 5/8] Packaging fixes for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=12 --- libnetfilter_acct.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index 23d46e3..4e44401 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -29,10 +29,8 @@ Source: %name-%version.tar.bz2 Source2: %name-%version.tar.bz2.sig Source3: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: autoconf -BuildRequires: automake >= 1.6 +#git#BuildRequires: autoconf, automake >= 1.6, libtool BuildRequires: glibc-devel >= 2.9 -BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 %if 0%{?suse_version} >= 1210 || 0%{?fedora_version} BuildRequires: pkgconfig(libmnl) >= 1.0.0 From c8bf5d9879c7ea74ab0f0bfae27b16724c1d79db66eb4440165ed574feba8873 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 19 Jul 2012 23:19:15 +0000 Subject: [PATCH 6/8] Require linux-glibc-devel >= 2.6.24 for nfnetlink_compat.h OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=13 --- libnetfilter_acct.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index 4e44401..2b5d740 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -37,6 +37,15 @@ BuildRequires: pkgconfig(libmnl) >= 1.0.0 %else BuildRequires: libmnl-devel >= 1.0.0 %endif +%if 0%{?suse_version} >= 1140 +BuildRequires: linux-glibc-devel >= 2.6.24 +%endif +%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +BuildRequires: linux-kernel-headers >= 2.6.24 +%endif +%if 0%{?redhat_version} || 0%{?centos_version} || 0%{?fedora_version} +BuildRequires: kernel-headers >= 2.6.24 +%endif %description This library provides the programming interface (API) to the From c7524a8957b2fe0f59cc406b31a2cd920c8e40f637f1929b5ac6eaa1e2f0d852 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 8 Oct 2012 23:52:11 +0000 Subject: [PATCH 7/8] libnetfilter_acct-1.0.1 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=14 --- libnetfilter_acct-1.0.0.tar.bz2 | 3 --- libnetfilter_acct-1.0.0.tar.bz2.sig | Bin 543 -> 0 bytes libnetfilter_acct-1.0.1.tar.bz2 | 3 +++ libnetfilter_acct-1.0.1.tar.bz2.sig | Bin 0 -> 543 bytes libnetfilter_acct.changes | 7 +++++++ libnetfilter_acct.spec | 13 +++++-------- 6 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 libnetfilter_acct-1.0.0.tar.bz2 delete mode 100644 libnetfilter_acct-1.0.0.tar.bz2.sig create mode 100644 libnetfilter_acct-1.0.1.tar.bz2 create mode 100644 libnetfilter_acct-1.0.1.tar.bz2.sig diff --git a/libnetfilter_acct-1.0.0.tar.bz2 b/libnetfilter_acct-1.0.0.tar.bz2 deleted file mode 100644 index 9dea65c..0000000 --- a/libnetfilter_acct-1.0.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:567ede1f54fbf2ffd752203ea3aea6f430244fb29bd943af58d1d0f4b1796dc9 -size 282380 diff --git a/libnetfilter_acct-1.0.0.tar.bz2.sig b/libnetfilter_acct-1.0.0.tar.bz2.sig deleted file mode 100644 index ba44915748ee0d04eaa19f5fbd7d2f45f32b744c82a39cfdf5ddba509282c422..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmV+)0^t3L0vrSY0RjL91p-fTj(Y$K2@s?aABnqPSj?t#5C3s@4^M9w3-&`5Gd6*? z!)deaqxJfRvqqQO;9b&f;N;(>7%Fx3GToaQCo91Y>cwOP_b~9ewGk$rZM@lu4`XV> zx&vv}c``L$%-rIfvTV$@IR>fr{LCw6bN0kS_OP35MkYZ4mcvmMgzAyRLnc7?b|NkF zQvI{{3fC}d`g zFBfi4-OsGX^D!#jAJ;*Dbh*%o?aJMb`9KEVC|rp?sB6soMcFZcN4VHy6itDqvXWTA zL~r|%iyPE5!}UFscO_TCW2OdtGz&17xY_EaX&0I{=&u-~RY;*^5aVudXtGmO3+!y` zVlK)GOx(Qso-PrN2z-F-epWi_$!mjKCA^nK3AA^}wir4!g*(_k~K)Lk4go zj@E>X*sHGX8B6D4d=ed-)fe33vW9%b>-YYe9DR~IoF!rx;)FX|m1W$3m2=j*p)&Px z7l@?6f=d$^G(1h8@`8Xv6YDG99cuXyQe}3m*Ug diff --git a/libnetfilter_acct-1.0.1.tar.bz2 b/libnetfilter_acct-1.0.1.tar.bz2 new file mode 100644 index 0000000..f583580 --- /dev/null +++ b/libnetfilter_acct-1.0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1b45331f160467fb5b5d659adeb041c095c18a581d45bee8edd9c4971dc001f +size 288830 diff --git a/libnetfilter_acct-1.0.1.tar.bz2.sig b/libnetfilter_acct-1.0.1.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..29ffd4d6edb17ae81fca7bdc96d6123fdb22e0748b9a1242dd897f892fab9f49 GIT binary patch literal 543 zcmV+)0^t3L0vrSY0RjL91p-iWR=xlV2@s?aABnqPSj_hH5B@lA0@1~si;kUO%O^}@ z?XDv?vpL3;xL;x#O$*NRKdo&=BLJ$ZDQNN_9xnb&pX#boerfuAZqUcsHFu;WUuPg` z2|Rg-hVo7qbsbLak+wx6&XD)8Pa5@j%CgouQ;w|l}D{-k}%6o_?6jzu!>5^^K=k> zRU;td$7ZW2=q8Rf~O)QwrL$JI0O5y{LeHf(w&Aq?qhO+d9R{2jPGk^ zD8;pHF-Sig4S57675F1z@q&q0fLJ!`>&+*mq3O`M{>oNLWq;WyioupvhTYox{t(jA hjQ~M5Jh@93`7Ld|j^Qr6h6me;%&-Am2Q=SFpo^Iv46*= 1.6, libtool @@ -69,12 +71,7 @@ This library provides the programming interface (API) to the Netfilter extended accounting infrastructure. %prep -%if 0%{?__xz:1} %setup -q -%else -tar -xf "%{S:0}" --use=bzip2; -%setup -DTq -%endif %build if [ ! -e configure ]; then From 44bef04511a9e4bca862d2e84a5c331e1ff0208edc51ec3a0fbe3cbd795c8131 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 13 Oct 2012 12:11:14 +0000 Subject: [PATCH 8/8] Make the package compile under RHEL5 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_acct?expand=0&rev=15 --- libnetfilter_acct.spec | 13 +-- rhel5-patch1.diff | 180 +++++++++++++++++++++++++++++++++++++++++ rhel5-patch2.diff | 41 ++++++++++ 3 files changed, 224 insertions(+), 10 deletions(-) create mode 100644 rhel5-patch1.diff create mode 100644 rhel5-patch2.diff diff --git a/libnetfilter_acct.spec b/libnetfilter_acct.spec index 480d355..b1bde57 100644 --- a/libnetfilter_acct.spec +++ b/libnetfilter_acct.spec @@ -30,24 +30,16 @@ Url: http://netfilter.org/projects/libnetfilter_acct/ Source: http://netfilter.org/projects/libnetfilter_acct/files/%name-%version.tar.bz2 Source2: http://netfilter.org/projects/libnetfilter_acct/files/%name-%version.tar.bz2.sig Source3: baselibs.conf +Patch1: rhel5-patch1.diff +Patch2: rhel5-patch2.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build #git#BuildRequires: autoconf, automake >= 1.6, libtool -BuildRequires: glibc-devel >= 2.9 BuildRequires: pkgconfig >= 0.21 %if 0%{?suse_version} >= 1210 || 0%{?fedora_version} BuildRequires: pkgconfig(libmnl) >= 1.0.0 %else BuildRequires: libmnl-devel >= 1.0.0 %endif -%if 0%{?suse_version} >= 1140 -BuildRequires: linux-glibc-devel >= 2.6.24 -%endif -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -BuildRequires: linux-kernel-headers >= 2.6.24 -%endif -%if 0%{?redhat_version} || 0%{?centos_version} || 0%{?fedora_version} -BuildRequires: kernel-headers >= 2.6.24 -%endif %description This library provides the programming interface (API) to the @@ -72,6 +64,7 @@ Netfilter extended accounting infrastructure. %prep %setup -q +%patch -P 1 -P 2 -p1 %build if [ ! -e configure ]; then diff --git a/rhel5-patch1.diff b/rhel5-patch1.diff new file mode 100644 index 0000000..b8882eb --- /dev/null +++ b/rhel5-patch1.diff @@ -0,0 +1,180 @@ +From d4a740659e127f6950ac8c43ef4f6a641594ed89 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Sat, 13 Oct 2012 13:50:53 +0200 +Subject: [PATCH 1/2] build: resolve compile abort on RHEL5 #1 + +[ 24s] In file included from libnetfilter_acct.c:18: +[ 24s] ../include/linux/netfilter/nfnetlink.h:4:46: error: +linux/netfilter/nfnetlink_compat.h: No such file or directory + +Slurp in new headers from the kernel du jour (v3.6-10970-g4d7127d). + +Signed-off-by: Jan Engelhardt +--- + include/linux/netfilter/nfnetlink.h | 50 +++-------------------- + include/linux/netfilter/nfnetlink_acct.h | 15 ++----- + include/linux/netfilter/nfnetlink_compat.h | 61 ++++++++++++++++++++++++++++ + 3 files changed, 70 insertions(+), 56 deletions(-) + create mode 100644 include/linux/netfilter/nfnetlink_compat.h + +diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h +index b64454c..4a4efaf 100644 +--- a/include/linux/netfilter/nfnetlink.h ++++ b/include/linux/netfilter/nfnetlink.h +@@ -1,5 +1,5 @@ +-#ifndef _NFNETLINK_H +-#define _NFNETLINK_H ++#ifndef _UAPI_NFNETLINK_H ++#define _UAPI_NFNETLINK_H + #include + #include + +@@ -49,46 +49,8 @@ struct nfgenmsg { + #define NFNL_SUBSYS_OSF 5 + #define NFNL_SUBSYS_IPSET 6 + #define NFNL_SUBSYS_ACCT 7 +-#define NFNL_SUBSYS_COUNT 8 ++#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 ++#define NFNL_SUBSYS_CTHELPER 9 ++#define NFNL_SUBSYS_COUNT 10 + +-#ifdef __KERNEL__ +- +-#include +-#include +-#include +- +-struct nfnl_callback { +- int (*call)(struct sock *nl, struct sk_buff *skb, +- const struct nlmsghdr *nlh, +- const struct nlattr * const cda[]); +- int (*call_rcu)(struct sock *nl, struct sk_buff *skb, +- const struct nlmsghdr *nlh, +- const struct nlattr * const cda[]); +- const struct nla_policy *policy; /* netlink attribute policy */ +- const u_int16_t attr_count; /* number of nlattr's */ +-}; +- +-struct nfnetlink_subsystem { +- const char *name; +- __u8 subsys_id; /* nfnetlink subsystem ID */ +- __u8 cb_count; /* number of callbacks */ +- const struct nfnl_callback *cb; /* callback for individual types */ +-}; +- +-extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); +-extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); +- +-extern int nfnetlink_has_listeners(struct net *net, unsigned int group); +-extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, +- int echo, gfp_t flags); +-extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); +-extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); +- +-extern void nfnl_lock(void); +-extern void nfnl_unlock(void); +- +-#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ +- MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) +- +-#endif /* __KERNEL__ */ +-#endif /* _NFNETLINK_H */ ++#endif /* _UAPI_NFNETLINK_H */ +diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h +index 7c4279b..c7b6269 100644 +--- a/include/linux/netfilter/nfnetlink_acct.h ++++ b/include/linux/netfilter/nfnetlink_acct.h +@@ -1,5 +1,5 @@ +-#ifndef _NFNL_ACCT_H_ +-#define _NFNL_ACCT_H_ ++#ifndef _UAPI_NFNL_ACCT_H_ ++#define _UAPI_NFNL_ACCT_H_ + + #ifndef NFACCT_NAME_MAX + #define NFACCT_NAME_MAX 32 +@@ -23,14 +23,5 @@ enum nfnl_acct_type { + }; + #define NFACCT_MAX (__NFACCT_MAX - 1) + +-#ifdef __KERNEL__ + +-struct nf_acct; +- +-extern struct nf_acct *nfnl_acct_find_get(const char *filter_name); +-extern void nfnl_acct_put(struct nf_acct *acct); +-extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); +- +-#endif /* __KERNEL__ */ +- +-#endif /* _NFNL_ACCT_H */ ++#endif /* _UAPI_NFNL_ACCT_H_ */ +diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h +new file mode 100644 +index 0000000..74b9e55 +--- /dev/null ++++ b/include/linux/netfilter/nfnetlink_compat.h +@@ -0,0 +1,61 @@ ++#ifndef _NFNETLINK_COMPAT_H ++#define _NFNETLINK_COMPAT_H ++ ++#include ++ ++/* Old nfnetlink macros for userspace */ ++ ++/* nfnetlink groups: Up to 32 maximum */ ++#define NF_NETLINK_CONNTRACK_NEW 0x00000001 ++#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002 ++#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004 ++#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008 ++#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010 ++#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020 ++ ++/* Generic structure for encapsulation optional netfilter information. ++ * It is reminiscent of sockaddr, but with sa_family replaced ++ * with attribute type. ++ * ! This should someday be put somewhere generic as now rtnetlink and ++ * ! nfnetlink use the same attributes methods. - J. Schulist. ++ */ ++ ++struct nfattr { ++ __u16 nfa_len; ++ __u16 nfa_type; /* we use 15 bits for the type, and the highest ++ * bit to indicate whether the payload is nested */ ++}; ++ ++/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from ++ * rtnetlink.h, it's time to put this in a generic file */ ++ ++#define NFNL_NFA_NEST 0x8000 ++#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff) ++ ++#define NFA_ALIGNTO 4 ++#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) ++#define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) \ ++ && (nfa)->nfa_len <= (len)) ++#define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len), \ ++ (struct nfattr *)(((char *)(nfa)) + NFA_ALIGN((nfa)->nfa_len))) ++#define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len)) ++#define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len)) ++#define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0))) ++#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) ++#define NFA_NEST(skb, type) \ ++({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \ ++ NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ ++ __start; }) ++#define NFA_NEST_END(skb, start) \ ++({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ ++ (skb)->len; }) ++#define NFA_NEST_CANCEL(skb, start) \ ++({ if (start) \ ++ skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ ++ -1; }) ++ ++#define NFM_NFA(n) ((struct nfattr *)(((char *)(n)) \ ++ + NLMSG_ALIGN(sizeof(struct nfgenmsg)))) ++#define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg)) ++ ++#endif /* _NFNETLINK_COMPAT_H */ +-- +1.7.10.4 + diff --git a/rhel5-patch2.diff b/rhel5-patch2.diff new file mode 100644 index 0000000..4415840 --- /dev/null +++ b/rhel5-patch2.diff @@ -0,0 +1,41 @@ +From e01126788f5d1eb4b2b1bc3de72a419a18a5ba7e Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Sat, 13 Oct 2012 14:05:47 +0200 +Subject: [PATCH 2/2] build: resolve compile abort on RHEL5 #2 + +libnetfilter_acct.c: In function 'nfacct_nlmsg_build_payload': +libnetfilter_acct.c:422: warning: implicit declaration of function +'htobe64' +libnetfilter_acct.c: In function 'nfacct_nlmsg_parse_payload': +libnetfilter_acct.c:477: warning: implicit declaration of function +'be64toh' + +Signed-off-by: Jan Engelhardt +--- + src/internal.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/internal.h b/src/internal.h +index 3a88d1a..2106401 100644 +--- a/src/internal.h ++++ b/src/internal.h +@@ -9,4 +9,16 @@ + # define EXPORT_SYMBOL + #endif + ++#include ++#if !defined(htobe64) ++# include ++# if __BYTE_ORDER == __LITTLE_ENDIAN ++# define htobe64(x) __bswap_64(x) ++# define betoh64(x) __bswap_64(x) ++# else ++# define htobe64(x) (x) ++# define betoh64(x) (x) ++# endif ++#endif ++ + #endif +-- +1.7.10.4 +