+
+ case UTUN_OPT_SET_DELEGATE_INTERFACE: {
+ ifnet_t del_ifp = NULL;
+ char name[IFNAMSIZ];
+
+ if (len > IFNAMSIZ - 1) {
+ result = EMSGSIZE;
+ break;
+ }
+ if (len != 0) { /* if len==0, del_ifp will be NULL causing the delegate to be removed */
+ bcopy(data, name, len);
+ name[len] = 0;
+ result = ifnet_find_by_name(name, &del_ifp);
+ }
+ if (result == 0) {
+ result = ifnet_set_delegate(pcb->utun_ifp, del_ifp);
+ if (del_ifp)
+ ifnet_release(del_ifp);
+ }
+ break;
+ }
+
+ default: