From: Alan T. DeKok Date: Tue, 22 May 2018 14:23:52 +0000 (-0400) Subject: add load/unload for dhcpv4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81c28b016c16b27aeb84f5e2ade4645647bc19eb;p=thirdparty%2Ffreeradius-server.git add load/unload for dhcpv4 --- diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4.c b/src/modules/proto_dhcpv4/proto_dhcpv4.c index 934c5273e9b..cafa9609e93 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4.c @@ -858,12 +858,30 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) return 0; } +static int mod_load(void) +{ + if (fr_dhcpv4_init() < 0) { + PERROR("Failed initialising DHCP"); + return -1; + } + + return 0; +} + +static void mod_unload(void) +{ + fr_dhcpv4_free(); +} + fr_app_t proto_dhcpv4 = { .magic = RLM_MODULE_INIT, .name = "dhcpv4", .config = proto_dhcpv4_config, .inst_size = sizeof(proto_dhcpv4_t), + .load = mod_load, + .unload = mod_unload, + .bootstrap = mod_bootstrap, .instantiate = mod_instantiate, .open = mod_open,