]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV4] icmp: Kill local 'ip' arg in icmp_redirect().
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 6 Jun 2006 04:19:24 +0000 (21:19 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 18 Jun 2006 04:29:41 +0000 (21:29 -0700)
It is typed wrong, and it's only assigned and used once.
So just pass in iph->daddr directly which fixes both problems.

Based upon a patch by Alexey Dobriyan.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/icmp.c

index 2a0455911ee0a9c9119472c01d4d4717f58e190b..017900172f7d5fc01505b2ac9ea90f7628c4042c 100644 (file)
@@ -730,7 +730,6 @@ out_err:
 static void icmp_redirect(struct sk_buff *skb)
 {
        struct iphdr *iph;
-       unsigned long ip;
 
        if (skb->len < sizeof(struct iphdr))
                goto out_err;
@@ -742,7 +741,6 @@ static void icmp_redirect(struct sk_buff *skb)
                goto out;
 
        iph = (struct iphdr *)skb->data;
-       ip = iph->daddr;
 
        switch (skb->h.icmph->code & 7) {
        case ICMP_REDIR_NET:
@@ -752,7 +750,8 @@ static void icmp_redirect(struct sk_buff *skb)
                 */
        case ICMP_REDIR_HOST:
        case ICMP_REDIR_HOSTTOS:
-               ip_rt_redirect(skb->nh.iph->saddr, ip, skb->h.icmph->un.gateway,
+               ip_rt_redirect(skb->nh.iph->saddr, iph->daddr,
+                              skb->h.icmph->un.gateway,
                               iph->saddr, skb->dev);
                break;
        }