diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2012-08-31 09:57:37 +0530 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-11-05 11:48:03 -0800 |
commit | 8d597fa3ea071b86ffb3245d43736a7cfc3a2ad5 (patch) | |
tree | c63030a860239ed1786909e6d73e7467bf8a3bd5 | |
parent | 5b4d0e16a74f94ec12f86acc0ed4811bd4623136 (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>
Signed-off-by: John Stultz <john.stultz@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, |