]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV4]: ip_route_input panic fix
authorStephen Hemminger <shemminger@osdl.org>
Tue, 18 Apr 2006 00:27:11 +0000 (17:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Apr 2006 00:27:11 +0000 (17:27 -0700)
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=6388
The bug is caused by ip_route_input dereferencing skb->nh.protocol of
the dummy skb passed dow from inet_rtm_getroute (Thanks Thomas for seeing
it). It only happens if the route requested is for a multicast IP
address.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index ff434821909f12f26a6d142d3c3ae843580deed3..cc9423de7311fcac8845b38a055b6ea008b22ec7 100644 (file)
@@ -2741,7 +2741,10 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
        /* Reserve room for dummy headers, this skb can pass
           through good chunk of routing engine.
         */
-       skb->mac.raw = skb->data;
+       skb->mac.raw = skb->nh.raw = skb->data;
+
+       /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
+       skb->nh.iph->protocol = IPPROTO_ICMP;
        skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
 
        if (rta[RTA_SRC - 1])