From nobody Mon Jul 22 10:02:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSG6S64Mlz5QM39; Mon, 22 Jul 2024 10:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSG6S2ghcz4dpH; Mon, 22 Jul 2024 10:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721642544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1OSkzY0hoM7Vr+LsAJHohNeF7HMjwcXzAklojhP0Lg=; b=ggj30g/31gP0ul5x1Fyg2BkQfoHi8hIEj5RV+2ldN/yWZovSCrVKBWd9YpbosODGN2+sPS ql+F8jFMCZuxky01o1eNkgybjzD8nhRrgoV3iUbINkzVjlemyDp7bGKLqSCUo+WEq98eDO iC27qXPxtXlVhXQlDtiXrsVweX+YJrZNBSS6yj/a4cTdw6IaxoyHGDplycZNN35GWT3VtC sxCQ42gI/7QKqYZFQbELudYDMPxIWJ9FZzGWHYDKJEs48/RRhPqU6QmD2cTPxSmS7o4Oua Gip7SfkWzFR98X72VGxCS15GmwQtgKeXYQRob+uaiNv9ps69TxDiVGXutcy6Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721642544; a=rsa-sha256; cv=none; b=vq2PYiTPeB9XoTrgjeemA08eU60uexwVxTPjvO4I1QdJnfyrBe28m8SMpRgj+VzCLfnrLz tmk+TkdI+HN+fkLWnUsBNauBqSN2DCg1HKRYvLe6h72/R659jHG3Hp4u4ryR2L32WJQtlH sy5dvqARIHWvWawlll71q/upJ3VlO5+7/MotyQbpXiAP/V74QYMZxhI/wqOOjNrjGS0Z3q CJQRiJAyAxJarc4Bla4d4VEw/6CScXW7BOKL5weC84TIz+XT5/WfKsb6hS69cnUfeh5Bue 1H0W0dFtAUv0KBUQKGM4Ea7vPevJDn2rto6HBoGQkFmaeuhPEMwHtqXAJhOTdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721642544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1OSkzY0hoM7Vr+LsAJHohNeF7HMjwcXzAklojhP0Lg=; b=FTR0M8WZ/KR6OE1J2evJOdnU/ZN1xFWTpP682w056nm1eiV8yBFaQF98l+5NEPb8XBgl4R uteHpZzCO4ceNFFG0JbS/TS6D5mLOM6zHa79+SfuG/HWJ1aUHv39nNLMu9/wXWbBufproW /5lmDJOHucOZsv8Q1MkZlU99ANqsMLSY+qXFojrkA9+3dbSJvf5VgxkTsSPkCOczbVIr5+ /v2zmROq3b6YEBaZFrL4uqJGEQFx+xGggcdSNs5Yl5nw11QdU6frtdO+qTgx1RyraIql5s sl+5eg0aJmCSElFONaVtqEhnW1iZ8i0pQFtveAouSehpNhC6Gybp2GKLm6ZxXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSG6S2HzYzgjd; Mon, 22 Jul 2024 10:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MA2Odb042295; Mon, 22 Jul 2024 10:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MA2OST042292; Mon, 22 Jul 2024 10:02:24 GMT (envelope-from git) Date: Mon, 22 Jul 2024 10:02:24 GMT Message-Id: <202407221002.46MA2OST042292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: bb8fa2ef83c9 - main - sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb8fa2ef83c91d4bd5538f4f445b4100ac141419 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8fa2ef83c91d4bd5538f4f445b4100ac141419 commit bb8fa2ef83c91d4bd5538f4f445b4100ac141419 Author: Konrad Witaszczyk AuthorDate: 2024-06-28 10:28:55 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 09:58:37 +0000 sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq structure object, as its argument. Reviewed by: brooks, jhb, oshogbo Approved by: oshogbo (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D46017 --- sbin/nos-tun/nos-tun.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sbin/nos-tun/nos-tun.c b/sbin/nos-tun/nos-tun.c index f3af62db265b..ca0e33b2509a 100644 --- a/sbin/nos-tun/nos-tun.c +++ b/sbin/nos-tun/nos-tun.c @@ -141,7 +141,7 @@ tun_open(char *dev_name, struct sockaddr *ouraddr, char *theiraddr) * when tunN have no addresses, so - log and ignore it. * */ - if (ioctl(s, SIOCDIFADDR, &ifra) < 0) { + if (ioctl(s, SIOCDIFADDR, &ifrq) < 0) { syslog(LOG_ERR,"SIOCDIFADDR - %m"); } @@ -220,10 +220,8 @@ Finish(int signum) /* * Delete addresses for interface */ - bzero(&ifra.ifra_addr, sizeof(ifra.ifra_addr)); - bzero(&ifra.ifra_broadaddr, sizeof(ifra.ifra_addr)); - bzero(&ifra.ifra_mask, sizeof(ifra.ifra_addr)); - if (ioctl(s, SIOCDIFADDR, &ifra) < 0) { + bzero(&ifrq.ifr_addr, sizeof(ifrq.ifr_addr)); + if (ioctl(s, SIOCDIFADDR, &ifrq) < 0) { syslog(LOG_ERR,"can't delete interface's addresses - %m"); } closing_fds: