From patchwork Tue Dec 1 11:21:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McHardy X-Patchwork-Id: 39896 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id CE884B6EF6 for ; Tue, 1 Dec 2009 22:21:47 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbZLALVg (ORCPT ); Tue, 1 Dec 2009 06:21:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753167AbZLALVg (ORCPT ); Tue, 1 Dec 2009 06:21:36 -0500 Received: from stinky.trash.net ([213.144.137.162]:41060 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbZLALVf (ORCPT ); Tue, 1 Dec 2009 06:21:35 -0500 Received: from [192.168.0.100] (unknown [78.42.107.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stinky.trash.net (Postfix) with ESMTPSA id B2033B2C40; Tue, 1 Dec 2009 12:21:40 +0100 (MET) Message-ID: <4B14FC43.5010501@trash.net> Date: Tue, 01 Dec 2009 12:21:39 +0100 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Stephen Hemminger CC: Linux Netdev List Subject: iplink_vlan: add support for VLAN loose binding flag X-Enigmail-Version: 0.95.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds support for the VLAN loose binding flag that is supported in net-next to iplink_vlan. commit 870970deb6cbea7a5d4881bdd717304d5284d315 Author: Patrick McHardy Date: Tue Dec 1 12:21:15 2009 +0100 iplink_vlan: add support for VLAN loose binding flag Signed-off-by: Patrick McHardy diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 2dc4a57..329b354 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -33,6 +33,7 @@ enum vlan_ioctl_cmds { enum vlan_flags { VLAN_FLAG_REORDER_HDR = 0x1, VLAN_FLAG_GVRP = 0x2, + VLAN_FLAG_LOOSE_BINDING = 0x4, }; enum vlan_name_types { diff --git a/ip/iplink_vlan.c b/ip/iplink_vlan.c index 9724482..223feb3 100644 --- a/ip/iplink_vlan.c +++ b/ip/iplink_vlan.c @@ -27,6 +27,7 @@ static void explain(void) "VLANID := 0-4095\n" "FLAG-LIST := [ FLAG-LIST ] FLAG\n" "FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ]\n" + " [ loose_binding { on | off } ]\n" "QOS-MAP := [ QOS-MAP ] QOS-MAPPING\n" "QOS-MAPPING := FROM:TO\n" ); @@ -102,6 +103,15 @@ static int vlan_parse_opt(struct link_util *lu, int argc, char **argv, flags.flags &= ~VLAN_FLAG_GVRP; else return on_off("gvrp"); + } else if (matches(*argv, "loose_binding") == 0) { + NEXT_ARG(); + flags.mask |= VLAN_FLAG_LOOSE_BINDING; + if (strcmp(*argv, "on") == 0) + flags.flags |= VLAN_FLAG_LOOSE_BINDING; + else if (strcmp(*argv, "off") == 0) + flags.flags &= ~VLAN_FLAG_LOOSE_BINDING; + else + return on_off("loose_binding"); } else if (matches(*argv, "ingress-qos-map") == 0) { NEXT_ARG(); if (vlan_parse_qos_map(&argc, &argv, n, @@ -156,6 +166,7 @@ static void vlan_print_flags(FILE *fp, __u32 flags) } _PF(REORDER_HDR); _PF(GVRP); + _PF(LOOSE_BINDING); #undef _PF if (flags) fprintf(fp, "%x", flags);