vxlan4_gbp_tunnel_key_t key4;
int rv;
- key4.key[1] = ((u64) fib_index << 32) | vxlan_gbp0->vni_reserved;
- key4.key[0] = (((u64) ip4_0->dst_address.as_u32 << 32) |
- ip4_0->src_address.as_u32);
+ key4.key[1] = (((u64) fib_index << 32) |
+ (vxlan_gbp0->vni_reserved &
+ clib_host_to_net_u32 (0xffffff00)));
+ key4.key[0] =
+ (((u64) ip4_0->dst_address.as_u32 << 32) | ip4_0->src_address.as_u32);
if (PREDICT_FALSE (key4.key[0] != cache->key[0] ||
key4.key[1] != cache->key[1]))
.key = {
[0] = ip6_0->src_address.as_u64[0],
[1] = ip6_0->src_address.as_u64[1],
- [2] = (((u64) fib_index) << 32) | vxlan_gbp0->vni_reserved,
+ [2] = ((((u64) fib_index) << 32) |
+ (vxlan_gbp0->vni_reserved &
+ clib_host_to_net_u32 (0xffffff00))),
}
};
int rv;
vlib_buffer_advance (b0, sizeof *vxlan_gbp0);
vlib_buffer_advance (b1, sizeof *vxlan_gbp1);
+ u8 i_and_g0 = ((flags0 & VXLAN_GBP_FLAGS_GI) == VXLAN_GBP_FLAGS_GI);
+ u8 i_and_g1 = ((flags1 & VXLAN_GBP_FLAGS_GI) == VXLAN_GBP_FLAGS_GI);
+
/* Validate VXLAN_GBP tunnel encap-fib index against packet */
- if (PREDICT_FALSE
- (t0 == NULL
- || flags0 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G)))
+ if (PREDICT_FALSE (t0 == NULL || !i_and_g0))
{
- if (t0 != NULL
- && flags0 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G))
+ if (t0 != NULL && !i_and_g0)
{
error0 = VXLAN_GBP_ERROR_BAD_FLAGS;
vlib_increment_combined_counter
vnet_buffer2 (b0)->gbp.sclass = vxlan_gbp_get_sclass (vxlan_gbp0);
- if (PREDICT_FALSE
- (t1 == 0 || flags1 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G)))
+ if (PREDICT_FALSE (t1 == NULL || !i_and_g1))
{
- if (t1 != 0
- && flags1 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G))
+ if (t1 != NULL && !i_and_g1)
{
error1 = VXLAN_GBP_ERROR_BAD_FLAGS;
vlib_increment_combined_counter
/* pop (ip, udp, vxlan_gbp) */
vlib_buffer_advance (b0, sizeof (*vxlan_gbp0));
+
+ u8 i_and_g0 = ((flags0 & VXLAN_GBP_FLAGS_GI) == VXLAN_GBP_FLAGS_GI);
+
/* Validate VXLAN_GBP tunnel encap-fib index against packet */
- if (PREDICT_FALSE
- (t0 == NULL
- || flags0 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G)))
+ if (PREDICT_FALSE (t0 == NULL || !i_and_g0))
{
- if (t0 != NULL
- && flags0 != (VXLAN_GBP_FLAGS_I | VXLAN_GBP_FLAGS_G))
+ if (t0 != NULL && !i_and_g0)
{
error0 = VXLAN_GBP_ERROR_BAD_FLAGS;
vlib_increment_combined_counter
# Learn new EPs from GARP packets received on the BD's mcast tunnel
#
for ii, l in enumerate(learnt):
- # a packet with an sclass from a known EPG
- # arriving on an unknown TEP
+ # add some junk in the reserved field of the vxlan-header
+ # next to the VNI. we should accept since reserved bits are
+ # ignored on rx.
p = (Ether(src=self.pg2.remote_mac,
dst=self.pg2.local_mac) /
IP(src=self.pg2.remote_hosts[1].ip4,
dst="239.1.1.1") /
UDP(sport=1234, dport=48879) /
- VXLAN(vni=88, gpid=112, flags=0x88) /
+ VXLAN(vni=88, reserved2=0x80, gpid=112, flags=0x88) /
Ether(src=l['mac'], dst="ff:ff:ff:ff:ff:ff") /
ARP(op="who-has",
psrc=l['ip'], pdst=l['ip'],
#
for l in learnt:
# a packet with an sclass from a known EPG
+ # set a reserved bit in addition to the G and I
+ # reserved bits should not be checked on rx.
p = (Ether(src=self.pg2.remote_mac,
dst=self.pg2.local_mac) /
IP(src=self.pg2.remote_hosts[1].ip4,
dst=self.pg2.local_ip4) /
UDP(sport=1234, dport=48879) /
- VXLAN(vni=99, gpid=112, flags=0x88) /
+ VXLAN(vni=99, gpid=112, flags=0xc8) /
Ether(src=l['mac'], dst=ep.mac) /
IP(src=l['ip'], dst=ep.ip4.address) /
UDP(sport=1234, dport=1234) /