From patchwork Mon Oct 11 11:24:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Barthe X-Patchwork-Id: 1539263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=f9PMEJQ4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HSc1y3hfZz9sPB for ; Mon, 11 Oct 2021 22:26:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4r4Sb/JBoiCCYQhll7K6GeLjzwdqtAcorRDWO/R1QMM=; b=f9PMEJQ4LpBcBK jv3nrIlXpcdw5+4NZuqdIatNMsdB8Q+Z5YlDbfpt2tW3AAOWbB45HVcqzV1PfzVcSR9L1+/xhwO+t WJGhNeM0CvHVa3RSuIRvnlOiIToXhKXjYBXPfV8jpIm6IFt9ZsM0CB/Ua+d55pd8bOUFSQbnbYbQN Jy1HEiHuf+v4l40xhF9WXimfsSMqVkLUzEXTVJ1FuM05HYcYnCROLF+GkkYFAoHAadxRgKPwckc73 H9luVqx2V0Yrbi/TarFpk3FUzicbUGwNcxfMsAUH/B/0A6b6DGrEbfNsPtjBd7IXiND3xzMBAUGh5 osn9BZI+I579f0LeSVgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZtR3-0092qg-HB; Mon, 11 Oct 2021 11:25:37 +0000 Received: from mail.auro.re ([45.66.111.62]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZtQm-0092mB-H9 for hostap@lists.infradead.org; Mon, 11 Oct 2021 11:25:22 +0000 Received: from host0.inf.red.net (unknown [45.66.109.190]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.auro.re (Postfix) with ESMTPSA id 0E836A7B; Mon, 11 Oct 2021 13:24:46 +0200 (CEST) From: Tom Barthe To: hostap@lists.infradead.org Cc: Tom Barthe Subject: [PATCH 5/7] Add default_radius_vlan in sta_info Date: Mon, 11 Oct 2021 13:24:35 +0200 Message-Id: <20211011112437.178673-6-jeltz+hostap@auro.re> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211011112437.178673-1-jeltz+hostap@auro.re> References: <20211011112437.178673-1-jeltz+hostap@auro.re> MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_042520_736785_C2C7D455 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Used to store the vlan_description corresponding to RADIUS tag 0. Signed-off-by: Tom Barthe --- src/ap/ieee802_11.c | 15 + src/ap/sta_info.h | 3 ++- 2 files changed, 3 insertions(+), 15 deletions(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Used to store the vlan_description corresponding to RADIUS tag 0. Signed-off-by: Tom Barthe --- src/ap/ieee802_11.c | 15 +-------------- src/ap/sta_info.h | 3 ++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 71fbefc8e..7229011b7 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -2326,20 +2326,7 @@ ieee802_11_set_radius_info(struct hostapd_data *hapd, struct sta_info *sta, char *identity = info->identity; char *radius_cui = info->radius_cui; - if (vlan_id->notempty && - !hostapd_vlan_valid(hapd->conf->vlan, vlan_id)) { - hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, - HOSTAPD_LEVEL_INFO, - "Invalid VLAN %d%s received from RADIUS server", - vlan_id->untagged, - vlan_id->tagged[0] ? "+" : ""); - return -1; - } - if (ap_sta_set_vlan(hapd, sta, vlan_id) < 0) - return -1; - if (sta->vlan_id) - hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS, - HOSTAPD_LEVEL_INFO, "VLAN ID %d", sta->vlan_id); + sta->default_radius_vlan = *vlan_id; hostapd_free_psk_list(sta->psk); if (hapd->conf->wpa_psk_radius != PSK_RADIUS_IGNORED) diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index 27e72f9a0..fc165f5d5 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -200,8 +200,9 @@ struct sta_info { int vlan_id; /* 0: none, >0: VID */ struct vlan_description *vlan_desc; int vlan_id_bound; /* updated by ap_sta_bind_vlan() */ - /* PSKs from RADIUS authentication server */ + /* PSKs from RADIUS authentication server */ struct hostapd_sta_wpa_psk_short *psk; + struct vlan_description default_radius_vlan; char *identity; /* User-Name from RADIUS */ char *radius_cui; /* Chargeable-User-Identity from RADIUS */