move dns server/search list parsing to interface core to support peerdns=0 + static...
[project/netifd.git] / proto-shell.c
index 5309a55..2317209 100644 (file)
@@ -381,6 +381,8 @@ enum {
        NOTIFY_DATA,
        NOTIFY_KEEP,
        NOTIFY_HOST,
+       NOTIFY_DNS,
+       NOTIFY_DNS_SEARCH,
        __NOTIFY_LAST
 };
 
@@ -400,6 +402,8 @@ static const struct blobmsg_policy notify_attr[__NOTIFY_LAST] = {
        [NOTIFY_DATA] = { .name = "data", .type = BLOBMSG_TYPE_TABLE },
        [NOTIFY_KEEP] = { .name = "keep", .type = BLOBMSG_TYPE_BOOL },
        [NOTIFY_HOST] = { .name = "host", .type = BLOBMSG_TYPE_STRING },
+       [NOTIFY_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
+       [NOTIFY_DNS_SEARCH] = { .name = "dns_search", .type = BLOBMSG_TYPE_ARRAY },
 };
 
 static int
@@ -464,6 +468,12 @@ proto_shell_update_link(struct proto_shell_state *state, struct blob_attr *data,
        if ((cur = tb[NOTIFY_ROUTES6]) != NULL)
                proto_shell_parse_route_list(state->proto.iface, cur, true);
 
+       if ((cur = tb[NOTIFY_DNS]))
+               interface_add_dns_server_list(&iface->proto_ip, cur);
+
+       if ((cur = tb[NOTIFY_DNS_SEARCH]))
+               interface_add_dns_search_list(&iface->proto_ip, cur);
+
        interface_update_complete(state->proto.iface);
 
        if (!keep)