[openssh-commits] [openssh] 02/02: wrap a declaration in the same ifdefs as its use

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Aug 4 15:30:39 AEST 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 32c63e75a70a0ed9d6887a55fcb0e4531a6ad617
Author: Damien Miller <djm at mindrot.org>
Date:   Tue Aug 4 14:59:21 2020 +1000

    wrap a declaration in the same ifdefs as its use
    
    avoids warnings on NetBSD
---
 openbsd-compat/port-net.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c
index 617bffce..d7d8c6fa 100644
--- a/openbsd-compat/port-net.c
+++ b/openbsd-compat/port-net.c
@@ -209,8 +209,11 @@ sys_tun_open(int tun, int mode, char **ifname)
 {
 	struct ifreq ifr;
 	char name[100];
-	int fd = -1, sock, flag;
+	int fd = -1, sock;
 	const char *tunbase = "tun";
+#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF)
+	int flag;
+#endif
 
 	if (ifname != NULL)
 		*ifname = NULL;
@@ -247,8 +250,8 @@ sys_tun_open(int tun, int mode, char **ifname)
 	}
 
 	/* Turn on tunnel headers */
+#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF)
 	flag = 1;
-#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF)
 	if (mode != SSH_TUNMODE_ETHERNET &&
 	    ioctl(fd, TUNSIFHEAD, &flag) == -1) {
 		debug("%s: ioctl(%d, TUNSIFHEAD, 1): %s", __func__, fd,

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list