Name: Clean up returns of ip_nat_helper's internal functions Author: Rusty Russell Status: Trivial Depends: diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .21144-linux-2.5.31/net/ipv4/netfilter/ip_nat_helper.c .21144-linux-2.5.31.updated/net/ipv4/netfilter/ip_nat_helper.c --- .21144-linux-2.5.31/net/ipv4/netfilter/ip_nat_helper.c 2002-04-15 11:47:52.000000000 +1000 +++ .21144-linux-2.5.31.updated/net/ipv4/netfilter/ip_nat_helper.c 2002-08-26 11:19:47.000000000 +1000 @@ -255,8 +255,8 @@ sack_adjust(struct tcphdr *tcph, } -/* TCP SACK sequence number adjustment, return 0 if sack found and adjusted */ -static inline int +/* TCP SACK sequence number adjustment */ +static void ip_nat_sack_adjust(struct sk_buff *skb, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo) @@ -264,7 +264,7 @@ ip_nat_sack_adjust(struct sk_buff *skb, struct iphdr *iph; struct tcphdr *tcph; unsigned char *ptr; - int length, dir, sack_adjusted = 0; + int length, dir; iph = skb->nh.iph; tcph = (void *)iph + iph->ihl*4; @@ -279,14 +279,14 @@ ip_nat_sack_adjust(struct sk_buff *skb, switch (opcode) { case TCPOPT_EOL: - return !sack_adjusted; + return; case TCPOPT_NOP: length--; continue; default: opsize = *ptr++; if (opsize > length) /* no partial opts */ - return !sack_adjusted; + return; if (opcode == TCPOPT_SACK) { /* found SACK */ if((opsize >= (TCPOLEN_SACK_BASE @@ -295,14 +295,11 @@ ip_nat_sack_adjust(struct sk_buff *skb, % TCPOLEN_SACK_PERBLOCK)) sack_adjust(tcph, ptr-2, &ct->nat.info.seq[!dir]); - - sack_adjusted = 1; } ptr += opsize-2; length -= opsize; } } - return !sack_adjusted; } /* TCP sequence number adjustment */