[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-net
Subject:    if_vxlan question
From:       Jacques Fourie <jacques.fourie () gmail ! com>
Date:       2020-03-19 21:06:18
Message-ID: CALX0vxCR4cTVKNF8Qb87Km-89Pz1cZqVm=cd6sYjaKtyG9wG7w () mail ! gmail ! com
[Download RAW message or body]

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
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic