Commit e18b2b9a authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji Committed by David S. Miller

[IPV6]: kill needless initialization and comparison in icmp.c

I believe that compilers are clever enough, but anyway...
Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96c1ff83
...@@ -287,7 +287,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, ...@@ -287,7 +287,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
int iif = 0; int iif = 0;
int addr_type = 0; int addr_type = 0;
int len; int len;
int hlimit = -1; int hlimit;
int err = 0; int err = 0;
if ((u8*)hdr < skb->head || (u8*)(hdr+1) > skb->tail) if ((u8*)hdr < skb->head || (u8*)(hdr+1) > skb->tail)
...@@ -375,14 +375,12 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, ...@@ -375,14 +375,12 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0)
goto out_dst_release; goto out_dst_release;
if (hlimit < 0) {
if (ipv6_addr_is_multicast(&fl.fl6_dst)) if (ipv6_addr_is_multicast(&fl.fl6_dst))
hlimit = np->mcast_hops; hlimit = np->mcast_hops;
else else
hlimit = np->hop_limit; hlimit = np->hop_limit;
if (hlimit < 0) if (hlimit < 0)
hlimit = dst_metric(dst, RTAX_HOPLIMIT); hlimit = dst_metric(dst, RTAX_HOPLIMIT);
}
msg.skb = skb; msg.skb = skb;
msg.offset = skb->nh.raw - skb->data; msg.offset = skb->nh.raw - skb->data;
...@@ -433,7 +431,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -433,7 +431,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
struct icmpv6_msg msg; struct icmpv6_msg msg;
struct dst_entry *dst; struct dst_entry *dst;
int err = 0; int err = 0;
int hlimit = -1; int hlimit;
saddr = &skb->nh.ipv6h->daddr; saddr = &skb->nh.ipv6h->daddr;
...@@ -463,14 +461,12 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -463,14 +461,12 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0)
goto out_dst_release; goto out_dst_release;
if (hlimit < 0) {
if (ipv6_addr_is_multicast(&fl.fl6_dst)) if (ipv6_addr_is_multicast(&fl.fl6_dst))
hlimit = np->mcast_hops; hlimit = np->mcast_hops;
else else
hlimit = np->hop_limit; hlimit = np->hop_limit;
if (hlimit < 0) if (hlimit < 0)
hlimit = dst_metric(dst, RTAX_HOPLIMIT); hlimit = dst_metric(dst, RTAX_HOPLIMIT);
}
idev = in6_dev_get(skb->dev); idev = in6_dev_get(skb->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment