tnl-ports: Generate mask with correct prerequisites.
authorDaniele Di Proietto <diproiettod@vmware.com>
Mon, 23 Nov 2015 23:37:46 +0000 (15:37 -0800)
committerDaniele Di Proietto <diproiettod@vmware.com>
Fri, 11 Dec 2015 01:38:23 +0000 (17:38 -0800)
commit5be5370d361b91d1dcda80897d20610c752d6975
treec3ea94e4e073404db0262f38f6fe06f7014813f3
parentb476e2f21b1f20bd0d24c0522e4d745603599582
tnl-ports: Generate mask with correct prerequisites.

We should match on the transport ports only if the tunnel has a UDP
header.  It doesn't make sense to match on transport port for GRE
tunnels.

Also, to match on fragment bits we should use FLOW_NW_FRAG_MASK instead
of 0xFF.  FLOW_NW_FRAG_MASK is what we get if we convert to the ODP
netlink format and back.

Adding the correct masks in the tunnel router classifier helps in making
sure that the translation generates masks that respect prerequisites.

If the mask has some fields that do not respect prerequisites, the flow
will get deleted by revalidation, because translating to ODP format and
back will generate a more generic mask, which will be perceived as too
generic (compared with the one generated by the translation).
lib/tnl-ports.c