{"id":810795,"url":"http://patchwork.ozlabs.org/api/1.2/patches/810795/?format=json","web_url":"http://patchwork.ozlabs.org/project/hostap/patch/20170906205834.13224-1-greearb@candelatech.com/","project":{"id":22,"url":"http://patchwork.ozlabs.org/api/1.2/projects/22/?format=json","name":"HostAP Development","link_name":"hostap","list_id":"hostap.lists.infradead.org","list_email":"hostap@lists.infradead.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170906205834.13224-1-greearb@candelatech.com>","list_archive_url":null,"date":"2017-09-06T20:58:34","name":"Hacks to build on Fedora-26.","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2e00eb926c48454d6b0f2379562bd1aeb2d762d1","submitter":{"id":852,"url":"http://patchwork.ozlabs.org/api/1.2/people/852/?format=json","name":"Ben Greear","email":"greearb@candelatech.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/hostap/patch/20170906205834.13224-1-greearb@candelatech.com/mbox/","series":[{"id":1879,"url":"http://patchwork.ozlabs.org/api/1.2/series/1879/?format=json","web_url":"http://patchwork.ozlabs.org/project/hostap/list/?series=1879","date":"2017-09-06T20:58:34","name":"Hacks to build on Fedora-26.","version":1,"mbox":"http://patchwork.ozlabs.org/series/1879/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/810795/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/810795/checks/","tags":{},"related":[],"headers":{"Return-Path":"<hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"oO0bTEAI\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnbYm68fBz9ryT\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 06:59:40 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dphPj-0007nm-MO; Wed, 06 Sep 2017 20:59:11 +0000","from mail2.candelatech.com ([208.74.158.173])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dphPY-0007dd-8n\n\tfor hostap@lists.infradead.org; Wed, 06 Sep 2017 20:59:09 +0000","from v-f26-64.candelatech.com (firewall.candelatech.com\n\t[50.251.239.81])\n\tby mail2.candelatech.com (Postfix) with ESMTP id 28F27409E08;\n\tWed,  6 Sep 2017 13:58:39 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:\n\tSubject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:\n\tReferences:List-Owner; bh=1uzoFI8ke2Xf6mXclSLxs8dPJvyY5nn1MuTEoE4mNmo=;\n\tb=oO0\n\tbTEAI6iIcNDR/ju1ykZDB3MDQbWX1liWFl5GHACRJLTA2fLfLE5XwEsz2T7RbHaWZGuIOwZg0dIca\n\tddBqrwBrXmjN43Uyl/z8dVMvkNamQsKALYQ7uvBg7KsS/ETypsu/8VtUiN/BLus4RgwJhMSKCtS8n\n\tXqxCQwIaDnj/xWy8vJYSm5yvI/8c9N6WM038Ghaw6na2P61rMoNVeN5VH4EF5vo63ZIa5Hu49cOcG\n\tKwa4Cu5LfpYsLLPeWcaqJ0sS3MT2BvcYzX/vPdZFAHnKzvNx3DffFqk/M72MZFdFw5xS+3OXOaxBO\n\tdwoCOi5iftLaGlYhqSUOF8hMXue8foA==;","From":"greearb@candelatech.com","To":"hostap@lists.infradead.org","Subject":"[PATCH] Hacks to build on Fedora-26.","Date":"Wed,  6 Sep 2017 13:58:34 -0700","Message-Id":"<20170906205834.13224-1-greearb@candelatech.com>","X-Mailer":"git-send-email 2.13.5","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170906_135900_557875_D7FDC488 ","X-CRM114-Status":"GOOD (  10.20  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"hostap@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<hostap.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/hostap>,\n\t<mailto:hostap-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/hostap/>","List-Post":"<mailto:hostap@lists.infradead.org>","List-Help":"<mailto:hostap-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/hostap>,\n\t<mailto:hostap-request@lists.infradead.org?subject=subscribe>","Cc":"Ben Greear <greearb@candelatech.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"Hostap\" <hostap-bounces@lists.infradead.org>","Errors-To":"hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"From: Ben Greear <greearb@candelatech.com>\n\nThe compiler on Fedora-26 has gotten pickier about some things.\nThe issues it complains about seem real, but I guess they do not\nhappen in practice or someone one have noticed already.\n\nSigned-off-by: Ben Greear <greearb@candelatech.com>\n---\n src/drivers/driver_hostap.c          | 11 ++++++++---\n src/drivers/driver_nl80211.c         |  5 ++++-\n src/drivers/driver_nl80211_monitor.c |  4 ++--\n 3 files changed, 14 insertions(+), 6 deletions(-)","diff":"diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c\nindex 597da335e..218020250 100644\n--- a/src/drivers/driver_hostap.c\n+++ b/src/drivers/driver_hostap.c\n@@ -217,6 +217,7 @@ static int hostap_init_sockets(struct hostap_driver_data *drv, u8 *own_addr)\n {\n \tstruct ifreq ifr;\n \tstruct sockaddr_ll addr;\n+\tchar buf[32];\n \n \tdrv->sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));\n \tif (drv->sock < 0) {\n@@ -231,7 +232,9 @@ static int hostap_init_sockets(struct hostap_driver_data *drv, u8 *own_addr)\n \t}\n \n         memset(&ifr, 0, sizeof(ifr));\n-        snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), \"%sap\", drv->iface);\n+        snprintf(buf, sizeof(buf), \"%sap\", drv->iface);\n+        os_strlcpy(ifr.ifr_name, buf, sizeof(ifr.ifr_name));\n+\n         if (ioctl(drv->sock, SIOCGIFINDEX, &ifr) != 0) {\n \t\twpa_printf(MSG_ERROR, \"ioctl(SIOCGIFINDEX): %s\",\n \t\t\t   strerror(errno));\n@@ -346,9 +349,11 @@ static int hostap_set_iface_flags(void *priv, int dev_up)\n {\n \tstruct hostap_driver_data *drv = priv;\n \tstruct ifreq ifr;\n-\tchar ifname[IFNAMSIZ];\n+\tchar ifname[IFNAMSIZ + 10];\n+\n+\tos_snprintf(ifname, sizeof(ifname), \"%sap\", drv->iface);\n+\tifname[IFNAMSIZ - 1] = 0;\n \n-\tos_snprintf(ifname, IFNAMSIZ, \"%sap\", drv->iface);\n \tif (linux_set_iface_flags(drv->ioctl_sock, ifname, dev_up) < 0)\n \t\treturn -1;\n \ndiff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c\nindex 0271f960c..ffec533e1 100644\n--- a/src/drivers/driver_nl80211.c\n+++ b/src/drivers/driver_nl80211.c\n@@ -6398,8 +6398,11 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,\n \tstruct i802_bss *bss = priv;\n \tstruct wpa_driver_nl80211_data *drv = bss->drv;\n \tchar name[IFNAMSIZ + 1];\n+\tchar tmp[34]; /* make F-26 gcc stop complaining about size of snprintf destination */\n+\n+\tos_snprintf(tmp, sizeof(tmp), \"%s.sta%d\", bss->ifname, aid);\n+\tos_strlcpy(name, tmp, sizeof(name));\n \n-\tos_snprintf(name, sizeof(name), \"%s.sta%d\", bss->ifname, aid);\n \tif (ifname_wds)\n \t\tos_strlcpy(ifname_wds, name, IFNAMSIZ + 1);\n \ndiff --git a/src/drivers/driver_nl80211_monitor.c b/src/drivers/driver_nl80211_monitor.c\nindex 28a99f274..e7ea023a2 100644\n--- a/src/drivers/driver_nl80211_monitor.c\n+++ b/src/drivers/driver_nl80211_monitor.c\n@@ -340,7 +340,7 @@ void nl80211_remove_monitor_interface(struct wpa_driver_nl80211_data *drv)\n \n int nl80211_create_monitor_interface(struct i802_bss *bss, struct wpa_driver_nl80211_data *drv)\n {\n-\tchar buf[IFNAMSIZ];\n+\tchar buf[IFNAMSIZ + 20];\n \tstruct sockaddr_ll ll;\n \tint optval;\n \tsocklen_t optlen;\n@@ -362,7 +362,7 @@ int nl80211_create_monitor_interface(struct i802_bss *bss, struct wpa_driver_nl8\n \t\tsnprintf(buf, IFNAMSIZ, \"mon-%s\", drv->first_bss->ifname + 4);\n \t} else {\n \t\t/* Non-P2P interface with AP functionality. */\n-\t\tsnprintf(buf, IFNAMSIZ, \"mon.%s\", drv->first_bss->ifname);\n+\t\tsnprintf(buf, sizeof(buf), \"mon.%s\", drv->first_bss->ifname);\n \t}\n \n \tbuf[IFNAMSIZ - 1] = '\\0';\n","prefixes":[]}