Skip to content

Commit

Permalink
net: Remove checks for dst_ops->redirect being NULL.
Browse files Browse the repository at this point in the history
No longer necessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 12, 2012
1 parent b587ee3 commit 1ed5c48
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static void dccp_do_redirect(struct sk_buff *skb, struct sock *sk)
{
struct dst_entry *dst = __sk_dst_check(sk, 0);

if (dst && dst->ops->redirect)
if (dst)
dst->ops->redirect(dst, skb);
}

Expand Down
2 changes: 1 addition & 1 deletion net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == NDISC_REDIRECT) {
struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);

if (dst && dst->ops->redirect)
if (dst)
dst->ops->redirect(dst, skb);
}

Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static void do_redirect(struct sk_buff *skb, struct sock *sk)
{
struct dst_entry *dst = __sk_dst_check(sk, 0);

if (dst && dst->ops->redirect)
if (dst)
dst->ops->redirect(dst, skb);
}

Expand Down
3 changes: 1 addition & 2 deletions net/ipv4/xfrm4_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ static void xfrm4_redirect(struct dst_entry *dst, struct sk_buff *skb)
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
struct dst_entry *path = xdst->route;

if (path->ops->redirect)
path->ops->redirect(path, skb);
path->ops->redirect(path, skb);
}

static void xfrm4_dst_destroy(struct dst_entry *dst)
Expand Down
6 changes: 2 additions & 4 deletions net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,8 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,

skb_dst(skb2)->ops->update_pmtu(skb_dst(skb2), rel_info);
}
if (rel_type == ICMP_REDIRECT) {
if (skb_dst(skb2)->ops->redirect)
skb_dst(skb2)->ops->redirect(skb_dst(skb2), skb2);
}
if (rel_type == ICMP_REDIRECT)
skb_dst(skb2)->ops->redirect(skb_dst(skb2), skb2);

icmp_send(skb2, rel_type, rel_code, htonl(rel_info));

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == NDISC_REDIRECT) {
struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);

if (dst && dst->ops->redirect)
if (dst)
dst->ops->redirect(dst,skb);
}

Expand Down
2 changes: 1 addition & 1 deletion net/sctp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
if (!t)
return;
dst = sctp_transport_dst_check(t);
if (dst && dst->ops->redirect)
if (dst)
dst->ops->redirect(dst, skb);
}

Expand Down

0 comments on commit 1ed5c48

Please sign in to comment.