diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-02-12 23:57:21 -0600 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-02-12 23:57:21 -0600 |
commit | 54c66f6d781e03dc0b23956234963c4911e6d1c0 (patch) | |
tree | 40619a66ae6d8703a57bf681d087ffeabbffd346 /net/ipv4/netfilter/ip_nat_helper.c | |
parent | 8ce0a7df6e6117d8814e976d4b7ce6a6b2c9cf93 (diff) | |
parent | 17e0e27020d028a790d97699aff85a43af5be472 (diff) |
Merge branch 'master' into 85xx
Diffstat (limited to 'net/ipv4/netfilter/ip_nat_helper.c')
-rw-r--r-- | net/ipv4/netfilter/ip_nat_helper.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c index ee80feb4b2a..dc778cfef58 100644 --- a/net/ipv4/netfilter/ip_nat_helper.c +++ b/net/ipv4/netfilter/ip_nat_helper.c @@ -1,4 +1,4 @@ -/* ip_nat_helper.c - generic support functions for NAT helpers +/* ip_nat_helper.c - generic support functions for NAT helpers * * (C) 2000-2002 Harald Welte <laforge@netfilter.org> * (C) 2003-2004 Netfilter Core Team <coreteam@netfilter.org> @@ -8,7 +8,7 @@ * published by the Free Software Foundation. * * 14 Jan 2002 Harald Welte <laforge@gnumonks.org>: - * - add support for SACK adjustment + * - add support for SACK adjustment * 14 Mar 2002 Harald Welte <laforge@gnumonks.org>: * - merge SACK support into newnat API * 16 Aug 2002 Brian J. Murrell <netfilter@interlinx.bc.ca>: @@ -45,10 +45,10 @@ static DEFINE_SPINLOCK(ip_nat_seqofs_lock); /* Setup TCP sequence correction given this change at this sequence */ -static inline void +static inline void adjust_tcp_sequence(u32 seq, int sizediff, - struct ip_conntrack *ct, + struct ip_conntrack *ct, enum ip_conntrack_info ctinfo) { int dir; @@ -150,7 +150,7 @@ static int enlarge_skb(struct sk_buff **pskb, unsigned int extra) * skb enlargement, ... * * */ -int +int ip_nat_mangle_tcp_packet(struct sk_buff **pskb, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo, @@ -183,10 +183,10 @@ ip_nat_mangle_tcp_packet(struct sk_buff **pskb, datalen = (*pskb)->len - iph->ihl*4; if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { tcph->check = 0; - tcph->check = tcp_v4_check(tcph, datalen, + tcph->check = tcp_v4_check(datalen, iph->saddr, iph->daddr, csum_partial((char *)tcph, - datalen, 0)); + datalen, 0)); } else nf_proto_csum_replace2(&tcph->check, *pskb, htons(oldlen), htons(datalen), 1); @@ -202,7 +202,7 @@ ip_nat_mangle_tcp_packet(struct sk_buff **pskb, return 1; } EXPORT_SYMBOL(ip_nat_mangle_tcp_packet); - + /* Generic function for mangling variable-length address changes inside * NATed UDP connections (like the CONNECT DATA XXXXX MESG XXXXX INDEX XXXXX * command in the Amanda protocol) @@ -213,7 +213,7 @@ EXPORT_SYMBOL(ip_nat_mangle_tcp_packet); * XXX - This function could be merged with ip_nat_mangle_tcp_packet which * should be fairly easy to do. */ -int +int ip_nat_mangle_udp_packet(struct sk_buff **pskb, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo, @@ -228,8 +228,8 @@ ip_nat_mangle_udp_packet(struct sk_buff **pskb, /* UDP helpers might accidentally mangle the wrong packet */ iph = (*pskb)->nh.iph; - if ((*pskb)->len < iph->ihl*4 + sizeof(*udph) + - match_offset + match_len) + if ((*pskb)->len < iph->ihl*4 + sizeof(*udph) + + match_offset + match_len) return 0; if (!skb_make_writable(pskb, (*pskb)->len)) @@ -258,9 +258,9 @@ ip_nat_mangle_udp_packet(struct sk_buff **pskb, if ((*pskb)->ip_summed != CHECKSUM_PARTIAL) { udph->check = 0; udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, - datalen, IPPROTO_UDP, - csum_partial((char *)udph, - datalen, 0)); + datalen, IPPROTO_UDP, + csum_partial((char *)udph, + datalen, 0)); if (!udph->check) udph->check = CSUM_MANGLED_0; } else @@ -273,7 +273,7 @@ EXPORT_SYMBOL(ip_nat_mangle_udp_packet); /* Adjust one found SACK option including checksum correction */ static void sack_adjust(struct sk_buff *skb, - struct tcphdr *tcph, + struct tcphdr *tcph, unsigned int sackoff, unsigned int sackend, struct ip_nat_seq *natseq) @@ -360,14 +360,14 @@ ip_nat_sack_adjust(struct sk_buff **pskb, /* TCP sequence number adjustment. Returns 1 on success, 0 on failure */ int -ip_nat_seq_adjust(struct sk_buff **pskb, - struct ip_conntrack *ct, +ip_nat_seq_adjust(struct sk_buff **pskb, + struct ip_conntrack *ct, enum ip_conntrack_info ctinfo) { struct tcphdr *tcph; int dir; __be32 newseq, newack; - struct ip_nat_seq *this_way, *other_way; + struct ip_nat_seq *this_way, *other_way; dir = CTINFO2DIR(ctinfo); |