X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=tunnel.c;h=3ef5086b48395e71d04e9f6cbd867a4f2acb1a40;hp=b6e902a1fdaacd53ef536611a95465abcf1d97d2;hb=987bdc77deecb928d86b9d710cc3bcfa5b3d80eb;hpb=41a40733dc80946841c9241ec56a4670a5943709 diff --git a/tunnel.c b/tunnel.c index b6e902a..3ef5086 100644 --- a/tunnel.c +++ b/tunnel.c @@ -1,3 +1,16 @@ +/* + * netifd - network interface daemon + * Copyright (C) 2012 Felix Fietkau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ #include "netifd.h" #include "device.h" #include "config.h" @@ -6,7 +19,6 @@ struct tunnel { struct device dev; device_state_cb set_state; - struct blob_attr *config; }; static int @@ -16,7 +28,7 @@ tunnel_set_state(struct device *dev, bool up) int ret; if (up) { - ret = system_add_ip_tunnel(dev->ifname, tun->config); + ret = system_add_ip_tunnel(dev->ifname, dev->config); if (ret != 0) return ret; } @@ -36,7 +48,6 @@ tunnel_create(const char *name, struct blob_attr *attr) tun = calloc(1, sizeof(*tun)); dev = &tun->dev; - tun->config = config_memdup(attr); device_init(dev, &tunnel_device_type, name); tun->set_state = dev->set_state; dev->set_state = tunnel_set_state;