From: Stephen Hemminger <stephen@networkplumber.org>
To: Pravin B Shelar <pshelar@nicira.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5 1/7] vxlan: Restructure vxlan socket apis.
Date: Wed, 31 Jul 2013 16:45:21 -0700 [thread overview]
Message-ID: <20130731164521.09c43fb8@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1375312463-18574-1-git-send-email-pshelar@nicira.com>
On Wed, 31 Jul 2013 16:14:23 -0700
Pravin B Shelar <pshelar@nicira.com> wrote:
> /* Disable multicast loopback */
> inet_sk(sk)->mc_loop = 0;
> + spin_lock(&vn->sock_lock);
> + hlist_add_head_rcu(&vs->hlist, vs_head(net, port));
> + spin_unlock(&vn->sock_lock);
>
This change could potentially put two of the sockets with the
same port in the list.
There is an existing check in vxlan_sock_work to handle this
now. It does:
create new socket (no locks)
spin_lock
if (udp_socket with that port exists)
drop new socket
else
add to list
spin_unlock
Your code seems to immediately put it on the list which
will cause duplicates if race occurs.
next prev parent reply other threads:[~2013-07-31 23:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 23:14 [PATCH net-next v5 1/7] vxlan: Restructure vxlan socket apis Pravin B Shelar
2013-07-31 23:45 ` Stephen Hemminger [this message]
2013-08-01 3:00 ` Pravin Shelar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130731164521.09c43fb8@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox