net: Remove checks for dst_ops->redirect being NULL.
authorDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2012 07:41:25 +0000 (00:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2012 07:41:25 +0000 (00:41 -0700)
No longer necessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/tcp_ipv4.c
net/ipv4/xfrm4_policy.c
net/ipv6/ip6_tunnel.c
net/ipv6/tcp_ipv6.c
net/sctp/input.c

index 8f41a31908584b9f935dba30fab39d465188aa5e..129ed8f74138d62bc495569ffbcc73eb5cd82537 100644 (file)
@@ -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);
 }
 
index b4d7d28ce6d23f69dec1686c918afa01d5b9fd23..090c0800ce039977c765924d2f6e2489b470bdfc 100644 (file)
@@ -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);
        }
 
index 087a8488843f3f6cc70a43c2fb2721474d6a36f6..7a0062cb4ed05a189c7ca775f35221097532dabe 100644 (file)
@@ -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);
 }
 
index 258ebd7b268b3f2207a812fb49b094e02fb5fde8..737131cef375ab46a57a7f88a632811c6233d34f 100644 (file)
@@ -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)
index 0b5b60ec6f4ad4d155c73eeb37a3aa15e9ef91bd..61d106597296092ee46e4faaea65a830b2c5f32f 100644 (file)
@@ -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));
 
index 7249e4bb9b8a7441ef490302d5e3f70180560816..3071f377145c138e74eb62c29572f3f52301d252 100644 (file)
@@ -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);
        }
 
index 5943b7d77ddb174dc65ef338aa6bbee496bfaf33..f050d45faa986824e87eba0a6d9a4748cb7d1a15 100644 (file)
@@ -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);
 }