Required for android-3.6 tree.
Tushar Behera (2): netfilter: xt_quota2: Move away from NLMSG_PUT() netfilter: xt_quota2: Update parameter list in netlink_kernel_create
net/netfilter/xt_quota2.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
Commit c3deafc5261a ("netlink: Delete NLMSG_PUT and NLMSG_NEW.") removes NLMSG_PUT() and recommends use of nlmsg_put() instead.
Signed-off-by: Tushar Behera tushar.behera@linaro.org --- net/netfilter/xt_quota2.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/net/netfilter/xt_quota2.c b/net/netfilter/xt_quota2.c index fb2ef46..865f909 100644 --- a/net/netfilter/xt_quota2.c +++ b/net/netfilter/xt_quota2.c @@ -24,6 +24,8 @@ #include <linux/netfilter_ipv4/ipt_ULOG.h> #endif
+#include <net/netlink.h> + /** * @lock: lock to protect quota writers from each other */ @@ -82,9 +84,15 @@ static void quota2_log(unsigned int hooknum, }
/* NLMSG_PUT() uses "goto nlmsg_failure" */ - nlh = NLMSG_PUT(log_skb, /*pid*/0, /*seq*/0, qlog_nl_event, - sizeof(*pm)); - pm = NLMSG_DATA(nlh); + nlh = nlmsg_put(log_skb, /*pid*/0, /*seq*/0, qlog_nl_event, + sizeof(*pm), 0); + + if (!nlh) { + pr_debug("xt_quota2: error during NLMSG_PUT\n"); + return; + } + + pm = nlmsg_data(nlh); if (skb->tstamp.tv64 == 0) __net_timestamp((struct sk_buff *)skb); pm->data_len = 0; @@ -106,9 +114,6 @@ static void quota2_log(unsigned int hooknum, NETLINK_CB(log_skb).dst_group = 1; pr_debug("throwing 1 packets to netlink group 1\n"); netlink_broadcast(nflognl, log_skb, 0, 1, GFP_ATOMIC); - -nlmsg_failure: /* Used within NLMSG_PUT() */ - pr_debug("xt_quota2: error during NLMSG_PUT\n"); } #else static void quota2_log(unsigned int hooknum,
Commit a31f2d17b331 ("netlink: add netlink_kernel_cfg parameter to netlink_kernel_create") modifies parameter list of netlink_kernel_create.
Signed-off-by: Tushar Behera tushar.behera@linaro.org --- net/netfilter/xt_quota2.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/xt_quota2.c b/net/netfilter/xt_quota2.c index 865f909..3a9c1f9 100644 --- a/net/netfilter/xt_quota2.c +++ b/net/netfilter/xt_quota2.c @@ -350,12 +350,14 @@ static struct xt_match quota_mt2_reg[] __read_mostly = { static int __init quota_mt2_init(void) { int ret; + struct netlink_kernel_cfg cfg = { + .groups = 1, + }; pr_debug("xt_quota2: init()");
#ifdef CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG - nflognl = netlink_kernel_create(&init_net, - NETLINK_NFLOG, 1, NULL, - NULL, THIS_MODULE); + nflognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, + THIS_MODULE, &cfg); if (!nflognl) return -ENOMEM; #endif
Ping !!!
On 08/31/2012 09:57 AM, Tushar Behera wrote:
Required for android-3.6 tree.
Tushar Behera (2): netfilter: xt_quota2: Move away from NLMSG_PUT() netfilter: xt_quota2: Update parameter list in netlink_kernel_create
net/netfilter/xt_quota2.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
Without these patches, build of LT kernel based on llct(v3.6-rc5) fails with following error message.
net/netfilter/xt_quota2.c: In function ‘quota2_log’: net/netfilter/xt_quota2.c:85:2: error: implicit declaration of function ‘NLMSG_PUT’ [-Werror=implicit-function-declaration] net/netfilter/xt_quota2.c:85:6: warning: assignment makes pointer from integer without a cast [enabled by default] net/netfilter/xt_quota2.c:110:1: warning: label ‘nlmsg_failure’ defined but not used [-Wunused-label] net/netfilter/xt_quota2.c: In function ‘quota_mt2_init’: net/netfilter/xt_quota2.c:353:12: warning: passing argument 3 of ‘netlink_kernel_create’ makes pointer from integer without a cast [enabled by default] In file included from include/linux/if_link.h:5:0, from include/linux/netdevice.h:31, from include/linux/netfilter/x_tables.h:188, from net/netfilter/xt_quota2.c:21: include/linux/netlink.h:185:21: note: expected ‘struct module *’ but argument is of type ‘int’ net/netfilter/xt_quota2.c:353:12: error: too many arguments to function ‘netlink_kernel_create’ In file included from include/linux/if_link.h:5:0, from include/linux/netdevice.h:31, from include/linux/netfilter/x_tables.h:188, from net/netfilter/xt_quota2.c:21: include/linux/netlink.h:185:21: note: declared here
On Tue, Sep 11, 2012 at 2:22 AM, Tushar Behera tushar.behera@linaro.org wrote:
Ping !!!
Can we get them at least included at linux-linaro's android topic?
Thanks,
Ricardo
On 08/31/2012 09:57 AM, Tushar Behera wrote:
Required for android-3.6 tree.
Tushar Behera (2): netfilter: xt_quota2: Move away from NLMSG_PUT() netfilter: xt_quota2: Update parameter list in netlink_kernel_create
net/netfilter/xt_quota2.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
Without these patches, build of LT kernel based on llct(v3.6-rc5) fails with following error message.
net/netfilter/xt_quota2.c: In function ‘quota2_log’: net/netfilter/xt_quota2.c:85:2: error: implicit declaration of function ‘NLMSG_PUT’ [-Werror=implicit-function-declaration] net/netfilter/xt_quota2.c:85:6: warning: assignment makes pointer from integer without a cast [enabled by default] net/netfilter/xt_quota2.c:110:1: warning: label ‘nlmsg_failure’ defined but not used [-Wunused-label] net/netfilter/xt_quota2.c: In function ‘quota_mt2_init’: net/netfilter/xt_quota2.c:353:12: warning: passing argument 3 of ‘netlink_kernel_create’ makes pointer from integer without a cast [enabled by default] In file included from include/linux/if_link.h:5:0, from include/linux/netdevice.h:31, from include/linux/netfilter/x_tables.h:188, from net/netfilter/xt_quota2.c:21: include/linux/netlink.h:185:21: note: expected ‘struct module *’ but argument is of type ‘int’ net/netfilter/xt_quota2.c:353:12: error: too many arguments to function ‘netlink_kernel_create’ In file included from include/linux/if_link.h:5:0, from include/linux/netdevice.h:31, from include/linux/netfilter/x_tables.h:188, from net/netfilter/xt_quota2.c:21: include/linux/netlink.h:185:21: note: declared here
-- Tushar Behera
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
On 09/10/2012 10:22 PM, Tushar Behera wrote:
Ping !!!
On 08/31/2012 09:57 AM, Tushar Behera wrote:
Required for android-3.6 tree.
Tushar Behera (2): netfilter: xt_quota2: Move away from NLMSG_PUT() netfilter: xt_quota2: Update parameter list in netlink_kernel_create
net/netfilter/xt_quota2.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
Without these patches, build of LT kernel based on llct(v3.6-rc5) fails with following error message.
Thanks for the reminder, the patches landed in my mailbox during Linux Plumbers, and got buried under a number of other items. So my apologies. I've applied them and pushed them out to the linaro-android-3.6-jstultz-rebase branch.
thanks -john
On 09/11/2012 10:19 AM, John Stultz wrote:
On 09/10/2012 10:22 PM, Tushar Behera wrote:
Ping !!!
On 08/31/2012 09:57 AM, Tushar Behera wrote:
Required for android-3.6 tree.
Tushar Behera (2): netfilter: xt_quota2: Move away from NLMSG_PUT() netfilter: xt_quota2: Update parameter list in netlink_kernel_create
net/netfilter/xt_quota2.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
Without these patches, build of LT kernel based on llct(v3.6-rc5) fails with following error message.
Thanks for the reminder, the patches landed in my mailbox during Linux Plumbers, and got buried under a number of other items. So my apologies. I've applied them and pushed them out to the linaro-android-3.6-jstultz-rebase branch.
Merged into the linux-linaro-core-tracking branch, the llct-20120911.0 tag.
Thanks, Andrey
thanks -john
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev