diff mbox

[RFC,2/5] net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces

Message ID 1440543015-14693-3-git-send-email-f.fainelli@gmail.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Florian Fainelli Aug. 25, 2015, 10:50 p.m. UTC
IFF_L2_ONLY interfaces are Layer-2 only and do not support configuration
of IPv4 addresses, nor the full IPv4 protocol stack. Do nothing for
these interfaces.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/ipv4/devinet.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2d9cb1748f81..30068754e821 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1383,6 +1383,9 @@  static int inetdev_event(struct notifier_block *this, unsigned long event,
 	ASSERT_RTNL();
 
 	if (!in_dev) {
+		if (dev->flags & IFF_L2_ONLY)
+			goto out;
+
 		if (event == NETDEV_REGISTER) {
 			in_dev = inetdev_init(dev);
 			if (IS_ERR(in_dev))