[ovs-dev] [PATCH v3] datapath-windows: use ip proto for tunnel port lookup
Alin Serdean
aserdean at cloudbasesolutions.com
Fri Jun 17 17:23:25 UTC 2016
Maybe I was a bit unclear in my previous comment. See inlined comment.
> -----Mesaj original-----
> De la: dev [mailto:dev-bounces at openvswitch.org] În numele Nithin Raju
> Trimis: Wednesday, June 15, 2016 1:11 AM
> Către: dev at openvswitch.org
> Subiect: [ovs-dev] [PATCH v3] datapath-windows: use ip proto for tunnel
> port lookup
>
> In Actions.c, based on the IP Protocol type and L4 port of the outer packet,
> we lookup the tunnel port. The function that made this happen took the
> tunnel type as an argument.
> Semantically, is is better to pass the IP protocol type and let the lookup code
> map IP protocol type to tunnel type.
>
> In the vport add code, we make sure that we block tunnel port addition if
> there's already a tunnel port that uses the same IP protocol type and L4 port
> number.
>
> Signed-off-by: Nithin Raju <nithin at vmware.com>
> Acked-by: Sairam Venugopal <vsairam at vmware.com>
> Acked-by: Yin Lin <linyi at vmware.com>
> + LIST_FORALL(head, link) {
> + vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY,
> tunnelVportLink);
> + if (GetPortFromPriv(vport) == dstPort) {
> + switch (nwProto) {
> + case IPPROTO_UDP:
> + if (vport->ovsType != OVS_VPORT_TYPE_VXLAN) {
> + continue;
> + }
> + break;
> + case IPPROTO_TCP:
> + if (vport->ovsType != OVS_VPORT_TYPE_STT) {
> + continue;
> + }
> + break;
> + case IPPROTO_GRE:
[Alin Gabriel Serdean: ] break;
> + default:
[Alin Gabriel Serdean: ] return NULL;
> + break;
> + }
> + return vport;
> + }
> + }
> + return NULL;
> +}
We need to exact match the IP proto. In the case of GRE you will get a valid vport although you have an L2 packet with dstPort == 0.
I hope I was clear enough this time, if not I can post a debugging session :).
The rest is all good.
Alin.
More information about the dev
mailing list