public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Toshiaki Makita <makita.toshiaki@lab•ntt.co.jp>
To: Atzm Watanabe <atzm@stratosphere•co.jp>,
	netdev@vger•kernel.org,
	Stephen Hemminger <stephen@networkplumber•org>
Subject: Re: [PATCH net-next v2] vxlan: fix handling of the inner 8021Q tagged frame
Date: Wed, 02 Apr 2014 17:30:55 +0900	[thread overview]
Message-ID: <533BCABF.80303@lab.ntt.co.jp> (raw)
In-Reply-To: <87d2h1i0pj.wl%atzm@stratosphere.co.jp>

(2014/04/01 23:27), Atzm Watanabe wrote:
> Currently the implementation can forward the 8021Q tagged frame,
> but the FDB cannot learn the VID.
> So there is a possibility of forwarding the frame to wrong VTEP,
> when same LLADDR exists on different VLANs.
> 
> This patch supports only single tagged frame, so the outermost
> tag will be used when handling the 8021AD Q-in-Q frame.
> 
> v2: Fix probably unsafe operation on the struct vxlan_key.
>     The outermost tag will be used when handling the 8021AD
>     Q-in-Q frame.  Based on Stephen Hemminger's comments.
> 
> Signed-off-by: Atzm Watanabe <atzm@stratosphere•co.jp>
...
> @@ -1215,8 +1257,18 @@ static void vxlan_rcv(struct vxlan_sock *vs,
>  #endif
>  	}
>  
> +	ether_addr_copy(key.eth_addr, eth_hdr(skb)->h_source);
> +	switch (ntohs(eth_hdr(skb)->h_proto)) {
> +	case ETH_P_8021Q:
> +	case ETH_P_8021AD:
> +		key.vlan_id = ntohs(vlan_eth_hdr(skb)->h_vlan_TCI) & VLAN_VID_MASK;
> +		break;

It seems that we can't segregate skbs tagged by same vlan id but
different vlan protocols.

> +	default:
> +		key.vlan_id = 0;
> +	}
> +
>  	if ((vxlan->flags & VXLAN_F_LEARN) &&
> -	    vxlan_snoop(skb->dev, &saddr, eth_hdr(skb)->h_source))
> +	    vxlan_snoop(skb->dev, &saddr, &key))
>  		goto drop;
>  
>  	skb_reset_network_header(skb);
...
> @@ -1983,23 +2056,28 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
>  #endif
>  	}
>  
> -	f = vxlan_find_mac(vxlan, eth->h_dest);
> +	ether_addr_copy(key.eth_addr, eth->h_dest);
> +	key.vlan_id = vlan_tx_tag_present(skb) ? vlan_tx_tag_get_id(skb) : 0;

Can't we assume that skbs always have HW accelarated vlan tags?


Thanks,
Toshiaki Makita

  parent reply	other threads:[~2014-04-02  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 14:27 [PATCH net-next v2] vxlan: fix handling of the inner 8021Q tagged frame Atzm Watanabe
2014-04-01 22:19 ` David Miller
2014-04-02  3:03   ` Atzm Watanabe
2014-04-02  8:30 ` Toshiaki Makita [this message]
2014-04-02 12:10   ` Atzm Watanabe
2014-04-02 16:16     ` Toshiaki Makita
2014-04-03  9:42       ` Atzm Watanabe
2014-04-04 15:25         ` Toshiaki Makita
2014-04-07  9:09           ` Atzm Watanabe
2014-04-08 16:28             ` Toshiaki Makita
2014-04-09 11:01               ` Atzm Watanabe

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=533BCABF.80303@lab.ntt.co.jp \
    --to=makita.toshiaki@lab$(echo .)ntt.co.jp \
    --cc=atzm@stratosphere$(echo .)co.jp \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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