ipv6: ip6_route_output() never returns NULL.
Subsystems (4)
PATCH 1/3 ipv6: ip6_route_output() never returns NULL.
From: RongQing.Li <[email protected]>
ip6_route_output() never returns NULL, so it is wrong to check if the return value is NULL.
--- net/ipv6/ip6mr.c | 4 +++- net/ipv6/ndisc.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-)
net/ipv6/ip6mr.c +3 -1
@@ -1926,8 +1926,10 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt, }; dst =ip6_route_output (net,NULL , &fl6); -if (!dst) +if (dst->error) { +dst_release (dst); goto out_free; + }skb_dst_drop (skb);skb_dst_set (skb, dst);
net/ipv6/ndisc.c +3 -2
@@ -1550,9 +1550,10 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex); dst =ip6_route_output (net,NULL , &fl6); -if (dst ==NULL ) +if (dst->error) { +dst_release (dst);return ; - + } dst =xfrm_lookup (net, dst,flowi6_to_flowi (&fl6),NULL ,0 );if (IS_ERR (dst))return ;
Signature · 1 line
1.7.1
PATCH 2/3 ethernet/broadcom: ip6_route_output() never returns NULL.
From: RongQing.Li <[email protected]>
ip6_route_output() never returns NULL, so it is wrong to check if the return value is NULL.
--- drivers/net/ethernet/broadcom/cnic.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/ethernet/broadcom/cnic.c +5 -1
@@ -3616,7 +3616,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr, fl6.flowi6_oif = dst_addr->sin6_scope_id; *dst =ip6_route_output (&init_net,NULL , &fl6); -if (*dst) +if ((*dst)->error) { +dst_release (*dst); + *dst =NULL ; +return -ENETUNREACH ; + }else return 0 ;#endif
Signature · 1 line
1.7.1
PATCH 3/3 netfilter: ip6_route_output() never returns NULL.
In reply to [email protected]From: RongQing.Li <[email protected]>
ip6_route_output() never returns NULL, so it is wrong to check if the return value is NULL.
--- net/netfilter/xt_TEE.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
net/netfilter/xt_TEE.c +3 -2
@@ -152,9 +152,10 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) fl6.flowlabel = ((iph->flow_lbl[0 ] &0xF ) <<16 ) | (iph->flow_lbl[1 ] <<8 ) | iph->flow_lbl[2 ]; dst =ip6_route_output (net,NULL , &fl6); -if (dst ==NULL ) +if (dst->error) { +dst_release (dst);return false; - + }skb_dst_drop (skb);skb_dst_set (skb, dst); skb->dev = dst->dev;
Signature · 1 line
1.7.1
From: [email protected]
Date: Wed, 22 Feb 2012 16:10:49 +0800
Quoted 6 lines
From: RongQing.Li <[email protected]>
ip6_route_output()never returns NULL, so it is wrong to check if the return value is NULL.Signed-off-by RongQing.Li <[email protected]>
Applied.
Re: [PATCH 2/3] ethernet/broadcom: ip6_route_output() never returns NULL.
In reply to [email protected]From: [email protected]
Date: Wed, 22 Feb 2012 16:10:50 +0800
Quoted 6 lines
From: RongQing.Li <[email protected]>
ip6_route_output()never returns NULL, so it is wrong to check if the return value is NULL.Signed-off-by RongQing.Li <[email protected]>
Applied.
Re: [PATCH 3/3] netfilter: ip6_route_output() never returns NULL.
In reply to [email protected]From: [email protected]
Date: Wed, 22 Feb 2012 16:10:51 +0800
Quoted 6 lines
From: RongQing.Li <[email protected]>
ip6_route_output()never returns NULL, so it is wrong to check if the return value is NULL.Signed-off-by RongQing.Li <[email protected]>
Applied.