]> err.no Git - linux-2.6/blobdiff - net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
the scheduled ieee80211 softmac removal
[linux-2.6] / net / ipv6 / netfilter / nf_conntrack_proto_icmpv6.c
index 44689d4444104849774cb0ea2c4cb76b34b4d8dc..0897d0f4c4a2d19dfec220d2b6855627526d65b3 100644 (file)
@@ -24,6 +24,7 @@
 #include <net/netfilter/nf_conntrack_l4proto.h>
 #include <net/netfilter/nf_conntrack_core.h>
 #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h>
+#include <net/netfilter/nf_log.h>
 
 static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
 
@@ -31,7 +32,8 @@ static int icmpv6_pkt_to_tuple(const struct sk_buff *skb,
                               unsigned int dataoff,
                               struct nf_conntrack_tuple *tuple)
 {
-       struct icmp6hdr _hdr, *hp;
+       const struct icmp6hdr *hp;
+       struct icmp6hdr _hdr;
 
        hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
        if (hp == NULL)
@@ -44,7 +46,7 @@ static int icmpv6_pkt_to_tuple(const struct sk_buff *skb,
 }
 
 /* Add 1; spaces filled with 0. */
-static u_int8_t invmap[] = {
+static const u_int8_t invmap[] = {
        [ICMPV6_ECHO_REQUEST - 128]     = ICMPV6_ECHO_REPLY + 1,
        [ICMPV6_ECHO_REPLY - 128]       = ICMPV6_ECHO_REQUEST + 1,
        [ICMPV6_NI_QUERY - 128]         = ICMPV6_NI_QUERY + 1,
@@ -74,13 +76,6 @@ static int icmpv6_print_tuple(struct seq_file *s,
                          ntohs(tuple->src.u.icmp.id));
 }
 
-/* Print out the private part of the conntrack. */
-static int icmpv6_print_conntrack(struct seq_file *s,
-                                 const struct nf_conn *conntrack)
-{
-       return 0;
-}
-
 /* Returns verdict for packet, or -1 for invalid. */
 static int icmpv6_packet(struct nf_conn *ct,
                       const struct sk_buff *skb,
@@ -107,24 +102,24 @@ static int icmpv6_packet(struct nf_conn *ct,
 }
 
 /* Called when a new connection for this protocol found. */
-static int icmpv6_new(struct nf_conn *conntrack,
+static int icmpv6_new(struct nf_conn *ct,
                      const struct sk_buff *skb,
                      unsigned int dataoff)
 {
-       static u_int8_t valid_new[] = {
+       static const u_int8_t valid_new[] = {
                [ICMPV6_ECHO_REQUEST - 128] = 1,
                [ICMPV6_NI_QUERY - 128] = 1
        };
-       int type = conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128;
+       int type = ct->tuplehash[0].tuple.dst.u.icmp.type - 128;
 
        if (type < 0 || type >= sizeof(valid_new) || !valid_new[type]) {
                /* Can't create a new ICMPv6 `conn' with this. */
                pr_debug("icmpv6: can't create new conn with type %u\n",
                         type + 128);
-               NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple);
+               NF_CT_DUMP_TUPLE(&ct->tuplehash[0].tuple);
                return 0;
        }
-       atomic_set(&conntrack->proto.icmp.count, 0);
+       atomic_set(&ct->proto.icmp.count, 0);
        return 1;
 }
 
@@ -135,8 +130,8 @@ icmpv6_error_message(struct sk_buff *skb,
                     unsigned int hooknum)
 {
        struct nf_conntrack_tuple intuple, origtuple;
-       struct nf_conntrack_tuple_hash *h;
-       struct nf_conntrack_l4proto *inproto;
+       const struct nf_conntrack_tuple_hash *h;
+       const struct nf_conntrack_l4proto *inproto;
 
        NF_CT_ASSERT(skb->nfct == NULL);
 
@@ -182,7 +177,8 @@ static int
 icmpv6_error(struct sk_buff *skb, unsigned int dataoff,
             enum ip_conntrack_info *ctinfo, int pf, unsigned int hooknum)
 {
-       struct icmp6hdr _ih, *icmp6h;
+       const struct icmp6hdr *icmp6h;
+       struct icmp6hdr _ih;
 
        icmp6h = skb_header_pointer(skb, dataoff, sizeof(_ih), &_ih);
        if (icmp6h == NULL) {
@@ -274,7 +270,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly =
        .pkt_to_tuple           = icmpv6_pkt_to_tuple,
        .invert_tuple           = icmpv6_invert_tuple,
        .print_tuple            = icmpv6_print_tuple,
-       .print_conntrack        = icmpv6_print_conntrack,
        .packet                 = icmpv6_packet,
        .new                    = icmpv6_new,
        .error                  = icmpv6_error,