Commit 0ec566aa authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

vxlan: Don't override user-added entries with ext-learned ones

When an external learning event collides with an user-added entry, the
user-added entry shouldn't be taken over. Otherwise on an unlearn event
the entry would be completely lost, even though the user added it by
hand.

Therefore skip update of FDB flags and state for these cases. This is in
accordance with the bridge behavior.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45598c1c
...@@ -780,16 +780,24 @@ static int vxlan_fdb_update(struct vxlan_dev *vxlan, ...@@ -780,16 +780,24 @@ static int vxlan_fdb_update(struct vxlan_dev *vxlan,
"lost race to create %pM\n", mac); "lost race to create %pM\n", mac);
return -EEXIST; return -EEXIST;
} }
if (f->state != state) {
f->state = state; /* Do not allow an externally learned entry to take over an
f->updated = jiffies; * entry added by the user.
notify = 1; */
} if (!(fdb_flags & NTF_EXT_LEARNED) ||
if (f->flags != fdb_flags) { !(f->flags & NTF_VXLAN_ADDED_BY_USER)) {
f->flags = fdb_flags; if (f->state != state) {
f->updated = jiffies; f->state = state;
notify = 1; f->updated = jiffies;
notify = 1;
}
if (f->flags != fdb_flags) {
f->flags = fdb_flags;
f->updated = jiffies;
notify = 1;
}
} }
if ((flags & NLM_F_REPLACE)) { if ((flags & NLM_F_REPLACE)) {
/* Only change unicasts */ /* Only change unicasts */
if (!(is_multicast_ether_addr(f->eth_addr) || if (!(is_multicast_ether_addr(f->eth_addr) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment