Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Mar 2020 17:06:18 -0400
From:      Jacques Fourie <jacques.fourie@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   if_vxlan question
Message-ID:  <CALX0vxCR4cTVKNF8Qb87Km-89Pz1cZqVm=cd6sYjaKtyG9wG7w@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I noticed that my FreeBSD box was dropping vxlan packets with higher VNI's.
Looking at the code it seems that the check at line 2548 is not correct:

if (vxh->vxlh_flags != htonl(VXLAN_HDR_FLAGS_VALID_VNI) ||
            vxh->vxlh_vni & ~htonl(VXLAN_VNI_MASK))     <----- Incorrect?
                goto out;

Let's say the VNI is 99901. This will arrive on the wire as
0x01,0x86,0x3d,0x00. The above check will compute 0x3d8601 & 0xff, which
will return 0x01. I think the correct version should be without the
htonl(), ie:

vxh->vxh_vni & ~VXLAN_VNI_MASK

Can someone please double check?

Thanks,
Jacques



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALX0vxCR4cTVKNF8Qb87Km-89Pz1cZqVm=cd6sYjaKtyG9wG7w>