fix config routes enable/disable handling on down/up
[project/netifd.git] / tunnel.c
index e756973..b45ac98 100644 (file)
--- a/tunnel.c
+++ b/tunnel.c
@@ -6,7 +6,6 @@
 struct tunnel {
        struct device dev;
        device_state_cb set_state;
-       struct blob_attr *config;
 };
 
 static int
@@ -16,11 +15,9 @@ tunnel_set_state(struct device *dev, bool up)
        int ret;
 
        if (up) {
-               ret = system_add_ip_tunnel(dev->ifname, tun->config);
-               if (ret != 0) {
-                       perror("add_ip_tunnel");
+               ret = system_add_ip_tunnel(dev->ifname, dev->config);
+               if (ret != 0)
                        return ret;
-               }
        }
 
        ret = tun->set_state(dev, up);
@@ -38,7 +35,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;