Skip to content

Commit

Permalink
[IPV4] icmp: Kill local 'ip' arg in icmp_redirect().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Jun 18, 2006
1 parent 6d74165 commit f86502b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ static void icmp_unreach(struct sk_buff *skb)
static void icmp_redirect(struct sk_buff *skb)
{
struct iphdr *iph;
unsigned long ip;

if (skb->len < sizeof(struct iphdr))
goto out_err;
Expand All @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit f86502b

Please sign in to comment.