]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/nf_nat_proto_gre.c
x86: unification of cfufreq/Kconfig
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / nf_nat_proto_gre.c
index c3908bc5a709dbae3d211d58565ddc5649947dc5..b820f996035673ecb5da8262cba2a56838f2675d 100644 (file)
@@ -36,13 +36,6 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
 MODULE_DESCRIPTION("Netfilter NAT protocol helper module for GRE");
 
-#if 0
-#define DEBUGP(format, args...) printk(KERN_DEBUG "%s:%s: " format, __FILE__, \
-                                      __FUNCTION__, ## args)
-#else
-#define DEBUGP(x, args...)
-#endif
-
 /* is key in given range between min and max */
 static int
 gre_in_range(const struct nf_conntrack_tuple *tuple,
@@ -83,7 +76,7 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
                keyptr = &tuple->dst.u.gre.key;
 
        if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED)) {
-               DEBUGP("%p: NATing GRE PPTP\n", conntrack);
+               pr_debug("%p: NATing GRE PPTP\n", conntrack);
                min = 1;
                range_size = 0xffff;
        } else {
@@ -91,7 +84,7 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
                range_size = ntohs(range->max.gre.key) - min + 1;
        }
 
-       DEBUGP("min = %u, range_size = %u\n", min, range_size);
+       pr_debug("min = %u, range_size = %u\n", min, range_size);
 
        for (i = 0; i < range_size; i++, key++) {
                *keyptr = htons(min + key % range_size);
@@ -99,27 +92,27 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
                        return 1;
        }
 
-       DEBUGP("%p: no NAT mapping\n", conntrack);
+       pr_debug("%p: no NAT mapping\n", conntrack);
        return 0;
 }
 
 /* manipulate a GRE packet according to maniptype */
 static int
-gre_manip_pkt(struct sk_buff **pskb, unsigned int iphdroff,
+gre_manip_pkt(struct sk_buff *skb, unsigned int iphdroff,
              const struct nf_conntrack_tuple *tuple,
              enum nf_nat_manip_type maniptype)
 {
        struct gre_hdr *greh;
        struct gre_hdr_pptp *pgreh;
-       struct iphdr *iph = (struct iphdr *)((*pskb)->data + iphdroff);
+       struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff);
        unsigned int hdroff = iphdroff + iph->ihl * 4;
 
        /* pgreh includes two optional 32bit fields which are not required
         * to be there.  That's where the magic '8' comes from */
-       if (!skb_make_writable(pskb, hdroff + sizeof(*pgreh) - 8))
+       if (!skb_make_writable(skb, hdroff + sizeof(*pgreh) - 8))
                return 0;
 
-       greh = (void *)(*pskb)->data + hdroff;
+       greh = (void *)skb->data + hdroff;
        pgreh = (struct gre_hdr_pptp *)greh;
 
        /* we only have destination manip of a packet, since 'source key'
@@ -132,11 +125,11 @@ gre_manip_pkt(struct sk_buff **pskb, unsigned int iphdroff,
                 * Try to behave like "nf_nat_proto_unknown" */
                break;
        case GRE_VERSION_PPTP:
-               DEBUGP("call_id -> 0x%04x\n", ntohs(tuple->dst.u.gre.key));
+               pr_debug("call_id -> 0x%04x\n", ntohs(tuple->dst.u.gre.key));
                pgreh->call_id = tuple->dst.u.gre.key;
                break;
        default:
-               DEBUGP("can't nat unknown GRE version\n");
+               pr_debug("can't nat unknown GRE version\n");
                return 0;
        }
        return 1;
@@ -149,8 +142,8 @@ static struct nf_nat_protocol gre __read_mostly = {
        .in_range               = gre_in_range,
        .unique_tuple           = gre_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nfattr        = nf_nat_port_range_to_nfattr,
-       .nfattr_to_range        = nf_nat_port_nfattr_to_range,
+       .range_to_nlattr        = nf_nat_port_range_to_nlattr,
+       .nlattr_to_range        = nf_nat_port_nlattr_to_range,
 #endif
 };