X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fstn%2Fstn.c;h=1447ec4759d86dd4b07a95fe4a81cdc1ea4361e3;hb=8269d3dbe70adaae60806d5d84e35f25d23193c5;hp=a9e6a98ebedbac0e9bb4cd092004a33e9131f9a4;hpb=0906c5cfed162e6581d7652acab023d3cd0805a4;p=vpp.git diff --git a/src/plugins/stn/stn.c b/src/plugins/stn/stn.c index a9e6a98ebed..1447ec4759d 100644 --- a/src/plugins/stn/stn.c +++ b/src/plugins/stn/stn.c @@ -109,8 +109,20 @@ stn_punt_fn (vlib_main_t * vm, p0 = vlib_get_buffer (vm, pi0); +/* + * We are not guaranteed any particular layer here. + * So we need to reparse from the beginning of the packet. + * which may not start from zero with some DPDK drivers. + ip4_header_t *ip = vlib_buffer_get_current(p0); if ((ip->ip_version_and_header_length & 0xf0) == 0x40) +* +*/ + int ethernet_header_offset = 0; /* to be filled by DPDK */ + ethernet_header_t *eth = (ethernet_header_t *)(p0->data + ethernet_header_offset); + /* ensure the block current data starts at L3 boundary now for the subsequent nodes */ + vlib_buffer_advance(p0, ethernet_header_offset + sizeof(ethernet_header_t) - p0->current_data); + if (clib_net_to_host_u16(eth->type) == ETHERNET_TYPE_IP4) next0 = stn->punt_to_stn_ip4_next_index; else next0 = stn->punt_to_stn_ip6_next_index; @@ -370,9 +382,11 @@ int stn_rule_add_del (stn_rule_add_del_args_t *args) 1, 0, 0); vnet_feature_enable_disable("ip6-unicast", "ip6-lookup", args->sw_if_index, 1, 0, 0); - vnet_feature_enable_disable("ip4-unicast", "ip4-drop", args->sw_if_index, + vnet_feature_enable_disable("ip4-unicast", "ip4-not-enabled", + args->sw_if_index, 0, 0, 0); - vnet_feature_enable_disable("ip6-unicast", "ip6-drop", args->sw_if_index, + vnet_feature_enable_disable("ip6-unicast", "ip6-not-enabled", + args->sw_if_index, 0, 0, 0); } else if (r)