… | |
… | |
91 | |
91 | |
92 | #define netname conf.ifname |
92 | #define netname conf.ifname |
93 | |
93 | |
94 | #if IF_linux |
94 | #if IF_linux |
95 | # include "tincd/linux/device.c" |
95 | # include "tincd/linux/device.c" |
96 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU up"; } |
96 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU"; } |
97 | |
97 | |
98 | #elif IF_freebsd |
98 | #elif IF_freebsd |
99 | # include "tincd/freebsd/device.c" |
99 | # include "tincd/freebsd/device.c" |
100 | // 5.2.1' ifconfig _first_ sets the if up then changes mtu, which can be deadly due to ipv6 kicking in |
|
|
101 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU && /sbin/ifconfig $IFNAME up"; } |
100 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU"; } |
102 | |
101 | |
103 | #elif IF_netbsd |
102 | #elif IF_netbsd |
104 | # define IF_istun 1 |
103 | # define IF_istun 1 |
105 | # include "tincd/netbsd/device.c" |
104 | # include "tincd/netbsd/device.c" |
106 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU up"; } |
105 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU"; } |
107 | |
106 | |
108 | #elif IF_openbsd |
107 | #elif IF_openbsd |
109 | # define IF_istun 1 |
108 | # define IF_istun 1 |
110 | # include "tincd/openbsd/device.c" |
109 | # include "tincd/openbsd/device.c" |
111 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU up"; } |
110 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU"; } |
112 | |
111 | |
113 | #elif IF_solaris |
112 | #elif IF_solaris |
114 | # define IF_istun 1 |
113 | # define IF_istun 1 |
115 | # include "tincd/solaris/device.c" |
114 | # include "tincd/solaris/device.c" |
116 | const char * tap_device::if_up () { return ""; } |
115 | const char * tap_device::if_up () { return ""; } |
… | |
… | |
124 | const char * tap_device::if_up () { return ""; } |
123 | const char * tap_device::if_up () { return ""; } |
125 | |
124 | |
126 | #elif IF_darwin |
125 | #elif IF_darwin |
127 | # define IF_istun 1 |
126 | # define IF_istun 1 |
128 | # include "tincd/darwin/device.c" |
127 | # include "tincd/darwin/device.c" |
129 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU up"; } |
128 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU"; } |
130 | |
129 | |
131 | #elif IF_raw_socket |
130 | #elif IF_raw_socket |
132 | # include "tincd/raw_socket/device.c" |
131 | # include "tincd/raw_socket/device.c" |
133 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU up"; } |
132 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU"; } |
134 | |
133 | |
135 | #elif IF_uml_socket |
134 | #elif IF_uml_socket |
136 | # include "tincd/uml_socket/device.c" |
135 | # include "tincd/uml_socket/device.c" |
137 | const char * tap_device::if_up () { return 0; } |
136 | const char * tap_device::if_up () { return 0; } |
138 | |
137 | |