From patchwork Fri Sep 30 13:21:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16717 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 97B9282FFB; Fri, 30 Sep 2016 15:22:25 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=FjVN1q/6; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=2a00:1450:400c:c09::231; helo=mail-wm0-x231.google.com; envelope-from=sven.eckelmann@open-mesh.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) by open-mesh.org (Postfix) with ESMTPS id C66B282FE5 for ; Fri, 30 Sep 2016 15:21:20 +0200 (CEST) Received: by mail-wm0-x231.google.com with SMTP id b4so47178454wmb.0 for ; Fri, 30 Sep 2016 06:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JHwR1kr/CjPTfFlA7vPJ7zkAkLH/mHvYrecMBFR3s4w=; b=FjVN1q/6s194IsP0TO/FUoPkUQbB3V4WE/XYoezSppAY+eE0Hc1Vy6VCCidSCLA9Ae gglKP04Lsh+eS6WBkCp+pIh1weMvoIOdzIZ3KhY3AyIlsGkxpa+a0hiJQ5PbREu0AXHt vsBWXnLiOOmoKcb3he60dPx+VtDX2w6tqOJXfqmBL+WHtAMedZtVOiwiOy4FzCbhHuZx TMst7dhmbe54iAWOHoIt83GX6X+FOmWdDxvzK1EfvvdPMStbab1ZYarBQGuYGkW278zF hDhZYRNchWtI0q/MYyFkanX4BpEmyCsq7juUKBuJ9m4mrrab3N05QkIFaCBJrcpXUMqG dl3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JHwR1kr/CjPTfFlA7vPJ7zkAkLH/mHvYrecMBFR3s4w=; b=hLQ+yacodE6H6c9GdpKShxagBAsk084B8kSC8Hc1/Ct+rFEjILrd68RSaXH9unJzeO LXJxR2IaHnIYzGOrcS7Ow9NUpQ75EzWQy+bEnAZIaaXvYsAi9fayzF82aNB0lOBkR68B KUSdioUe7c3Il9VYUjaYCeu1lyTwwYXJR+VdlyIwuuSvR1fuq2VFs18AebXYn2x8a4+1 GMprX4icRPQfuTT0gL7jfpGlrYtTyqJMfSW18Dw84rralH5z3cJuQ/ZUH2a8Hrr34082 TP1mWmntiGBghKjruYwOIRGhurqJ9ybcB6dm90F8Ma4nfK1EmJ+j9clttXjXvBD6W6nR DdFQ== X-Gm-Message-State: AA6/9RkvG7XNN2lXDUDvEhJyxf00evJcviOnOTvsHeKX2tp3KTS6HCwtIWAXSoPgoZbgHrQR X-Received: by 10.28.141.133 with SMTP id p127mr4059984wmd.119.1475241680230; Fri, 30 Sep 2016 06:21:20 -0700 (PDT) Received: from sven-desktop.home.narfation.org ([2003:7c:6f50:97fe:cb62:b774:4c7c:7c8d]) by smtp.gmail.com with ESMTPSA id e12sm4116399wmg.17.2016.09.30.06.21.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Sep 2016 06:21:19 -0700 (PDT) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 30 Sep 2016 15:21:06 +0200 Message-Id: <20160930132106.5798-7-sven.eckelmann@open-mesh.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <2666783.nl87Kib46y@bentobox> References: <2666783.nl87Kib46y@bentobox> Cc: Sven Eckelmann Subject: [B.A.T.M.A.N.] [PATCH v2 7/7] batman-adv: Update wifi flags on upper link change X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Things like VLANs don't have their link set when they are created. Thus the wifi flags have to be evaluated later to fix their contents for the link interface. Signed-off-by: Sven Eckelmann --- v2: - new patch --- compat-include/linux/netdevice.h | 2 ++ net/batman-adv/hard-interface.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index fb5b519..e71e614 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -43,6 +43,8 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) +#define NETDEV_CHANGEUPPER 0x0015 + #define netdev_notifier_info_to_dev(ptr) ptr #endif /* < KERNEL_VERSION(3, 11, 0) */ diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 7d336e1..400935f 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -954,6 +954,11 @@ static int batadv_hard_if_event(struct notifier_block *this, if (hard_iface == primary_if) batadv_primary_if_update_addr(bat_priv, NULL); break; + case NETDEV_CHANGEUPPER: + hard_iface->wifi_flags = batadv_wifi_flags_evaluate(net_dev); + if (batadv_is_wifi_hardif(hard_iface)) + hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS; + break; default: break; }