diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2012-08-31 09:42:51 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2012-08-31 09:44:44 +0530 |
commit | 958fa0b5c0fb3510b00b8ce3f344b1455f5639c5 (patch) | |
tree | 3928f59192b05c006f4b12c05270a40995b34528 | |
parent | 264459b53b152152fd2b8aa922d88177d683e78c (diff) |
netfilter: xt_quota2: Move away from NLMSG_PUT()
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>
-rw-r--r-- | 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 fb2ef46b2b84..865f9094d0eb 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, |