summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_learn.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-06-14 13:11:20 +0300
committerJohn Lo <loj@cisco.com>2017-06-19 22:24:19 +0000
commit0f360dc3aa40d0654198bd3f3850bd31a0d78f7e (patch)
tree2e0d277a48c1a1babdf548690814a02b189f5063 /src/vnet/l2/l2_learn.c
parent08ce432ce9727c7e099ea6c4630e4e6ebbecc92a (diff)
L2FWD:fix seq_num overwritten + validate l2fib entries when forwarding
l2_classify memeber table_index was overlaid over l2.l2fib_seq_num which over written when table_index gets initialized in l2_input_classify solved by overlaying both table_index and opaque_index as only one is used seperated l2fib seq num from l2_input configs for better handling of theoretical ABA issue where an entry for a deleted interface is considered valid by the ager because a different interface with same sw_if_index and seq_num was created before the ager got a chance to delete Change-Id: I7b0eeded971627406f1c80834d7e02c0ebe62136 Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_learn.c')
-rw-r--r--src/vnet/l2/l2_learn.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vnet/l2/l2_learn.c b/src/vnet/l2/l2_learn.c
index adc5e70f493..3ff2e704a6e 100644
--- a/src/vnet/l2/l2_learn.c
+++ b/src/vnet/l2/l2_learn.c
@@ -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)
{