Thread (13 messages) flat view 13 messages, 3 authors, 2017-01-24
STALE3529d

[PATCH cumulus-4.1.y 3/5] vxlan: enforce precedence for static over dynamic fdb entry

From: Roopa Prabhu <hidden>
Date: 2017-01-21 07:41:06
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Wilson Kok <redacted>

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 <redacted>
Signed-off-by: Roopa Prabhu <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help