From patchwork Wed May 6 11:24:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 468872 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id 365251402C4 for ; Wed, 6 May 2015 21:25:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=fami-braun.de header.i=@fami-braun.de header.b=DqFVMYqd; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B926717C191; Wed, 6 May 2015 07:25:55 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hET6RMkN5zJ0; Wed, 6 May 2015 07:25:55 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1561217C45B; Wed, 6 May 2015 07:25:50 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 59D2117C56B for ; Wed, 6 May 2015 07:24:53 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2BElPO9jLUvQ for ; Wed, 6 May 2015 07:24:47 -0400 (EDT) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.160]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 843E017C569 for ; Wed, 6 May 2015 07:24:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1430911484; l=6602; s=domk; d=fami-braun.de; h=References:In-Reply-To:Subject:To:From:Date:Content-Type: MIME-Version; bh=719n8+aFDA7/WRoaApAERfwm26RgZqdMfCqsfvJsVLI=; b=DqFVMYqdFT6NgJdA+MC5iR3TeafcF8Nax4A3dAELobNnVV0ezZnBz3YNFafgLbK59TJ VQT/aHLwi6sTO7i77YsibVvdHWf8JgIhLQyh/4pdvOtHfqSAAWTQWSyE7ylv9jU7WMsl1 0U3fwAXiBSy5Xy8svsp61ZHBR8ySVZGhaLw= X-RZG-AUTH: :P20JeEWkefDI1ODZs1HHtgV3eF0OpFsRaGIBBWYxhJvJPtnXtogBWnTOo0kWzyWmmLND+Mr2 X-RZG-CLASS-ID: mo00 Received: from dynamic.fami-braun.de (p578E7F62.dip0.t-ipconnect.de [87.142.127.98]) by smtp.strato.de (RZmta 37.5 DYNA|AUTH) with ESMTPSA id j062edr46BOiI8e (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve sect571r1 with 571 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Wed, 6 May 2015 13:24:44 +0200 (CEST) Received: from dynamic.fami-braun.de (localhost [127.0.0.1]) by dynamic.fami-braun.de (fami-braun.de) with ESMTP id 77011154297 for ; Wed, 6 May 2015 13:24:42 +0200 (CEST) Received: from vRy250puRO5qkmYllAoF/r5xiLv0TaJRNCU4RRUcqhg= (FlcDT+Ifqnpkzj2S3dd8cf03UiHB1HCW) by webmail.fami-braun.de with HTTP (HTTP/1.1 POST); Wed, 06 May 2015 13:24:34 +0200 MIME-Version: 1.0 Date: Wed, 06 May 2015 13:24:34 +0200 From: michael-dev To: hostap@lists.shmoo.com Subject: Re: [PATCH 2/2] test: verify correct vlan operation in multi-bss multi-vlan case In-Reply-To: <20150503183712.GB11111@w1.fi> References: <1430118484-30111-1-git-send-email-michael-dev@fami-braun.de> <1430118484-30111-2-git-send-email-michael-dev@fami-braun.de> <20150503183712.GB11111@w1.fi> Message-ID: <4e624bcbcd827e14e284ee4673ee8e98@fami-braun.de> X-Sender: michael-dev@fami-braun.de User-Agent: Roundcube Webmail/1.1.1 X-Virus-Scanned: clamav-milter 0.98.6 at gate X-Virus-Status: Clean X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Am 03.05.2015 20:37, schrieb Jouni Malinen: > Any idea what would be causing this? I already had to add > CONFIG_DUMMY=y > to get even this far, but that did not seem to be enough to make the > test case work for me. you'll need CONFIG_VLAN_8021Q support in the kernel. In addition to this, adding the link could fail if there is another vlan interface around that has the same vid (1) and parent (dummy0) assigned - for example a left over vlan1 interface. Please find attached a patch that prints the error message into the log. I'm running Ubuntu Trusty with mainline 3.19.3 where the testcase works with and without hostapd CONFIG_VLAN_NETLINK set. Regards, M. Braun commit 502a4a98c9c533dfb11b3a37298fc3a6141df68a Author: Michael Braun Date: Wed May 6 13:14:03 2015 +0200 vlan: print libnl error message on vlan_add diff --git a/src/ap/vlan_util.c b/src/ap/vlan_util.c index cc54051..b1facfa 100644 --- a/src/ap/vlan_util.c +++ b/src/ap/vlan_util.c @@ -31,7 +31,7 @@ */ int vlan_add(const char *if_name, int vid, const char *vlan_if_name) { - int ret = -1; + int err, ret = -1; struct nl_sock *handle = NULL; struct nl_cache *cache = NULL; struct rtnl_link *rlink = NULL; @@ -58,21 +58,23 @@ int vlan_add(const char *if_name, int vid, const char *vlan_if_name) goto vlan_add_error; } - if (nl_connect(handle, NETLINK_ROUTE) < 0) { - wpa_printf(MSG_ERROR, "VLAN: failed to connect to netlink"); + if ((err = nl_connect(handle, NETLINK_ROUTE)) < 0) { + wpa_printf(MSG_ERROR, "VLAN: failed to connect to netlink: %s", + nl_geterror(err)); goto vlan_add_error; } - if (rtnl_link_alloc_cache(handle, AF_UNSPEC, &cache) < 0) { + if ((err = rtnl_link_alloc_cache(handle, AF_UNSPEC, &cache)) < 0) { cache = NULL; - wpa_printf(MSG_ERROR, "VLAN: failed to alloc cache"); + wpa_printf(MSG_ERROR, "VLAN: failed to alloc cache: %s", + nl_geterror(err)); goto vlan_add_error; } if (!(if_idx = rtnl_link_name2i(cache, if_name))) { /* link does not exist */ - wpa_printf(MSG_ERROR, "VLAN: interface %s does not exist", - if_name); + wpa_printf(MSG_ERROR, "VLAN: interface %s does not exist: %s", + if_name, nl_geterror(err)); goto vlan_add_error; } @@ -92,23 +94,26 @@ int vlan_add(const char *if_name, int vid, const char *vlan_if_name) goto vlan_add_error; } - if (rtnl_link_set_type(rlink, "vlan") < 0) { - wpa_printf(MSG_ERROR, "VLAN: failed to set link type"); + if ((err = rtnl_link_set_type(rlink, "vlan")) < 0) { + wpa_printf(MSG_ERROR, "VLAN: failed to set link type: %s", + nl_geterror(err)); goto vlan_add_error; } rtnl_link_set_link(rlink, if_idx); rtnl_link_set_name(rlink, vlan_if_name); - if (rtnl_link_vlan_set_id(rlink, vid) < 0) { - wpa_printf(MSG_ERROR, "VLAN: failed to set link vlan id"); + if ((err = rtnl_link_vlan_set_id(rlink, vid)) < 0) { + wpa_printf(MSG_ERROR, "VLAN: failed to set link vlan id: %s", + nl_geterror(err)); goto vlan_add_error; } - if (rtnl_link_add(handle, rlink, NLM_F_CREATE) < 0) { + if ((err = rtnl_link_add(handle, rlink, NLM_F_CREATE)) < 0) { wpa_printf(MSG_ERROR, "VLAN: failed to create link %s for " - "vlan %d on %s (%d)", - vlan_if_name, vid, if_name, if_idx); + "vlan %d on %s (%d): %s", + vlan_if_name, vid, if_name, if_idx, + nl_geterror(err)); goto vlan_add_error; } @@ -127,7 +132,7 @@ vlan_add_error: int vlan_rem(const char *if_name) { - int ret = -1; + int err, ret = -1; struct nl_sock *handle = NULL; struct nl_cache *cache = NULL; struct rtnl_link *rlink = NULL; @@ -140,14 +145,16 @@ int vlan_rem(const char *if_name) goto vlan_rem_error; } - if (nl_connect(handle, NETLINK_ROUTE) < 0) { - wpa_printf(MSG_ERROR, "VLAN: failed to connect to netlink"); + if ((err = nl_connect(handle, NETLINK_ROUTE)) < 0) { + wpa_printf(MSG_ERROR, "VLAN: failed to connect to netlink: %s", + nl_geterror(err)); goto vlan_rem_error; } - if (rtnl_link_alloc_cache(handle, AF_UNSPEC, &cache) < 0) { + if ((err = rtnl_link_alloc_cache(handle, AF_UNSPEC, &cache)) < 0) { cache = NULL; - wpa_printf(MSG_ERROR, "VLAN: failed to alloc cache"); + wpa_printf(MSG_ERROR, "VLAN: failed to alloc cache: %s", + nl_geterror(err)); goto vlan_rem_error; } @@ -158,9 +165,9 @@ int vlan_rem(const char *if_name) goto vlan_rem_error; } - if (rtnl_link_delete(handle, rlink) < 0) { - wpa_printf(MSG_ERROR, "VLAN: failed to remove link %s", - if_name); + if ((err = rtnl_link_delete(handle, rlink)) < 0) { + wpa_printf(MSG_ERROR, "VLAN: failed to remove link %s: %s", + if_name, nl_geterror(err)); goto vlan_rem_error; }