* re: IPv6: Fix not join all-router mcast group when forwarding set.
@ 2012-03-07 11:45 Dan Carpenter
2012-03-08 1:02 ` Li Wei
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-07 11:45 UTC (permalink / raw)
To: lw; +Cc: netdev
Hello Li Wei,
This is a semi-automatic email about new static checker warnings.
The patch d6ddef9e641d: "IPv6: Fix not join all-router mcast group
when forwarding set." from Mar 5, 2012, leads to the following Smatch
complaint:
net/ipv6/addrconf.c:438 ipv6_add_dev()
warn: variable dereferenced before check 'dev' (see line 432)
net/ipv6/addrconf.c
431 /* protected by rtnl_lock */
432 rcu_assign_pointer(dev->ip6_ptr, ndev);
^^^^^^^^^^^^
Old dereference.
433
434 /* Join all-node multicast group */
435 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
436
437 /* Join all-router multicast group if forwarding is set */
438 if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
^^^
New check. Probably you can just remove the check?
439 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
440
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: IPv6: Fix not join all-router mcast group when forwarding set.
2012-03-07 11:45 IPv6: Fix not join all-router mcast group when forwarding set Dan Carpenter
@ 2012-03-08 1:02 ` Li Wei
0 siblings, 0 replies; 2+ messages in thread
From: Li Wei @ 2012-03-08 1:02 UTC (permalink / raw)
To: Dan Carpenter; +Cc: netdev
> Hello Li Wei,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch d6ddef9e641d: "IPv6: Fix not join all-router mcast group
> when forwarding set." from Mar 5, 2012, leads to the following Smatch
> complaint:
>
> net/ipv6/addrconf.c:438 ipv6_add_dev()
> warn: variable dereferenced before check 'dev' (see line 432)
>
> net/ipv6/addrconf.c
> 431 /* protected by rtnl_lock */
> 432 rcu_assign_pointer(dev->ip6_ptr, ndev);
> ^^^^^^^^^^^^
> Old dereference.
>
> 433
> 434 /* Join all-node multicast group */
> 435 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
> 436
> 437 /* Join all-router multicast group if forwarding is set */
> 438 if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
> ^^^
>
> New check. Probably you can just remove the check?
>
> 439 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
> 440
>
> regards,
> dan carpenter
>
>
>
Hi Dan,
Thanks for your report, I have sent a patch to fix this.
Regards,
Li Wei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-08 1:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 11:45 IPv6: Fix not join all-router mcast group when forwarding set Dan Carpenter
2012-03-08 1:02 ` Li Wei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).