patch-1.3.6 linux/net/ipv4/ip_fw.c

Next file: linux/net/ipv4/packet.c
Previous file: linux/net/ipv4/ip.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.5/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
@@ -612,13 +612,13 @@
  		if (!ftp->init_seq)
  			ftp->init_seq = th->seq;
  
-		skb2 = alloc_skb(skb->mem_len-sizeof(struct sk_buff)+ftp->delta, GFP_ATOMIC);
+		skb2 = alloc_skb(skb->len+ftp->delta, GFP_ATOMIC);
  		if (skb2 == NULL) {
  			printk("MASQUERADE: No memory available\n");
  			return skb;
  		}
  		skb2->free = skb->free;
- 		skb2->len = skb->len + ftp->delta;
+ 		skb_put(skb2,skb->len + ftp->delta);
  		skb2->h.raw = &skb2->data[skb->h.raw - skb->data];
  
  		/*
@@ -628,7 +628,7 @@
  		memcpy(skb2->data, skb->data, (p - (char *)skb->data));
  		memcpy(&skb2->data[(p - (char *)skb->data)], buf, strlen(buf));
 		memcpy(&skb2->data[(p - (char *)skb->data) + strlen(buf)], data,
-			skb->mem_len - sizeof(struct sk_buff) - ((char *)skb->h.raw - data));
+			skb->len - ((char *)skb->h.raw - data));
 
 		/*
 		 * Problem, how to replace the new skb with old one,
@@ -648,7 +648,7 @@
 	uh->check=csum_tcpudp_magic(saddr,daddr,len,
 		IPPROTO_UDP, csum_partial((char *)uh,len,0));
 	if(uh->check==0)
-		uh->check=-0xFFFF;
+		uh->check=0xFFFF;
 }
 	
 void ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this