]> err.no Git - linux-2.6/blobdiff - net/ipv4/netfilter/nf_nat_snmp_basic.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
[linux-2.6] / net / ipv4 / netfilter / nf_nat_snmp_basic.c
index ce5c4939a6ee240d764e3e593429dae1523edb8a..6bfcd3a90f08d2d60fe76e32dd6173c36c614f2b 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  * Author: James Morris <jmorris@intercode.com.au>
- *
- * Updates:
- * 2000-08-06: Convert to new helper API (Harald Welte).
- *
  */
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -1194,7 +1190,7 @@ static int snmp_translate(struct nf_conn *ct,
                          enum ip_conntrack_info ctinfo,
                          struct sk_buff **pskb)
 {
-       struct iphdr *iph = (*pskb)->nh.iph;
+       struct iphdr *iph = ip_hdr(*pskb);
        struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl);
        u_int16_t udplen = ntohs(udph->len);
        u_int16_t paylen = udplen - sizeof(struct udphdr);
@@ -1235,7 +1231,7 @@ static int help(struct sk_buff **pskb, unsigned int protoff,
 {
        int dir = CTINFO2DIR(ctinfo);
        unsigned int ret;
-       struct iphdr *iph = (*pskb)->nh.iph;
+       struct iphdr *iph = ip_hdr(*pskb);
        struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);
 
        /* SNMP replies and originating SNMP traps get mangled */
@@ -1280,9 +1276,6 @@ static struct nf_conntrack_helper snmp_helper __read_mostly = {
        .tuple.src.l3num        = AF_INET,
        .tuple.src.u.udp.port   = __constant_htons(SNMP_PORT),
        .tuple.dst.protonum     = IPPROTO_UDP,
-       .mask.src.l3num         = 0xFFFF,
-       .mask.src.u.udp.port    = __constant_htons(0xFFFF),
-       .mask.dst.protonum      = 0xFF,
 };
 
 static struct nf_conntrack_helper snmp_trap_helper __read_mostly = {
@@ -1294,9 +1287,6 @@ static struct nf_conntrack_helper snmp_trap_helper __read_mostly = {
        .tuple.src.l3num        = AF_INET,
        .tuple.src.u.udp.port   = __constant_htons(SNMP_TRAP_PORT),
        .tuple.dst.protonum     = IPPROTO_UDP,
-       .mask.src.l3num         = 0xFFFF,
-       .mask.src.u.udp.port    = __constant_htons(0xFFFF),
-       .mask.dst.protonum      = 0xFF,
 };
 
 /*****************************************************************************