Skip to content

Commit

Permalink
wrap a declaration in the same ifdefs as its use
Browse files Browse the repository at this point in the history
avoids warnings on NetBSD
  • Loading branch information
djmdjm committed Aug 4, 2020
1 parent c9e3be9 commit 32c63e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openbsd-compat/port-net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -247,8 +250,8 @@ sys_tun_open(int tun, int mode, char **ifname)
}

/* Turn on tunnel headers */
flag = 1;
#if defined(TUNSIFHEAD) && !defined(SSH_TUN_PREPEND_AF)
flag = 1;
if (mode != SSH_TUNMODE_ETHERNET &&
ioctl(fd, TUNSIFHEAD, &flag) == -1) {
debug("%s: ioctl(%d, TUNSIFHEAD, 1): %s", __func__, fd,
Expand Down

0 comments on commit 32c63e7

Please sign in to comment.