+ event_set(&device_ev, device_fd, EV_READ|EV_PERSIST,
+ handle_device_data, NULL);
+ if (event_add(&device_ev, NULL) < 0) {
+ logger(LOG_ERR, _("event_add failed: %s"), strerror(errno));
+ close_device();
+ return false;
+ }
+
+ /* Run tinc-up script to further initialize the tap interface */
+ asprintf(&envp[0], "NETNAME=%s", netname ? : "");
+ asprintf(&envp[1], "DEVICE=%s", device ? : "");
+ asprintf(&envp[2], "INTERFACE=%s", iface ? : "");
+ asprintf(&envp[3], "NAME=%s", myself->name);
+ envp[4] = NULL;
+
+ execute_script("tinc-up", envp);
+
+ for(i = 0; i < 5; i++)
+ free(envp[i]);
+
+ /* Run subnet-up scripts for our own subnets */
+
+ subnet_update(myself, NULL, true);
+
+ /* Open sockets */