From patchwork Tue Apr 24 02:55:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 903249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mhr5xXOE"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40VSd71c9bz9rx7 for ; Tue, 24 Apr 2018 12:55:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 53790481; Tue, 24 Apr 2018 02:55:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 3EA96407; Tue, 24 Apr 2018 02:55:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CBA796F4; Tue, 24 Apr 2018 02:55:37 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id e80-v6so8851637oig.11; Mon, 23 Apr 2018 19:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9YZrtCe8cxf3S6qDa30vtMUGCvGyic7ZDpEsoEsvB0k=; b=mhr5xXOErA/8VYo5Eohh+vfCR/4gz/JGflpiR+Nme5LlLbBAODY6ZicSIde57yG9ua 66klGbHQ2km7LOhL6x/7yajtVtISOS1u6IhhP/WqY2DR2G++fBhF1weEIBs9CoIC8rGN FPTPt+ny7OnTmNQ3SroQ61HS6oVGrT/8FphWeaTiTkRKMZlkVnBcEEc/kuY1DXPWn5lu +OlenQXUCNdOle5EUQsykLzZN6u6EU64xTG9npZ0YZlXoO3zOhVLjd+GOHNLzYSd8LpX GGcaBbqIyMC1TAs9RgAz4n3pdAgpFpJOCbnGEyjcgDIKXj2cVMxnKq5k1u0LPfmHnNyC x3cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9YZrtCe8cxf3S6qDa30vtMUGCvGyic7ZDpEsoEsvB0k=; b=Ys6nka/J8KEx8QfmmAf5GfO1uP569tZwnXSiwCWoQ5HvZEzBQ6AJUypUEUInpsPIP8 AZWvPSUPTYKkW85hVz9ZoqVw99MU3fxziBBRSmtbGFjGrcK0S0flgSrMKMDPh+X/nDcS axOu04bCdtABUULR+O2rNVE3UBJl8HWPVhsMtH6Ba12ZqpAeHMSSx0jbjZ78ArP/xey6 P4f86LdBvaVtkf+/mUrHRKx0+aX6hgY/FaYsNAltOeqDlNvnQbMlk1LhQlQrBGg79Ng4 Z9uwZRSjJfW4wxwIO6BvxXBgVnaG85/rxunYJy6MYqC6zGFv8wFe9frTi13Fj6Ox28Cp A/aQ== X-Gm-Message-State: ALQs6tBfc6oMlCT0e8cHVeFL/pO6DjjwCI8WdJ7yDRtkwn5o9/IGTARa a9WSe2v2iHI8D0qELXkVtRmkcotwZ5nPzTKT0wR1S9mB X-Google-Smtp-Source: AIpwx4+iZyN0JQ+FsLsWb4FZHmr/jvyhMmbCPz/4uY2QaWq0EHcrtXQbXU20XsUNSwS+kjVso2Tyk8L3FRkvEJHGUGU= X-Received: by 2002:aca:ea82:: with SMTP id i124-v6mr15207610oih.82.1524538536924; Mon, 23 Apr 2018 19:55:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.146.137 with HTTP; Mon, 23 Apr 2018 19:55:36 -0700 (PDT) From: Tonghao Zhang Date: Tue, 24 Apr 2018 10:55:36 +0800 Message-ID: To: ovs dev , ovs-discuss@openvswitch.org, Ben Pfaff X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] interface mac setting X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org One question, why now ovs can only set the mac of internal interface, for example: ovs-vsctl set Interface p1 type=internal mac=\"00:11:22:33:44:55\" ovs-vsctl get Interface p1 mac_in_use And the doc about 'mac' is not explained, why we cannot set it for other type interface. So it's a bug? } else if (port->cfg->fake_bridge) { diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index d90997e..28dd7f8 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -4416,10 +4416,6 @@ iface_set_mac(const struct bridge *br, const struct port *port, struct iface *if struct eth_addr ea, *mac = NULL; struct iface *hw_addr_iface; - if (strcmp(iface->type, "internal")) { - return; - } - if (iface->cfg->mac && eth_addr_from_string(iface->cfg->mac, &ea)) { mac = &ea;