static int do_del(int argc, char **argv) { struct ip_tunnel_parm p; if (parse_args(argc, argv, SIOCDELTUNNEL, &p) < 0) return -1; switch (p.iph.protocol) { case IPPROTO_IPIP: return tnl_del_ioctl("tunl0", p.name, &p); case IPPROTO_GRE: return tnl_del_ioctl("gre0", p.name, &p); case IPPROTO_IPV6: return tnl_del_ioctl("sit0", p.name, &p); default: return tnl_del_ioctl(p.name, p.name, &p); } return -1; }
static int do_del(int argc, char **argv) { struct ip6_tnl_parm2 p; ip6_tnl_parm_init(&p, 1); if (parse_args(argc, argv, SIOCDELTUNNEL, &p) < 0) return -1; switch (p.proto) { case IPPROTO_IPIP: case IPPROTO_IPV6: return tnl_del_ioctl("ip6tnl0", p.name, &p); case IPPROTO_GRE: return tnl_del_ioctl("ip6gre0", p.name, &p); default: return tnl_del_ioctl(p.name, p.name, &p); } return -1; }
static int do_del(int argc, char **argv) { struct ip6_tnl_parm p; ip6_tnl_parm_init(&p, 1); if (parse_args(argc, argv, SIOCDELTUNNEL, &p) < 0) return -1; return tnl_del_ioctl(p.name[0] ? p.name : "ip6tnl0", p.name, &p); }
static int do_del(int argc, char **argv) { struct ip6_tnl_parm2 p; const char *basedev = "ip6tnl0"; ip6_tnl_parm_init(&p, 1); if (parse_args(argc, argv, SIOCDELTUNNEL, &p) < 0) return -1; if (p.proto == IPPROTO_GRE) basedev = "ip6gre0"; else if (p.i_flags & VTI_ISVTI) basedev = "ip6_vti0"; return tnl_del_ioctl(basedev, p.name, &p); }