From: Wilson Kok <w...@cumulusnetworks.com>

This patch enforces fdb state correctly when deciding
to add or update an existing fdb. It makes sure static fdb
entries are not replaced by dynamic fdb entries.

Signed-off-by: Wilson Kok <w...@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <ro...@cumulusnetworks.com>
---
 drivers/net/vxlan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 72b99ff..7300586 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -628,6 +628,10 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
                        return -EEXIST;
                }
                if (f->state != state) {
+                       if ((f->state & NUD_PERMANENT) &&
+                           !(state & NUD_PERMANENT))
+                               return -EINVAL;
+
                        f->state = state;
                        f->updated = jiffies;
                        notify = 1;
-- 
1.9.1

Reply via email to