mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-11 01:40:05 -04:00
Fixed ifconfig command for "topology subnet" on FreeBSD (Stefan Bethke).
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4837 e7ae566f-a301-0410-adde-c780ea21d3b5
This commit is contained in:
parent
7d0f3877f6
commit
b69d5cc8f5
1 changed files with 10 additions and 6 deletions
16
tun.c
16
tun.c
|
|
@ -863,11 +863,10 @@ do_ifconfig (struct tuntap *tt,
|
|||
else {
|
||||
if (tt->topology == TOP_SUBNET)
|
||||
argv_printf (&argv,
|
||||
"%s %s %s %s netmask %s mtu %d up",
|
||||
"%s %s %s netmask %s mtu %d up",
|
||||
IFCONFIG_PATH,
|
||||
actual,
|
||||
ifconfig_local,
|
||||
ifconfig_local,
|
||||
ifconfig_remote_netmask,
|
||||
tun_mtu
|
||||
);
|
||||
|
|
@ -1745,14 +1744,19 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6
|
|||
{
|
||||
open_tun_generic (dev, dev_type, dev_node, ipv6, true, true, tt);
|
||||
|
||||
if (tt->fd >= 0)
|
||||
if (tt->fd >= 0 && tt->type == DEV_TYPE_TUN)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* Disable extended modes */
|
||||
ioctl (tt->fd, TUNSLMODE, &i);
|
||||
i = tt->topology == TOP_SUBNET ? IFF_BROADCAST : IFF_POINTOPOINT;
|
||||
i |= IFF_MULTICAST;
|
||||
if (ioctl (tt->fd, TUNSIFMODE, &i) < 0) {
|
||||
msg (M_WARN | M_ERRNO, "ioctl(TUNSIFMODE): %s", strerror(errno));
|
||||
}
|
||||
i = 1;
|
||||
ioctl (tt->fd, TUNSIFHEAD, &i);
|
||||
if (ioctl (tt->fd, TUNSIFHEAD, &i) < 0) {
|
||||
msg (M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD): %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue