Mercurial > hg > quicktun
comparison src/common.c @ 34:b876afa5a72a
Fixed the build script and FreeBSD tun mode
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Wed, 12 Oct 2011 03:47:18 +0200 |
parents | 422f3582bd38 |
children | a1ec0d6b6f13 |
comparison
equal
deleted
inserted
replaced
33:422f3582bd38 | 34:b876afa5a72a |
---|---|
176 #else | 176 #else |
177 if (!(envval = getconf("INTERFACE"))) envval = "/dev/tun0"; | 177 if (!(envval = getconf("INTERFACE"))) envval = "/dev/tun0"; |
178 if ((ttfd = open(envval, O_RDWR)) < 0) return errorexitp("Could not open tun device file"); | 178 if ((ttfd = open(envval, O_RDWR)) < 0) return errorexitp("Could not open tun device file"); |
179 if ((envval = getconf("TUN_MODE")) && atoi(envval)) { | 179 if ((envval = getconf("TUN_MODE")) && atoi(envval)) { |
180 int i = IFF_POINTOPOINT | IFF_MULTICAST; | 180 int i = IFF_POINTOPOINT | IFF_MULTICAST; |
181 ioctl(tt->fd, TUNSIFMODE, &i); | 181 ioctl(ttfd, TUNSIFMODE, &i); |
182 i = 1; | 182 if ((envval = getconf("USE_PI")) && atoi(envval)) { |
183 ioctl(tt->fd, TUNSIFHEAD, &i); | 183 i = 1; |
184 } else { | |
185 i = 0; | |
186 } | |
187 ioctl(ttfd, TUNSIFHEAD, &i); | |
184 } | 188 } |
185 #endif | 189 #endif |
186 return ttfd; | 190 return ttfd; |
187 } | 191 } |
188 | 192 |