+ if (f->type == VNET_FLOW_TYPE_ETHERNET)
+ {
+ vnet_flow_ethernet_t *te = &f->ethernet;
+
+ clib_memset (ð[0], 0, sizeof (eth[0]));
+ clib_memset (ð[1], 0, sizeof (eth[1]));
+
+ /* check if SMAC/DMAC/Ether_type assigned */
+ if (!mac_address_is_all_zero (te->eth_hdr.dst_address))
+ {
+ clib_memcpy_fast (ð[0].dst, &te->eth_hdr.dst_address,
+ sizeof (eth[0].dst));
+ clib_memset (ð[1].dst, 0xFF, sizeof (eth[1].dst));
+ }
+
+ if (!mac_address_is_all_zero (te->eth_hdr.src_address))
+ {
+ clib_memcpy_fast (ð[0].src, &te->eth_hdr.src_address,
+ sizeof (eth[0].src));
+ clib_memset (ð[1].src, 0xFF, sizeof (eth[1].src));
+ }
+
+ if (te->eth_hdr.type)
+ {
+ eth[0].type = clib_host_to_net_u16 (te->eth_hdr.type);
+ eth[1].type = clib_host_to_net_u16 (0xFFFF);
+ }
+
+ item->spec = eth;
+ item->mask = eth + 1;
+ }
+ else
+ {
+ item->spec = NULL;
+ item->mask = NULL;
+ }