]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-dhcp-server.c
Revert "tree-wide: Mount file descriptors via /proc/<pid>/fd"
[thirdparty/systemd.git] / src / network / networkd-dhcp-server.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #include <netinet/in.h>
4 #include <linux/if_arp.h>
5 #include <linux/if.h>
6
7 #include "sd-dhcp-server.h"
8
9 #include "fd-util.h"
10 #include "fileio.h"
11 #include "networkd-address.h"
12 #include "networkd-dhcp-server-bus.h"
13 #include "networkd-dhcp-server-static-lease.h"
14 #include "networkd-dhcp-server.h"
15 #include "networkd-link.h"
16 #include "networkd-manager.h"
17 #include "networkd-network.h"
18 #include "networkd-queue.h"
19 #include "networkd-route-util.h"
20 #include "parse-util.h"
21 #include "socket-netlink.h"
22 #include "string-table.h"
23 #include "string-util.h"
24 #include "strv.h"
25
26 static bool link_dhcp4_server_enabled(Link *link) {
27 assert(link);
28
29 if (link->flags & IFF_LOOPBACK)
30 return false;
31
32 if (!link->network)
33 return false;
34
35 if (link->iftype == ARPHRD_CAN)
36 return false;
37
38 return link->network->dhcp_server;
39 }
40
41 void network_adjust_dhcp_server(Network *network) {
42 assert(network);
43
44 if (!network->dhcp_server)
45 return;
46
47 if (network->bond) {
48 log_warning("%s: DHCPServer= is enabled for bond slave. Disabling DHCP server.",
49 network->filename);
50 network->dhcp_server = false;
51 return;
52 }
53
54 if (!in4_addr_is_set(&network->dhcp_server_address)) {
55 Address *address;
56 bool have = false;
57
58 ORDERED_HASHMAP_FOREACH(address, network->addresses_by_section) {
59 if (section_is_invalid(address->section))
60 continue;
61
62 if (address->family != AF_INET)
63 continue;
64
65 if (in4_addr_is_localhost(&address->in_addr.in))
66 continue;
67
68 if (in4_addr_is_link_local(&address->in_addr.in))
69 continue;
70
71 if (in4_addr_is_set(&address->in_addr_peer.in))
72 continue;
73
74 have = true;
75 break;
76 }
77 if (!have) {
78 log_warning("%s: DHCPServer= is enabled, but no static address configured. "
79 "Disabling DHCP server.",
80 network->filename);
81 network->dhcp_server = false;
82 return;
83 }
84 }
85 }
86
87 int link_request_dhcp_server_address(Link *link) {
88 _cleanup_(address_freep) Address *address = NULL;
89 Address *existing;
90 int r;
91
92 assert(link);
93 assert(link->network);
94
95 if (!link_dhcp4_server_enabled(link))
96 return 0;
97
98 if (!in4_addr_is_set(&link->network->dhcp_server_address))
99 return 0;
100
101 r = address_new(&address);
102 if (r < 0)
103 return r;
104
105 address->source = NETWORK_CONFIG_SOURCE_STATIC;
106 address->family = AF_INET;
107 address->in_addr.in = link->network->dhcp_server_address;
108 address->prefixlen = link->network->dhcp_server_address_prefixlen;
109
110 if (address_get_harder(link, address, &existing) >= 0 &&
111 (address_exists(existing) || address_is_requesting(existing)) &&
112 existing->source == NETWORK_CONFIG_SOURCE_STATIC)
113 /* The same address seems explicitly configured in [Address] or [Network] section.
114 * Configure the DHCP server address only when it is not. */
115 return 0;
116
117 return link_request_static_address(link, address);
118 }
119
120 static int link_find_dhcp_server_address(Link *link, Address **ret) {
121 Address *address;
122
123 assert(link);
124 assert(link->network);
125
126 /* If ServerAddress= is specified, then use the address. */
127 if (in4_addr_is_set(&link->network->dhcp_server_address))
128 return link_get_ipv4_address(link, &link->network->dhcp_server_address,
129 link->network->dhcp_server_address_prefixlen, ret);
130
131 /* If not, then select one from static addresses. */
132 SET_FOREACH(address, link->addresses) {
133 if (address->source != NETWORK_CONFIG_SOURCE_STATIC)
134 continue;
135 if (!address_exists(address))
136 continue;
137 if (address->family != AF_INET)
138 continue;
139 if (in4_addr_is_localhost(&address->in_addr.in))
140 continue;
141 if (in4_addr_is_link_local(&address->in_addr.in))
142 continue;
143 if (in4_addr_is_set(&address->in_addr_peer.in))
144 continue;
145
146 *ret = address;
147 return 0;
148 }
149
150 return -ENOENT;
151 }
152
153 static int dhcp_server_find_uplink(Link *link, Link **ret) {
154 assert(link);
155
156 if (link->network->dhcp_server_uplink_name)
157 return link_get_by_name(link->manager, link->network->dhcp_server_uplink_name, ret);
158
159 if (link->network->dhcp_server_uplink_index > 0)
160 return link_get_by_index(link->manager, link->network->dhcp_server_uplink_index, ret);
161
162 if (link->network->dhcp_server_uplink_index == UPLINK_INDEX_AUTO) {
163 /* It is not necessary to propagate error in automatic selection. */
164 if (manager_find_uplink(link->manager, AF_INET, link, ret) < 0)
165 *ret = NULL;
166 return 0;
167 }
168
169 *ret = NULL;
170 return 0;
171 }
172
173 static int link_push_uplink_to_dhcp_server(
174 Link *link,
175 sd_dhcp_lease_server_type_t what,
176 sd_dhcp_server *s) {
177
178 _cleanup_free_ struct in_addr *addresses = NULL;
179 bool use_dhcp_lease_data = true;
180 size_t n_addresses = 0;
181
182 assert(link);
183
184 if (!link->network)
185 return 0;
186 assert(link->network);
187
188 log_link_debug(link, "Copying %s from link", dhcp_lease_server_type_to_string(what));
189
190 switch (what) {
191
192 case SD_DHCP_LEASE_DNS:
193 /* For DNS we have a special case. We the data configured explicitly locally along with the
194 * data from the DHCP lease. */
195
196 for (unsigned i = 0; i < link->network->n_dns; i++) {
197 struct in_addr ia;
198
199 /* Only look for IPv4 addresses */
200 if (link->network->dns[i]->family != AF_INET)
201 continue;
202
203 ia = link->network->dns[i]->address.in;
204
205 /* Never propagate obviously borked data */
206 if (in4_addr_is_null(&ia) || in4_addr_is_localhost(&ia))
207 continue;
208
209 if (!GREEDY_REALLOC(addresses, n_addresses + 1))
210 return log_oom();
211
212 addresses[n_addresses++] = ia;
213 }
214
215 use_dhcp_lease_data = link->network->dhcp_use_dns;
216 break;
217
218 case SD_DHCP_LEASE_NTP: {
219 /* For NTP things are similar, but for NTP hostnames can be configured too, which we cannot
220 * propagate via DHCP. Hence let's only propagate those which are IP addresses. */
221
222 STRV_FOREACH(i, link->network->ntp) {
223 union in_addr_union ia;
224
225 if (in_addr_from_string(AF_INET, *i, &ia) < 0)
226 continue;
227
228 /* Never propagate obviously borked data */
229 if (in4_addr_is_null(&ia.in) || in4_addr_is_localhost(&ia.in))
230 continue;
231
232 if (!GREEDY_REALLOC(addresses, n_addresses + 1))
233 return log_oom();
234
235 addresses[n_addresses++] = ia.in;
236 }
237
238 use_dhcp_lease_data = link->network->dhcp_use_ntp;
239 break;
240 }
241
242 case SD_DHCP_LEASE_SIP:
243
244 /* For SIP we don't allow explicit, local configuration, but there's control whether to use the data */
245 use_dhcp_lease_data = link->network->dhcp_use_sip;
246 break;
247
248 case SD_DHCP_LEASE_POP3:
249 case SD_DHCP_LEASE_SMTP:
250 case SD_DHCP_LEASE_LPR:
251 /* For the other server types we currently do not allow local configuration of server data,
252 * since there are typically no local consumers of the data. */
253 break;
254
255 default:
256 assert_not_reached();
257 }
258
259 if (use_dhcp_lease_data && link->dhcp_lease) {
260 const struct in_addr *da;
261
262 int n = sd_dhcp_lease_get_servers(link->dhcp_lease, what, &da);
263 if (n > 0) {
264 if (!GREEDY_REALLOC(addresses, n_addresses + n))
265 return log_oom();
266
267 for (int j = 0; j < n; j++)
268 if (in4_addr_is_non_local(&da[j]))
269 addresses[n_addresses++] = da[j];
270 }
271 }
272
273 if (n_addresses <= 0)
274 return 0;
275
276 return sd_dhcp_server_set_servers(s, what, addresses, n_addresses);
277 }
278
279 static int dhcp4_server_parse_dns_server_string_and_warn(
280 const char *string,
281 struct in_addr **addresses,
282 size_t *n_addresses) {
283
284 for (;;) {
285 _cleanup_free_ char *word = NULL, *server_name = NULL;
286 union in_addr_union address;
287 int family, r, ifindex = 0;
288
289 r = extract_first_word(&string, &word, NULL, 0);
290 if (r < 0)
291 return r;
292 if (r == 0)
293 break;
294
295 r = in_addr_ifindex_name_from_string_auto(word, &family, &address, &ifindex, &server_name);
296 if (r < 0) {
297 log_warning_errno(r, "Failed to parse DNS server address '%s', ignoring: %m", word);
298 continue;
299 }
300
301 /* Only look for IPv4 addresses */
302 if (family != AF_INET)
303 continue;
304
305 /* Never propagate obviously borked data */
306 if (in4_addr_is_null(&address.in) || in4_addr_is_localhost(&address.in))
307 continue;
308
309 if (!GREEDY_REALLOC(*addresses, *n_addresses + 1))
310 return log_oom();
311
312 (*addresses)[(*n_addresses)++] = address.in;
313 }
314
315 return 0;
316 }
317
318 static int dhcp4_server_set_dns_from_resolve_conf(Link *link) {
319 _cleanup_free_ struct in_addr *addresses = NULL;
320 _cleanup_fclose_ FILE *f = NULL;
321 size_t n_addresses = 0;
322 int r;
323
324 f = fopen(PRIVATE_UPLINK_RESOLV_CONF, "re");
325 if (!f) {
326 if (errno == ENOENT)
327 return 0;
328
329 return log_warning_errno(errno, "Failed to open " PRIVATE_UPLINK_RESOLV_CONF ": %m");
330 }
331
332 for (;;) {
333 _cleanup_free_ char *line = NULL;
334 const char *a;
335 char *l;
336
337 r = read_line(f, LONG_LINE_MAX, &line);
338 if (r < 0)
339 return log_error_errno(r, "Failed to read " PRIVATE_UPLINK_RESOLV_CONF ": %m");
340 if (r == 0)
341 break;
342
343 l = strstrip(line);
344 if (IN_SET(*l, '#', ';', 0))
345 continue;
346
347 a = first_word(l, "nameserver");
348 if (!a)
349 continue;
350
351 r = dhcp4_server_parse_dns_server_string_and_warn(a, &addresses, &n_addresses);
352 if (r < 0)
353 log_warning_errno(r, "Failed to parse DNS server address '%s', ignoring.", a);
354 }
355
356 if (n_addresses <= 0)
357 return 0;
358
359 return sd_dhcp_server_set_dns(link->dhcp_server, addresses, n_addresses);
360 }
361
362 static int dhcp4_server_configure(Link *link) {
363 bool acquired_uplink = false;
364 sd_dhcp_option *p;
365 DHCPStaticLease *static_lease;
366 Link *uplink = NULL;
367 Address *address;
368 bool bind_to_interface;
369 int r;
370
371 assert(link);
372
373 log_link_debug(link, "Configuring DHCP Server.");
374
375 if (link->dhcp_server)
376 return -EBUSY;
377
378 r = sd_dhcp_server_new(&link->dhcp_server, link->ifindex);
379 if (r < 0)
380 return r;
381
382 r = sd_dhcp_server_attach_event(link->dhcp_server, link->manager->event, 0);
383 if (r < 0)
384 return r;
385
386 r = sd_dhcp_server_set_callback(link->dhcp_server, dhcp_server_callback, link);
387 if (r < 0)
388 return log_link_warning_errno(link, r, "Failed to set callback for DHCPv4 server instance: %m");
389
390 r = link_find_dhcp_server_address(link, &address);
391 if (r < 0)
392 return log_link_error_errno(link, r, "Failed to find suitable address for DHCPv4 server instance: %m");
393
394 /* use the server address' subnet as the pool */
395 r = sd_dhcp_server_configure_pool(link->dhcp_server, &address->in_addr.in, address->prefixlen,
396 link->network->dhcp_server_pool_offset, link->network->dhcp_server_pool_size);
397 if (r < 0)
398 return log_link_error_errno(link, r, "Failed to configure address pool for DHCPv4 server instance: %m");
399
400 if (link->network->dhcp_server_max_lease_time_usec > 0) {
401 r = sd_dhcp_server_set_max_lease_time(link->dhcp_server,
402 DIV_ROUND_UP(link->network->dhcp_server_max_lease_time_usec, USEC_PER_SEC));
403 if (r < 0)
404 return log_link_error_errno(link, r, "Failed to set maximum lease time for DHCPv4 server instance: %m");
405 }
406
407 if (link->network->dhcp_server_default_lease_time_usec > 0) {
408 r = sd_dhcp_server_set_default_lease_time(link->dhcp_server,
409 DIV_ROUND_UP(link->network->dhcp_server_default_lease_time_usec, USEC_PER_SEC));
410 if (r < 0)
411 return log_link_error_errno(link, r, "Failed to set default lease time for DHCPv4 server instance: %m");
412 }
413
414 r = sd_dhcp_server_set_boot_server_address(link->dhcp_server, &link->network->dhcp_server_boot_server_address);
415 if (r < 0)
416 return log_link_warning_errno(link, r, "Failed to set boot server address for DHCPv4 server instance: %m");
417
418 r = sd_dhcp_server_set_boot_server_name(link->dhcp_server, link->network->dhcp_server_boot_server_name);
419 if (r < 0)
420 return log_link_warning_errno(link, r, "Failed to set boot server name for DHCPv4 server instance: %m");
421
422 r = sd_dhcp_server_set_boot_filename(link->dhcp_server, link->network->dhcp_server_boot_filename);
423 if (r < 0)
424 return log_link_warning_errno(link, r, "Failed to set boot filename for DHCPv4 server instance: %m");
425
426 for (sd_dhcp_lease_server_type_t type = 0; type < _SD_DHCP_LEASE_SERVER_TYPE_MAX; type ++) {
427
428 if (!link->network->dhcp_server_emit[type].emit)
429 continue;
430
431 if (link->network->dhcp_server_emit[type].n_addresses > 0)
432 /* Explicitly specified servers to emit */
433 r = sd_dhcp_server_set_servers(
434 link->dhcp_server,
435 type,
436 link->network->dhcp_server_emit[type].addresses,
437 link->network->dhcp_server_emit[type].n_addresses);
438 else {
439 /* Emission is requested, but nothing explicitly configured. Let's find a suitable upling */
440 if (!acquired_uplink) {
441 (void) dhcp_server_find_uplink(link, &uplink);
442 acquired_uplink = true;
443 }
444
445 if (uplink && uplink->network)
446 r = link_push_uplink_to_dhcp_server(uplink, type, link->dhcp_server);
447 else if (type == SD_DHCP_LEASE_DNS)
448 r = dhcp4_server_set_dns_from_resolve_conf(link);
449 else {
450 log_link_debug(link,
451 "Not emitting %s on link, couldn't find suitable uplink.",
452 dhcp_lease_server_type_to_string(type));
453 continue;
454 }
455 }
456
457 if (r < 0)
458 log_link_warning_errno(link, r,
459 "Failed to set %s for DHCP server, ignoring: %m",
460 dhcp_lease_server_type_to_string(type));
461 }
462
463 if (link->network->dhcp_server_emit_router) {
464 r = sd_dhcp_server_set_router(link->dhcp_server, &link->network->dhcp_server_router);
465 if (r < 0)
466 return log_link_error_errno(link, r, "Failed to set router address for DHCP server: %m");
467 }
468
469 r = sd_dhcp_server_set_relay_target(link->dhcp_server, &link->network->dhcp_server_relay_target);
470 if (r < 0)
471 return log_link_error_errno(link, r, "Failed to set relay target for DHCP server: %m");
472
473 bind_to_interface = sd_dhcp_server_is_in_relay_mode(link->dhcp_server) ? false : link->network->dhcp_server_bind_to_interface;
474 r = sd_dhcp_server_set_bind_to_interface(link->dhcp_server, bind_to_interface);
475 if (r < 0)
476 return log_link_error_errno(link, r, "Failed to set interface binding for DHCP server: %m");
477
478 r = sd_dhcp_server_set_relay_agent_information(link->dhcp_server, link->network->dhcp_server_relay_agent_circuit_id, link->network->dhcp_server_relay_agent_remote_id);
479 if (r < 0)
480 return log_link_error_errno(link, r, "Failed to set agent circuit/remote id for DHCP server: %m");
481
482 if (link->network->dhcp_server_emit_timezone) {
483 _cleanup_free_ char *buffer = NULL;
484 const char *tz = NULL;
485
486 if (link->network->dhcp_server_timezone)
487 tz = link->network->dhcp_server_timezone;
488 else {
489 r = get_timezone(&buffer);
490 if (r < 0)
491 log_link_warning_errno(link, r, "Failed to determine timezone, not sending timezone: %m");
492 else
493 tz = buffer;
494 }
495
496 if (tz) {
497 r = sd_dhcp_server_set_timezone(link->dhcp_server, tz);
498 if (r < 0)
499 return log_link_error_errno(link, r, "Failed to set timezone for DHCP server: %m");
500 }
501 }
502
503 ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_send_options) {
504 r = sd_dhcp_server_add_option(link->dhcp_server, p);
505 if (r == -EEXIST)
506 continue;
507 if (r < 0)
508 return log_link_error_errno(link, r, "Failed to set DHCPv4 option: %m");
509 }
510
511 ORDERED_HASHMAP_FOREACH(p, link->network->dhcp_server_send_vendor_options) {
512 r = sd_dhcp_server_add_vendor_option(link->dhcp_server, p);
513 if (r == -EEXIST)
514 continue;
515 if (r < 0)
516 return log_link_error_errno(link, r, "Failed to set DHCPv4 option: %m");
517 }
518
519 HASHMAP_FOREACH(static_lease, link->network->dhcp_static_leases_by_section) {
520 r = sd_dhcp_server_set_static_lease(link->dhcp_server, &static_lease->address, static_lease->client_id, static_lease->client_id_size);
521 if (r < 0)
522 return log_link_error_errno(link, r, "Failed to set DHCPv4 static lease for DHCP server: %m");
523 }
524
525 r = sd_dhcp_server_start(link->dhcp_server);
526 if (r < 0)
527 return log_link_error_errno(link, r, "Could not start DHCPv4 server instance: %m");
528
529 log_link_debug(link, "Offering DHCPv4 leases");
530 return 0;
531 }
532
533 static bool dhcp_server_is_ready_to_configure(Link *link) {
534 Link *uplink = NULL;
535 Address *a;
536
537 assert(link);
538
539 if (!link_is_ready_to_configure(link, /* allow_unmanaged = */ false))
540 return false;
541
542 if (!link_has_carrier(link))
543 return false;
544
545 if (!link->static_addresses_configured)
546 return false;
547
548 if (link_find_dhcp_server_address(link, &a) < 0)
549 return false;
550
551 if (!address_is_ready(a))
552 return false;
553
554 if (dhcp_server_find_uplink(link, &uplink) < 0)
555 return false;
556
557 if (uplink && !uplink->network)
558 return false;
559
560 return true;
561 }
562
563 static int dhcp_server_process_request(Request *req, Link *link, void *userdata) {
564 int r;
565
566 assert(link);
567
568 if (!dhcp_server_is_ready_to_configure(link))
569 return 0;
570
571 r = dhcp4_server_configure(link);
572 if (r < 0)
573 return log_link_warning_errno(link, r, "Failed to configure DHCP server: %m");
574
575 return 1;
576 }
577
578 int link_request_dhcp_server(Link *link) {
579 int r;
580
581 assert(link);
582
583 if (!link_dhcp4_server_enabled(link))
584 return 0;
585
586 if (link->dhcp_server)
587 return 0;
588
589 log_link_debug(link, "Requesting DHCP server.");
590 r = link_queue_request(link, REQUEST_TYPE_DHCP_SERVER, dhcp_server_process_request, NULL);
591 if (r < 0)
592 return log_link_warning_errno(link, r, "Failed to request configuration of DHCP server: %m");
593
594 return 0;
595 }
596
597 int config_parse_dhcp_server_relay_agent_suboption(
598 const char *unit,
599 const char *filename,
600 unsigned line,
601 const char *section,
602 unsigned section_line,
603 const char *lvalue,
604 int ltype,
605 const char *rvalue,
606 void *data,
607 void *userdata) {
608
609 char **suboption_value = data;
610 char* p;
611
612 assert(filename);
613 assert(lvalue);
614 assert(rvalue);
615
616 if (isempty(rvalue)) {
617 *suboption_value = mfree(*suboption_value);
618 return 0;
619 }
620
621 p = startswith(rvalue, "string:");
622 if (!p) {
623 log_syntax(unit, LOG_WARNING, filename, line, 0,
624 "Failed to parse %s=%s'. Invalid format, ignoring.", lvalue, rvalue);
625 return 0;
626 }
627 return free_and_strdup(suboption_value, empty_to_null(p));
628 }
629
630 int config_parse_dhcp_server_emit(
631 const char *unit,
632 const char *filename,
633 unsigned line,
634 const char *section,
635 unsigned section_line,
636 const char *lvalue,
637 int ltype,
638 const char *rvalue,
639 void *data,
640 void *userdata) {
641
642 NetworkDHCPServerEmitAddress *emit = ASSERT_PTR(data);
643
644 assert(rvalue);
645
646 if (isempty(rvalue)) {
647 emit->addresses = mfree(emit->addresses);
648 emit->n_addresses = 0;
649 return 0;
650 }
651
652 for (const char *p = rvalue;;) {
653 _cleanup_free_ char *w = NULL;
654 union in_addr_union a;
655 int r;
656
657 r = extract_first_word(&p, &w, NULL, 0);
658 if (r == -ENOMEM)
659 return log_oom();
660 if (r < 0) {
661 log_syntax(unit, LOG_WARNING, filename, line, r,
662 "Failed to extract word, ignoring: %s", rvalue);
663 return 0;
664 }
665 if (r == 0)
666 return 0;
667
668 if (streq(w, "_server_address"))
669 a = IN_ADDR_NULL; /* null address will be converted to the server address. */
670 else {
671 r = in_addr_from_string(AF_INET, w, &a);
672 if (r < 0) {
673 log_syntax(unit, LOG_WARNING, filename, line, r,
674 "Failed to parse %s= address '%s', ignoring: %m", lvalue, w);
675 continue;
676 }
677
678 if (in4_addr_is_null(&a.in)) {
679 log_syntax(unit, LOG_WARNING, filename, line, 0,
680 "Found a null address in %s=, ignoring.", lvalue);
681 continue;
682 }
683 }
684
685 if (!GREEDY_REALLOC(emit->addresses, emit->n_addresses + 1))
686 return log_oom();
687
688 emit->addresses[emit->n_addresses++] = a.in;
689 }
690 }
691
692 int config_parse_dhcp_server_address(
693 const char *unit,
694 const char *filename,
695 unsigned line,
696 const char *section,
697 unsigned section_line,
698 const char *lvalue,
699 int ltype,
700 const char *rvalue,
701 void *data,
702 void *userdata) {
703
704 Network *network = ASSERT_PTR(userdata);
705 union in_addr_union a;
706 unsigned char prefixlen;
707 int r;
708
709 assert(filename);
710 assert(lvalue);
711 assert(rvalue);
712
713 if (isempty(rvalue)) {
714 network->dhcp_server_address = (struct in_addr) {};
715 network->dhcp_server_address_prefixlen = 0;
716 return 0;
717 }
718
719 r = in_addr_prefix_from_string(rvalue, AF_INET, &a, &prefixlen);
720 if (r < 0) {
721 log_syntax(unit, LOG_WARNING, filename, line, r,
722 "Failed to parse %s=, ignoring assignment: %s", lvalue, rvalue);
723 return 0;
724 }
725 if (in4_addr_is_null(&a.in) || in4_addr_is_localhost(&a.in)) {
726 log_syntax(unit, LOG_WARNING, filename, line, 0,
727 "DHCP server address cannot be the ANY address or a localhost address, "
728 "ignoring assignment: %s", rvalue);
729 return 0;
730 }
731
732 network->dhcp_server_address = a.in;
733 network->dhcp_server_address_prefixlen = prefixlen;
734 return 0;
735 }