#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void loop() { int s0 = socket(AF_INET6, SOCK_STREAM, 0x84); struct in6_rtmsg rtmsg; memset(&rtmsg.rtmsg_dst, 0, sizeof(rtmsg.rtmsg_dst)); rtmsg.rtmsg_src = in6addr_loopback; memset(&rtmsg.rtmsg_gateway, 0, sizeof(rtmsg.rtmsg_gateway)); rtmsg.rtmsg_type = 0x4; rtmsg.rtmsg_dst_len = 0x0000; rtmsg.rtmsg_src_len = 0x7; rtmsg.rtmsg_metric = 0x100; rtmsg.rtmsg_info = 0x80000001; rtmsg.rtmsg_flags = 0x40000000; rtmsg.rtmsg_ifindex = if_nametoindex("gre0"); ioctl(s0, SIOCADDRT, &rtmsg); int s1 = socket(AF_INET6, SOCK_RAW|SOCK_NONBLOCK, IPPROTO_RAW); struct sockaddr_in6 si; memset(&si, 0, sizeof(si)); char buffer[1]; sendto(s1, &buffer[0], 0, MSG_CONFIRM, (const struct sockaddr *)&si, sizeof(si)); } int main() { unshare(CLONE_NEWUSER); unshare(CLONE_NEWNET); loop(); return 0; }