Subject: [VLAN]: Fix SET_VLAN_INGRESS_PRIORITY_CMD ioctl

From: Patrick McHardy <[email-masked]>
Date: Sat, 03 Nov 2007 13:24:34 +0100

Fix a regression in 2.6.23. Candidate for -stable IMO.

[VLAN]: Fix SET_VLAN_INGRESS_PRIORITY_CMD ioctl

Based on report and patch by Doug Kehn <[email-masked]>:

vconfig returns the following error when attempting to execute the
set_ingress_map command:

vconfig: socket or ioctl error for set_ingress_map: Operation not permitted

In vlan.c, vlan_ioctl_handler for SET_VLAN_INGRESS_PRIORITY_CMD
sets err = -EPERM and calls vlan_dev_set_ingress_priority.
vlan_dev_set_ingress_priority is a void function so err remains
at -EPERM and results in the vconfig error (even though the ingress
map was set).

Fix by setting err = 0 after the vlan_dev_set_ingress_priority call.

Signed-off-by: Patrick McHardy <[email-masked]>

---
commit db0d1d928ecdbd1a0c3f6d806c84b4f28a7af0e4
tree 4103b5a3a2dfa353cc4f1617729983650cfdd61a
parent 3743b5898464963ad2b169e3f487205b12fef472
author Patrick McHardy <[email-masked]> Fri, 02 Nov 2007 18:59:39 +0100
committer Patrick McHardy <[email-masked]> Fri, 02 Nov 2007 18:59:39 +0100

 net/8021q/vlan.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 3fe4fc8..1037748 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -747,6 +747,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
 		vlan_dev_set_ingress_priority(dev,
 					      args.u.skb_priority,
 					      args.vlan_qos);
+		err = 0;
 		break;
 
 	case SET_VLAN_EGRESS_PRIORITY_CMD: