Skip to contentSkip to conversation

ip6_pol_route panic: Do not allow VLAN on loopback

PATCH Applied Krishna Kumar 2 participants 3 messages Apr 14, 2011 – Apr 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip6_pol_route panic: Do not allow VLAN on loopback

I have tested two ways of fixing this panic:
1. PATCH1: Do not allow vlan on lo.
2. PATCH2: Do not propagate LOOPBACK to vlan devices.

Isn't it better to use PATCH1 and disallow vlan on lo?

The result of this patch is:

# modprobe 8021q
# vconfig add lo 43
ERROR: trying to add VLAN #43 to IF -:lo:-  error: Operation not supported
---
 drivers/net/loopback.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/loopback.c +2 -1
diff -ruNp org/drivers/net/loopback.c new1/drivers/net/loopback.c
@@ -173,7 +173,8 @@ static void loopback_setup(struct net_de
 		| NETIF_F_RXCSUM
 		| NETIF_F_HIGHDMA
 		| NETIF_F_LLTX
-		| NETIF_F_NETNS_LOCAL;
+		| NETIF_F_NETNS_LOCAL
+		| NETIF_F_VLAN_CHALLENGED;
 	dev->ethtool_ops	= &loopback_ethtool_ops;
 	dev->header_ops		= &eth_header_ops;
 	dev->netdev_ops		= &loopback_ops;
#1 lore raw

PATCH v2 1/1 ip6_pol_route panic: Do not propagate LOOPBACK to VLAN

I have tested two ways of fixing this panic:
1. PATCH1: Do not allow vlan on lo.
2. PATCH2: Do not propagate LOOPBACK to vlan devices.

Isn't it better to use PATCH1 and disallow vlan on lo?

The result of this patch is:

# modprobe 8021q
# vconfig add lo 43
# ifconfig lo.69 hw ether 00:80:48:BA:d1:30
# ping6 -c 3 fe80::280:48ff:feba:d130
connect: Cannot assign requested address
(no panic)
---
 net/8021q/vlan_dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/8021q/vlan_dev.c +2 -1
diff -ruNp org/net/8021q/vlan_dev.c new2/net/8021q/vlan_dev.c
@@ -525,7 +525,8 @@ static int vlan_dev_init(struct net_devi
 
 	/* IFF_BROADCAST|IFF_MULTICAST; ??? */
 	dev->flags  = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
-					  IFF_MASTER | IFF_SLAVE);
+					  IFF_MASTER | IFF_SLAVE |
+					  IFF_LOOPBACK);
 	dev->iflink = real_dev->ifindex;
 	dev->state  = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
 					  (1<<__LINK_STATE_DORMANT))) |
maintainer Applied
#2 lore raw
In reply to Krishna Kumar

From: Krishna Kumar <[email protected]>
Date: Thu, 14 Apr 2011 21:37:04 +0530

Quoted 6 lines

I have tested two ways of fixing this panic:
1. PATCH1: Do not allow vlan on lo.
2. PATCH2: Do not propagate LOOPBACK to vlan devices.

Isn't it better to use PATCH1 and disallow vlan on lo?

Quoted 7 lines

The result of this patch is:

# modprobe 8021q
# vconfig add lo 43
ERROR: trying to add VLAN #43 to IF -:lo:-  error: Operation not supported

I applied this patch #1, and added some commentary to the commit message to explain the ipv6 crash issue this fixes.

Thanks.