]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/nf_nat_proto_icmp.c
Merge branch 'linus' into core/rcu
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / nf_nat_proto_icmp.c
index 03a02969aa5710fde9a897a2d913396b17b94bee..19a8b0b07d8e7d80620446939e80aa3966c84ace 100644 (file)
@@ -17,7 +17,7 @@
 #include <net/netfilter/nf_nat_rule.h>
 #include <net/netfilter/nf_nat_protocol.h>
 
-static int
+static bool
 icmp_in_range(const struct nf_conntrack_tuple *tuple,
              enum nf_nat_manip_type maniptype,
              const union nf_conntrack_man_proto *min,
@@ -27,7 +27,7 @@ icmp_in_range(const struct nf_conntrack_tuple *tuple,
               ntohs(tuple->src.u.icmp.id) <= ntohs(max->icmp.id);
 }
 
-static int
+static bool
 icmp_unique_tuple(struct nf_conntrack_tuple *tuple,
                  const struct nf_nat_range *range,
                  enum nf_nat_manip_type maniptype,
@@ -46,12 +46,12 @@ icmp_unique_tuple(struct nf_conntrack_tuple *tuple,
                tuple->src.u.icmp.id = htons(ntohs(range->min.icmp.id) +
                                             (id % range_size));
                if (!nf_nat_used_tuple(tuple, ct))
-                       return 1;
+                       return true;
        }
-       return 0;
+       return false;
 }
 
-static int
+static bool
 icmp_manip_pkt(struct sk_buff *skb,
               unsigned int iphdroff,
               const struct nf_conntrack_tuple *tuple,
@@ -62,24 +62,23 @@ icmp_manip_pkt(struct sk_buff *skb,
        unsigned int hdroff = iphdroff + iph->ihl*4;
 
        if (!skb_make_writable(skb, hdroff + sizeof(*hdr)))
-               return 0;
+               return false;
 
        hdr = (struct icmphdr *)(skb->data + hdroff);
        inet_proto_csum_replace2(&hdr->checksum, skb,
                                 hdr->un.echo.id, tuple->src.u.icmp.id, 0);
        hdr->un.echo.id = tuple->src.u.icmp.id;
-       return 1;
+       return true;
 }
 
 const struct nf_nat_protocol nf_nat_protocol_icmp = {
-       .name                   = "ICMP",
        .protonum               = IPPROTO_ICMP,
        .me                     = THIS_MODULE,
        .manip_pkt              = icmp_manip_pkt,
        .in_range               = icmp_in_range,
        .unique_tuple           = icmp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_port_range_to_nlattr,
-       .nlattr_to_range        = nf_nat_port_nlattr_to_range,
+       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
+       .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };