Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[deliverable/linux.git] / net / netfilter / ipset / ip_set_hash_ip.c
index 828ce46cb34b9ad6eb90a8363461e6f1e24c9344..a68dbd4f1e4e4404d25d6b71e321122fd4fae66a 100644 (file)
@@ -81,7 +81,8 @@ hash_ip4_data_zero_out(struct hash_ip4_elem *elem)
 static inline bool
 hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *data)
 {
-       NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
+       if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
@@ -94,9 +95,10 @@ hash_ip4_data_tlist(struct sk_buff *skb, const struct hash_ip4_elem *data)
        const struct hash_ip4_telem *tdata =
                (const struct hash_ip4_telem *)data;
 
-       NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
-       NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
-                     htonl(ip_set_timeout_get(tdata->timeout)));
+       if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
+           nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
+                         htonl(ip_set_timeout_get(tdata->timeout))))
+               goto nla_put_failure;
 
        return 0;
 
@@ -262,7 +264,8 @@ ip6_netmask(union nf_inet_addr *ip, u8 prefix)
 static bool
 hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *data)
 {
-       NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
+       if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
@@ -275,9 +278,10 @@ hash_ip6_data_tlist(struct sk_buff *skb, const struct hash_ip6_elem *data)
        const struct hash_ip6_telem *e =
                (const struct hash_ip6_telem *)data;
 
-       NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
-       NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
-                     htonl(ip_set_timeout_get(e->timeout)));
+       if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
+           nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
+                         htonl(ip_set_timeout_get(e->timeout))))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
This page took 0.037358 seconds and 5 git commands to generate.