rpms/kernel/FC-6 linux-2.6-net-netpoll-fixes.patch,NONE,1.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sat Oct 21 16:28:27 UTC 2006


Author: davej

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv10363

Added Files:
	linux-2.6-net-netpoll-fixes.patch 
Log Message:
add file

linux-2.6-net-netpoll-fixes.patch:
 b/net/core/netpoll.c |    8 ++++----
 net/core/netpoll.c   |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

--- NEW FILE linux-2.6-net-netpoll-fixes.patch ---

http://lkml.org/lkml/2006/10/18/334

If netpoll uses up it's retries, it should drop the skb
not leak memory.

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index ead5920..c375fde 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -273,10 +273,8 @@ static void netpoll_send_skb(struct netp
 	int status;
 	struct netpoll_info *npinfo;
 
-	if (!np || !np->dev || !netif_running(np->dev)) {
-		__kfree_skb(skb);
-		return;
-	}
+	if (!np || !np->dev || !netif_running(np->dev))
+		goto free_skb;
 
 	npinfo = np->dev->npinfo;
 
@@ -314,6 +312,8 @@ static void netpoll_send_skb(struct netp
 		netpoll_poll(np);
 		udelay(50);
 	} while (npinfo->tries > 0);
+free_skb:
+	__kfree_skb(skb);
 }
 
 void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
-- 
1.4.2.3


http://marc.theaimsgroup.com/?l=linux-netdev&m=116122712920812&w=2
http://lkml.org/lkml/2006/10/19/255


--- linux-2.6.orig/net/core/netpoll.c	2006-10-18 15:26:36.000000000 -0700
+++ linux-2.6/net/core/netpoll.c	2006-10-19 08:28:04.000000000 -0700
@@ -331,13 +331,13 @@
 	memcpy(skb->data, msg, len);
 	skb->len += len;
 
-	udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
+	skb->h.uh = udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
 	udph->source = htons(np->local_port);
 	udph->dest = htons(np->remote_port);
 	udph->len = htons(udp_len);
 	udph->check = 0;
 
-	iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
+	skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
 
 	/* iph->version = 4; iph->ihl = 5; */
 	put_unaligned(0x45, (unsigned char *)iph);
@@ -353,8 +353,8 @@
 	iph->check    = ip_fast_csum((unsigned char *)iph, iph->ihl);
 
 	eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
-
-	eth->h_proto = htons(ETH_P_IP);
+	skb->mac.raw = skb->data;
+	skb->protocol = eth->h_proto = htons(ETH_P_IP);
 	memcpy(eth->h_source, np->local_mac, 6);
 	memcpy(eth->h_dest, np->remote_mac, 6);
 





More information about the fedora-cvs-commits mailing list