]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add load/unload for dhcpv4
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 May 2018 14:23:52 +0000 (10:23 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 22 May 2018 14:23:52 +0000 (10:23 -0400)
src/modules/proto_dhcpv4/proto_dhcpv4.c

index 934c5273e9bda6340730dff76ae0d5215cf08489..cafa9609e9325257f6b838ef860c6c70cf1b4417 100644 (file)
@@ -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,