]>
Commit | Line | Data |
---|---|---|
a62cbe33 JR |
1 | diff --git a/configure.ac b/configure.ac |
2 | index 7156ab8..b73b3cc 100644 | |
3 | --- a/configure.ac | |
4 | +++ b/configure.ac | |
5 | @@ -250,6 +250,16 @@ else | |
6 | AC_SUBST(HAVE_NLA_PUT_BE64, undef) | |
7 | fi | |
8 | ||
9 | +AC_MSG_CHECKING([kernel source for nla_put_64bit]) | |
10 | +if test -f $ksourcedir/include/net/netlink.h && \ | |
11 | + $GREP -q 'nla_put_64bit' $ksourcedir/include/net/netlink.h; then | |
12 | + AC_MSG_RESULT(yes) | |
13 | + AC_SUBST(HAVE_NLA_PUT_64BIT, define) | |
14 | +else | |
15 | + AC_MSG_RESULT(no) | |
16 | + AC_SUBST(HAVE_NLA_PUT_64BIT, undef) | |
17 | +fi | |
18 | + | |
19 | AC_MSG_CHECKING([kernel source for portid in nl_info]) | |
20 | if test -f $ksourcedir/include/linux/netlink.h && \ | |
21 | $AWK '/^struct netlink_skb_parms/ {for(i=1; i<=5; i++) {getline; print}}' $ksourcedir/include/linux/netlink.h | $GREP -q 'portid;'; then | |
22 | diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | |
23 | index 15d0763..fe24255 100644 | |
24 | --- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | |
25 | +++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | |
26 | @@ -10,6 +10,7 @@ | |
27 | #@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL | |
28 | #@HAVE_NLA_PUT_BE16@ HAVE_NLA_PUT_BE16 | |
29 | #@HAVE_NLA_PUT_BE64@ HAVE_NLA_PUT_BE64 | |
30 | +#@HAVE_NLA_PUT_64BIT@ HAVE_NLA_PUT_64BIT | |
31 | #@HAVE_NL_INFO_PORTID@ HAVE_NL_INFO_PORTID | |
32 | #define HAVE_NETLINK_DUMP_START_ARGS @HAVE_NETLINK_DUMP_START_ARGS@ | |
33 | #@HAVE_NS_CAPABLE@ HAVE_NS_CAPABLE | |
34 | @@ -160,6 +161,12 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) | |
35 | } | |
36 | #endif | |
37 | ||
38 | +#ifdef HAVE_NLA_PUT_64BIT | |
39 | +#define IPSET_NLA_PUT_NET64(skb, t, v, pa) nla_put_be64(skb, t, v, pa) | |
40 | +#else | |
41 | +#define IPSET_NLA_PUT_NET64(skb, t, v, pa) nla_put_be64(skb, t, v) | |
42 | +#endif | |
43 | + | |
44 | #ifdef HAVE_NL_INFO_PORTID | |
45 | #define NETLINK_PORTID(skb) NETLINK_CB(skb).portid | |
46 | #else | |
47 | diff --git a/kernel/include/linux/netfilter/ipset/ip_set_counter.h b/kernel/include/linux/netfilter/ipset/ip_set_counter.h | |
48 | index d61e0e5..f2f1e8f 100644 | |
49 | --- a/kernel/include/linux/netfilter/ipset/ip_set_counter.h | |
50 | +++ b/kernel/include/linux/netfilter/ipset/ip_set_counter.h | |
51 | @@ -53,10 +53,12 @@ ip_set_update_counter(struct ip_set_counter *counter, | |
52 | static inline bool | |
53 | ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter) | |
54 | { | |
55 | - return nla_put_net64(skb, IPSET_ATTR_BYTES, | |
56 | - cpu_to_be64(ip_set_get_bytes(counter))) || | |
57 | - nla_put_net64(skb, IPSET_ATTR_PACKETS, | |
58 | - cpu_to_be64(ip_set_get_packets(counter))); | |
59 | + return IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_BYTES, | |
60 | + cpu_to_be64(ip_set_get_bytes(counter)), | |
61 | + IPSET_ATTR_PAD) || | |
62 | + IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_PACKETS, | |
63 | + cpu_to_be64(ip_set_get_packets(counter)), | |
64 | + IPSET_ATTR_PAD); | |
65 | } | |
66 | ||
67 | static inline void | |
68 | diff --git a/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h b/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h | |
69 | index b03dd6a..c6df3a1 100644 | |
70 | --- a/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h | |
71 | +++ b/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h | |
72 | @@ -23,9 +23,10 @@ ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo) | |
73 | { | |
74 | /* Send nonzero parameters only */ | |
75 | return ((skbinfo->skbmark || skbinfo->skbmarkmask) && | |
76 | - nla_put_net64(skb, IPSET_ATTR_SKBMARK, | |
77 | - cpu_to_be64((u64)skbinfo->skbmark << 32 | | |
78 | - skbinfo->skbmarkmask))) || | |
79 | + IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_SKBMARK, | |
80 | + cpu_to_be64((u64)skbinfo->skbmark << 32 | | |
81 | + skbinfo->skbmarkmask), | |
82 | + IPSET_ATTR_PAD)) || | |
83 | (skbinfo->skbprio && | |
84 | nla_put_net32(skb, IPSET_ATTR_SKBPRIO, | |
85 | cpu_to_be32(skbinfo->skbprio))) || | |
86 | diff --git a/kernel/include/uapi/linux/netfilter/ipset/ip_set.h b/kernel/include/uapi/linux/netfilter/ipset/ip_set.h | |
87 | index def91b9..4a6776f 100644 | |
88 | --- a/kernel/include/uapi/linux/netfilter/ipset/ip_set.h | |
89 | +++ b/kernel/include/uapi/linux/netfilter/ipset/ip_set.h | |
90 | @@ -118,6 +118,7 @@ enum { | |
91 | IPSET_ATTR_SKBMARK, | |
92 | IPSET_ATTR_SKBPRIO, | |
93 | IPSET_ATTR_SKBQUEUE, | |
94 | + IPSET_ATTR_PAD, | |
95 | __IPSET_ATTR_ADT_MAX, | |
96 | }; | |
97 | #define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) |