All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <mike.rapoport@ravellosystems.com>
To: David Stevens <dlstevens@us.ibm.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: vxlan: fix crash when interface is created with no group
Date: Wed, 19 Mar 2014 16:32:17 +0200	[thread overview]
Message-ID: <CAF1J0HPtQqpaqZ82yPoKFSYpP42HfOGu_X7uz3_61X2b+bYAjQ@mail.gmail.com> (raw)
In-Reply-To: <OF55200AFE.3F917127-ON87257CA0.004DA877-87257CA0.004DA87C@us.ibm.com>

On Wed, Mar 19, 2014 at 4:08 PM, David Stevens <dlstevens@us.ibm.com> wrote:
>
>
> -----Mike Rapoport <mike.rapoport@ravellosystems.com> wrote: -----
>
>>To: David Stevens/Beaverton/IBM@IBMUS
>>From: Mike Rapoport <mike.rapoport@ravellosystems.com>
> ,,,
>>However, for the particular case in vxlan_rcv, checking the packet
>>version seems to me semantically more correct than comparing
>>default_dst
>>protocol family with AF_INET or AF_INET6.
>
> No, that's saying that the sender should determine whether
> you are using IPv4 or IPv6, but when the localhost is the
> sender, it'll only be using one of those.
>
> If the default_dst is an IPv4 group address, ordinary VXLAN
> wouldn't interoperate with IPv6 because the group is not an IPv6
> group, but with your patch, it'll still receive and accept IPv6-encapsulated
> packets. It just wouldn't send any, if all the fdb entries are also v4.

I'm not really familiar with v4 and v6 interoperability, but the
vxlan_socket_create will create v6 socket only if IPv6 is explicitly
requested.
Would it be possible to receive IPv6-encapsulated packets from IPv4 socket?

> I think neither the receive packets nor the default_dst, which may
> not be set, is the right way to determine this. vxlan_dev->saddr
> makes more sense, but it, too, doesn't have to be set.
>
> I'd suggest:
> 1) if vxlan_dev->saddr is set, use that. Any packets sent should use
>           this saddr, if set, so that determines the underlay address family
>           and so also what IP version you'll receive.
> 2) if vxlan_dev->saddr is not set, and default_dst is a multicast group,
>           use that address family. For ordinary VXLAN, the group is used
>           by all participants so it can't mix v4 and v6. Also, if saddr is set
>           and default_dst is a multicast group, the address family should
>           match.
> 3) if neither of those is set, then it isn't ordinary VXLAN, but rather a
>          custom configuration. In that case, we should allow both, by
>          default, at least. fdb entries can use both v4 and v6, so we
>          should receive both.
>
> We could also (or instead) add flags to explicitly allow or disallow v4 and/or v6,
> and then, of course, enforce those flag settings for saddr, default_dst
> and fdb entries, too.
>
>                                                                   +-DLS
>



-- 
Sincerely yours,
Mike.

  reply	other threads:[~2014-03-19 14:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 11:17 [PATCH net] net: vxlan: fix crash when interface is created with no group Mike Rapoport
2014-03-17 16:34 ` Stephen Hemminger
2014-03-18 15:10 ` Or Gerlitz
2014-03-18 15:51   ` Mike Rapoport
2014-03-19  3:20     ` David Miller
2014-03-19  6:56       ` Mike Rapoport
2014-03-18 16:41 ` Cong Wang
2014-03-18 16:55 ` David Stevens
2014-03-18 18:07   ` Cong Wang
2014-03-19  7:14   ` Mike Rapoport
2014-03-19 19:46     ` David Miller
2014-03-19 19:52       ` Mike Rapoport
2014-03-19 22:29         ` David Miller
2014-03-19 20:28     ` David Stevens
2014-03-20  3:40       ` David Miller
2014-03-19 14:08   ` David Stevens
2014-03-19 14:32     ` Mike Rapoport [this message]
2014-03-19 14:40     ` David Stevens
2014-03-20 20:02 ` David Miller
2014-03-21  5:06   ` Mike Rapoport
2014-03-20 20:47 ` David Stevens
2014-03-21 10:22   ` Mike Rapoport
2014-03-21 11:22   ` David Stevens
2014-03-21 15:31     ` Mike Rapoport
2014-03-23  9:27     ` Mike Rapoport
2014-03-23 14:43       ` Or Gerlitz
2014-03-26  0:53         ` David Miller
2014-03-26  9:47           ` Mike Rapoport
2014-03-26 14:47           ` David Stevens
2014-03-26 17:50             ` Mike Rapoport
2014-03-27 20:20               ` Cong Wang
2014-03-28  9:05                 ` Mike Rapoport
2014-03-29  8:29           ` Mike Rapoport
2014-03-31 20:18             ` David Miller
2014-03-24  5:09       ` Pravin Shelar
2014-04-01  6:23 Mike Rapoport
2014-04-01 19:22 ` Cong Wang
2014-04-02  5:51   ` Mike Rapoport
2014-04-03 15:19 ` David Miller

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=CAF1J0HPtQqpaqZ82yPoKFSYpP42HfOGu_X7uz3_61X2b+bYAjQ@mail.gmail.com \
    --to=mike.rapoport@ravellosystems.com \
    --cc=dlstevens@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.