[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1555149112-14115-1-git-send-email-jiaolitao@raisecom.com>
Date: Sat, 13 Apr 2019 17:51:52 +0800
From: Litao Jiao <jiaolitao@...secom.com>
To: davem@...emloft.net
Cc: petrm@...lanox.com, idosch@...lanox.com, roopa@...ulusnetworks.com,
sbrivio@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, jiaolitao@...secom.com
Subject: [PATCH] vxlan: do not add dynamic fdb entry when the dev has been downed
When the dev has been downed or goes downing, it should not
add dynamic fdb entry for the dev.
Signed-off-by: Litao Jiao <jiaolitao@...secom.com>
---
drivers/net/vxlan.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index d76dfed..3b45fe4 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1125,11 +1125,13 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
if (vxlan->default_dst.remote_ip.sa.sa_family != ip.sa.sa_family)
return -EAFNOSUPPORT;
+ err = -EINVAL;
spin_lock_bh(&vxlan->hash_lock);
- err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
- port, src_vni, vni, ifindex,
- ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
- true, extack);
+ if (netif_running(dev) || (ndm->ndm_state & NUD_PERMANENT))
+ err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
+ port, src_vni, vni, ifindex,
+ ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
+ true, extack);
spin_unlock_bh(&vxlan->hash_lock);
return err;
--
1.9.1
Powered by blists - more mailing lists