@@ -54,11 +54,6 @@ struct in6_ifreq {
5454 290 };
5555*/
5656
57- type in6_ifreq_mtu struct {
58- ifr_name [syscall .IFNAMSIZ ]byte
59- ifru_mtu int
60- }
61-
6257type in6_ifreq_addr struct {
6358 ifr_name [syscall .IFNAMSIZ ]byte
6459 ifru_addr sockaddr_in6
@@ -112,26 +107,6 @@ func (tun *TunAdapter) setupAddress(addr string) error {
112107 tun .log .Infof ("Interface IPv6: %s" , addr )
113108 tun .log .Infof ("Interface MTU: %d" , tun .mtu )
114109
115- // Create the MTU request
116- var ir in6_ifreq_mtu
117- copy (ir .ifr_name [:], tun .Name ())
118- ir .ifru_mtu = int (tun .mtu )
119-
120- // Set the MTU
121- if _ , _ , errno := unix .Syscall (unix .SYS_IOCTL , uintptr (sfd ), uintptr (syscall .SIOCSIFMTU ), uintptr (unsafe .Pointer (& ir ))); errno != 0 {
122- err = errno
123- tun .log .Errorf ("Error in SIOCSIFMTU: %v" , errno )
124-
125- // Fall back to ifconfig to set the MTU
126- cmd := exec .Command ("ifconfig" , tun .Name (), "mtu" , string (tun .mtu ))
127- tun .log .Warnf ("Using ifconfig as fallback: %v" , strings .Join (cmd .Args , " " ))
128- output , err := cmd .CombinedOutput ()
129- if err != nil {
130- tun .log .Errorf ("SIOCSIFMTU fallback failed: %v." , err )
131- tun .log .Traceln (string (output ))
132- }
133- }
134-
135110 // Create the address request
136111 // FIXME: I don't work!
137112 var ar in6_ifreq_addr
0 commit comments