Commit c4ee0fee authored by Manni's avatar Manni

fix

parent d43161dd
......@@ -49,8 +49,17 @@ int main(int argc, char *argv[]) {
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
auto raw = socket(AF_INET, SOCK_RAW, IPPROTO_IPIP);
if(raw < 0){
perror("socket init error");
}
auto tun = open("/dev/net/tun", O_RDWR);
ioctl(tun, TUNSETIFF, &ifr);
if(tun < 0){
perror("tun init error");
}
if(ioctl(tun, TUNSETIFF, &ifr) < 0){
perror("ioctl error");
}
remote = inet_addr(argv[1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment