diff mbox series

[net-next] net: Removed the device type check to add mpls support for devices

Message ID 1595835559-2797-1-git-send-email-martinvarghesenokia@gmail.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] net: Removed the device type check to add mpls support for devices | expand

Commit Message

Martin Varghese July 27, 2020, 7:39 a.m. UTC
From: Martin Varghese <martin.varghese@nokia.com>

MPLS has no dependency with the device type of underlying devices.
Hence the device type check to add mpls support for devices can be
avoided.

Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
---
 net/mpls/af_mpls.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

Comments

David Miller July 27, 2020, 6:41 p.m. UTC | #1
From: Martin Varghese <martinvarghesenokia@gmail.com>
Date: Mon, 27 Jul 2020 13:09:19 +0530

> From: Martin Varghese <martin.varghese@nokia.com>
> 
> MPLS has no dependency with the device type of underlying devices.
> Hence the device type check to add mpls support for devices can be
> avoided.
> 
> Signed-off-by: Martin Varghese <martin.varghese@nokia.com>

Applied, thanks for following up on this.
diff mbox series

Patch

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index fd30ea61336e..6fdd0c9f865a 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1584,21 +1584,10 @@  static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
 	unsigned int flags;
 
 	if (event == NETDEV_REGISTER) {
+		mdev = mpls_add_dev(dev);
+		if (IS_ERR(mdev))
+			return notifier_from_errno(PTR_ERR(mdev));
 
-		/* For now just support Ethernet, IPGRE, IP6GRE, SIT and
-		 * IPIP devices
-		 */
-		if (dev->type == ARPHRD_ETHER ||
-		    dev->type == ARPHRD_LOOPBACK ||
-		    dev->type == ARPHRD_IPGRE ||
-		    dev->type == ARPHRD_IP6GRE ||
-		    dev->type == ARPHRD_SIT ||
-		    dev->type == ARPHRD_TUNNEL ||
-		    dev->type == ARPHRD_TUNNEL6) {
-			mdev = mpls_add_dev(dev);
-			if (IS_ERR(mdev))
-				return notifier_from_errno(PTR_ERR(mdev));
-		}
 		return NOTIFY_OK;
 	}