dhclient binary size
Thomas Markwalder
tmark at isc.org
Wed Sep 28 14:54:58 UTC 2016
On 9/28/16 10:23 AM, Bancroft, Matt wrote:
>
> Hi,
>
>
>
> Between 4.1-ESV-R12b1 and 4.3.4 the binary size of the dhclient
> significantly increased.
>
>
>
> I‘ve had a search back through posts and cannot see any discussion
> about why this is; presumably the DDNS changes?
>
>
>
> Is there any way to compile a minimum feature version to maintain a
> small binary size for the client?
>
>
>
> Kind Regards,
>
> Matt Bancroft
>
>
>
Hello Matt:
If you do not need the client to support DNS updates, you can compile it
out. To do so you need to:
1. Undefine NSUPDATE (comment it out) in includes/site.
2. dhclient_ddns_cb_free(), needs to be wrapped with NSUPDATE
conditional compilation.
Rebuild.
I have attached a diff, containing these changes. The resulting client
is notably smaller. Please note that, these changes have
not been tested and are use-at-your-own-risk.
Sincerely,
Thomas Markwalder
ISC Software Engineering
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20160928/98f380cf/attachment.html>
-------------- next part --------------
diff --git a/client/dhclient.c b/client/dhclient.c
index f7486c6..e253e6c 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -110,8 +110,10 @@ static int check_domain_name_list(const char *ptr, size_t len, int dots);
static int check_option_values(struct universe *universe, unsigned int opt,
const char *ptr, size_t len);
+#if defined (NSUPDATE)
static void dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb,
char* file, int line);
+#endif
/*!
*
@@ -5160,6 +5162,7 @@ add_reject(struct packet *packet) {
log_info("Server added to list of rejected servers.");
}
+#if defined (NSUPDATE)
/* Wrapper function around common ddns_cb_free function that ensures
* we set the client_state pointer to the control block to NULL. */
static void
@@ -5173,6 +5176,7 @@ dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb, char* file, int line) {
ddns_cb_free(ddns_cb, file, line);
}
}
+#endif
#if defined(DHCPv6) && defined(DHCP4o6)
/*
diff --git a/includes/site.h b/includes/site.h
index 1f4407f..52482e9 100644
--- a/includes/site.h
+++ b/includes/site.h
@@ -121,7 +121,7 @@
/* Define this if you want DNS update functionality to be available. */
-#define NSUPDATE
+/* #define NSUPDATE */
/* Define this if you want to enable the DHCP server attempting to
find a nameserver to use for DDNS updates. */
More information about the dhcp-users
mailing list