X-Git-Url: http://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=73046b8c8f9e76c17afcc9fefe6d73c98e4691cb;hb=985d19caf20058db3c764f0f6fbeafa8bcc59fcc;hp=3ff2f547c6c23c5316c8dd95ceda5a7812732924;hpb=c6c6ba9969f76eff7b7de9308c2736d7ff1d720e;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index 3ff2f547..73046b8c 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -2,7 +2,7 @@ device.c -- Interaction with Solaris tun device Copyright (C) 2001-2005 Ivo Timmermans, 2002-2010 OpenVPN Technologies, Inc. - 2001-2014 Guus Sliepen + 2001-2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -87,6 +87,9 @@ static bool setup_device(void) { else device_info = "Solaris tap device"; + if(device_type == DEVICE_TYPE_TAP && routing_mode == RMODE_ROUTER) + overwrite_mac = true; + /* The following is black magic copied from OpenVPN. */ if((ip_fd = open(IP_DEVICE, O_RDWR, 0)) < 0) { @@ -112,7 +115,7 @@ static bool setup_device(void) { struct strioctl strioc_ppa = { .ic_cmd = TUNNEWPPA, - .ic_len = sizeof ppa, + .ic_len = sizeof(ppa), .ic_dp = (char *)&ppa, }; @@ -153,7 +156,7 @@ static bool setup_device(void) { { /* Remove muxes just in case they are left over from a crashed tincd */ struct lifreq ifr = {}; - strncpy(ifr.lifr_name, iface, sizeof ifr.lifr_name); + strncpy(ifr.lifr_name, iface, sizeof(ifr.lifr_name)); if(ioctl(ip_fd, SIOCGLIFMUXID, &ifr) >= 0) { int muxid = ifr.lifr_arp_muxid; ioctl(ip_fd, I_PUNLINK, muxid); @@ -226,7 +229,7 @@ static bool setup_device(void) { /* Set ifname to arp */ struct strioctl strioc_if = { .ic_cmd = SIOCSLIFNAME, - .ic_len = sizeof ifr, + .ic_len = sizeof(ifr), .ic_dp = (char *)&ifr, }; @@ -282,7 +285,7 @@ static bool setup_device(void) { static void close_device(void) { if(iface) { struct lifreq ifr = {}; - strncpy(ifr.lifr_name, iface, sizeof ifr.lifr_name); + strncpy(ifr.lifr_name, iface, sizeof(ifr.lifr_name)); if(ioctl(ip_fd, SIOCGLIFMUXID, &ifr) >= 0) { int muxid = ifr.lifr_arp_muxid; ioctl(ip_fd, I_PUNLINK, muxid);