stun

simple point to point tunnel
git clone git://git.2f30.org/stun
Log | Files | Refs | README

commit 23900e2d9107cdff383462c2e00f99886baecbd5
parent a23323bdc549ce578e86d86cdb9745738e7bf52c
Author: sin <sin@2f30.org>
Date:   Tue, 22 Mar 2016 14:53:14 +0000

no need for ret

Diffstat:
Mstun.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/stun.c b/stun.c @@ -176,7 +176,7 @@ int opentun(char *tundev) { struct ifreq ifr; - int ret, fd, s; + int fd, s; fd = open("/dev/net/tun", O_RDWR); if (fd < 0) @@ -186,8 +186,7 @@ opentun(char *tundev) ifr.ifr_flags = IFF_TUN | IFF_NO_PI; strncpy(ifr.ifr_name, tundev, IFNAMSIZ); ifr.ifr_name[IFNAMSIZ - 1] = '\0'; - ret = ioctl(fd, TUNSETIFF, &ifr); - if (ret < 0) + if (ioctl(fd, TUNSETIFF, &ifr) < 0) logerr("failed to set TUNSETIFF on %s", tundev); /* dummy socket so we can manipulate the params */ @@ -195,8 +194,7 @@ opentun(char *tundev) if (s < 0) logerr("failed to create socket"); ifr.ifr_mtu = MTU; - ret = ioctl(s, SIOCSIFMTU, &ifr); - if (ret < 0) + if (ioctl(s, SIOCSIFMTU, &ifr) < 0) logerr("failed to set MTU on %s", tundev); close(s);