L2FWD:fix seq_num overwritten + validate l2fib entries when forwarding
[vpp.git] / src / vnet / l2 / l2_learn.c
index adc5e70..3ff2e70 100644 (file)
@@ -138,11 +138,14 @@ l2learn_process (vlib_node_runtime_t * node,
        * The entry was in the table, and the sw_if_index matched, the normal case
        */
       counter_base[L2LEARN_ERROR_HIT] += 1;
-      if (PREDICT_FALSE (result0->fields.timestamp != timestamp))
-       result0->fields.timestamp = timestamp;
-      if (PREDICT_FALSE
-         (result0->fields.sn.as_u16 != vnet_buffer (b0)->l2.l2fib_sn))
-       result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn;
+      if (!result0->fields.static_mac)
+       {
+         if (PREDICT_FALSE (result0->fields.timestamp != timestamp))
+           result0->fields.timestamp = timestamp;
+         if (PREDICT_FALSE
+             (result0->fields.sn.as_u16 != vnet_buffer (b0)->l2.l2fib_sn))
+           result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn;
+       }
     }
   else if (result0->raw == ~0)
     {