version 1.39, 2006/01/01 10:08:48 |
version 1.40, 2006/01/02 07:53:44 |
|
|
|
|
if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) |
if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) |
goto failed; |
goto failed; |
if (mode == SSH_TUNMODE_ETHERNET) { |
|
|
/* Set interface mode */ |
|
ifr.ifr_flags &= ~IFF_UP; |
|
if (mode == SSH_TUNMODE_ETHERNET) |
ifr.ifr_flags |= IFF_LINK0; |
ifr.ifr_flags |= IFF_LINK0; |
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) |
else |
goto failed; |
ifr.ifr_flags &= ~IFF_LINK0; |
} |
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) |
|
goto failed; |
|
|
|
/* Bring interface up */ |
ifr.ifr_flags |= IFF_UP; |
ifr.ifr_flags |= IFF_UP; |
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) |
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) |
goto failed; |
goto failed; |