lwtunnel: add support for multiple geneve opts
authorXin Long <lucien.xin@gmail.com>
Tue, 19 Nov 2019 09:39:11 +0000 (17:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 18:15:13 +0000 (10:15 -0800)
commit2f1d370b997a249ff289507cbd629b4fdd99c564
treebf8b2e0015db36c74c938da8f5adb960f3901cb2
parent272630feb4c0d274cc4f018c5dcc24bc94f685c7
lwtunnel: add support for multiple geneve opts

geneve RFC (draft-ietf-nvo3-geneve-14) allows a geneve packet to carry
multiple geneve opts, so it's necessary for lwtunnel to support adding
multiple geneve opts in one lwtunnel route. But vxlan and erspan opts
are still only allowed to add one option.

With this patch, iproute2 could make it like:

  # ip r a 1.1.1.0/24 encap ip id 1 geneve_opts 0:0:12121212,1:2:12121212 \
    dst 10.1.0.2 dev geneve1

  # ip r a 1.1.1.0/24 encap ip id 1 vxlan_opts 456 \
    dst 10.1.0.2 dev erspan1

  # ip r a 1.1.1.0/24 encap ip id 1 erspan_opts 1:123:0:0 \
    dst 10.1.0.2 dev erspan1

Which are pretty much like cls_flower and act_tunnel_key.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel_core.c