summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-08-31 23:41:34 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-08-31 23:41:34 +0200
commita58a91b6ac6959f1fb8181457ee9706da7bb1e9d (patch)
treedc1867a54419a020105bcfc11b83e272d635dffc /src/network/networkd-link.c
parent3df49c2877757d41e8b00adf697735837b8f6c07 (diff)
parent9b3a67c55b7df6642a0389306c513b17c211f280 (diff)
Merge pull request #1097 from teg/dhcp-server-2
dhcp-server: make pool configurable
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d797a8ded8..979f3115f6 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -730,7 +730,6 @@ static int link_enter_set_addresses(Link *link) {
/* now that we can figure out a default address for the dhcp server,
start it */
if (link_dhcp4_server_enabled(link)) {
- struct in_addr pool_start;
Address *address;
Link *uplink = NULL;
bool acquired_uplink = false;
@@ -742,16 +741,9 @@ static int link_enter_set_addresses(Link *link) {
return 0;
}
- r = sd_dhcp_server_set_address(link->dhcp_server,
- &address->in_addr.in,
- address->prefixlen);
- if (r < 0)
- return r;
-
- /* offer 32 addresses starting from the address following the server address */
- pool_start.s_addr = htobe32(be32toh(address->in_addr.in.s_addr) + 1);
- r = sd_dhcp_server_set_lease_pool(link->dhcp_server,
- &pool_start, 32);
+ /* use the server address' subnet as the pool */
+ r = sd_dhcp_server_configure_pool(link->dhcp_server, &address->in_addr.in, address->prefixlen,
+ link->network->dhcp_server_pool_offset, link->network->dhcp_server_pool_size);
if (r < 0)
return r;
@@ -760,11 +752,6 @@ static int link_enter_set_addresses(Link *link) {
&main_address->in_addr.in);
if (r < 0)
return r;
-
- r = sd_dhcp_server_set_prefixlen(link->dhcp_server,
- main_address->prefixlen);
- if (r < 0)
- return r;
*/
if (link->network->dhcp_server_max_lease_time_usec > 0) {