7b69e54
diff -up dhcp-4.3.1b1/client/clparse.c.fLPqYB dhcp-4.3.1b1/client/clparse.c
7b69e54
--- dhcp-4.3.1b1/client/clparse.c.fLPqYB	2014-07-02 19:58:38.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/client/clparse.c	2014-07-10 17:38:26.938599402 +0200
7b69e54
@@ -148,6 +148,7 @@ isc_result_t read_client_conf ()
e83fb19
 	/* Requested lease time, used by DHCPv6 (DHCPv4 uses the option cache)
e83fb19
 	 */
e83fb19
 	top_level_config.requested_lease = 7200;
e83fb19
+	top_level_config.bootp_broadcast_always = 0;
e83fb19
 
e83fb19
 	group_allocate (&top_level_config.on_receipt, MDL);
e83fb19
 	if (!top_level_config.on_receipt)
7b69e54
@@ -353,7 +354,8 @@ void read_client_leases ()
e83fb19
 	interface-declaration |
e83fb19
 	LEASE client-lease-statement |
e83fb19
 	ALIAS client-lease-statement |
e83fb19
-	KEY key-definition */
e83fb19
+	KEY key-definition |
e83fb19
+	BOOTP_BROADCAST_ALWAYS */
e83fb19
 
e83fb19
 void parse_client_statement (cfile, ip, config)
e83fb19
 	struct parse *cfile;
7b69e54
@@ -771,6 +773,12 @@ void parse_client_statement (cfile, ip,
e83fb19
 		parse_reject_statement (cfile, config);
e83fb19
 		return;
e83fb19
 
e83fb19
+	      case BOOTP_BROADCAST_ALWAYS:
e83fb19
+		token = next_token(&val, (unsigned*)0, cfile);
e83fb19
+		config -> bootp_broadcast_always = 1;
e83fb19
+		parse_semi (cfile);
e83fb19
+		return;
e83fb19
+
e83fb19
 	      default:
e83fb19
 		lose = 0;
e83fb19
 		stmt = (struct executable_statement *)0;
7b69e54
diff -up dhcp-4.3.1b1/client/dhclient.8.fLPqYB dhcp-4.3.1b1/client/dhclient.8
7b69e54
--- dhcp-4.3.1b1/client/dhclient.8.fLPqYB	2014-07-02 19:58:38.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/client/dhclient.8	2014-07-10 17:38:26.938599402 +0200
7b69e54
@@ -128,6 +128,33 @@ dhclient - Dynamic Host Configuration Pr
d8c679f
 .B -w
d8c679f
 ]
d8c679f
 [
d8c679f
+.B -B
d8c679f
+]
d8c679f
+[
2ade8d8
+.B -C
d8c679f
+.I dhcp-client-identifier
d8c679f
+]
d8c679f
+[
d8c679f
+.B -H
d8c679f
+.I host-name
d8c679f
+]
d8c679f
+[
d8c679f
+.B -F
d8c679f
+.I fqdn.fqdn
d8c679f
+]
d8c679f
+[
d8c679f
+.B -V
d8c679f
+.I vendor-class-identifier
d8c679f
+]
d8c679f
+[
d8c679f
+.B -R
d8c679f
+.I request-option-list
d8c679f
+]
d8c679f
+[
d8c679f
+.B -timeout
d8c679f
+.I timeout
d8c679f
+]
d8c679f
+[
d8c679f
 .B -v
d8c679f
 ]
d8c679f
 [
7b69e54
@@ -275,6 +302,69 @@ not to exit when it doesn't find any suc
d8c679f
 program can then be used to notify the client when a network interface
d8c679f
 has been added or removed, so that the client can attempt to configure an IP
d8c679f
 address on that interface.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-B
d8c679f
+Set the BOOTP broadcast flag in request packets so servers will always
d8c679f
+broadcast replies.
d8c679f
+
d8c679f
+.TP
2ade8d8
+.BI \-C\ <dhcp-client-identifier>
d8c679f
+Specify the dhcp-client-identifier option to send to the DHCP server.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-H\ <host-name>
d8c679f
+Specify the host-name option to send to the DHCP server.  The host-name
d8c679f
+string only contains the client's hostname prefix, to which the server will
d8c679f
+append the ddns-domainname or domain-name options, if any, to derive the
d8c679f
+fully qualified domain name of the client.  The
d8c679f
+.B -H
d8c679f
+option cannot be used with the
d8c679f
+.B -F
d8c679f
+option.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-F\ <fqdn.fqdn>
d8c679f
+Specify the fqdn.fqdn option to send to the DHCP server.  This option cannot
d8c679f
+be used with the
d8c679f
+.B -H
d8c679f
+option.  The fqdn.fqdn option must specify the complete domain name of the
d8c679f
+client host, which the server may use for dynamic DNS updates.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-V\ <vendor-class-identifier>
d8c679f
+Specify the vendor-class-identifier option to send to the DHCP server.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-R\ <option>[,<option>...]
d8c679f
+Specify the list of options the client is to request from the server.  The
d8c679f
+option list must be a single string consisting of option names separated
d8c679f
+by at least one command and optional space characters.  The default option
d8c679f
+list is:
d8c679f
+
d8c679f
+.BR
d8c679f
+    subnet-mask, broadcast-address, time-offset, routers,
d8c679f
+.BR
d8c679f
+    domain-search, domain-name, domain-name-servers, host-name, 
d8c679f
+.BR
d8c679f
+    nis-domain, nis-servers, ntp-servers, interface-mtu
d8c679f
+
d8c679f
+.TP
d8c679f
+.B -R
d8c679f
+option does not append options to the default request, it overrides the
d8c679f
+default request list.  Keep this in mind if you want to request an
d8c679f
+additional option besides the default request list.  You will have to
d8c679f
+specify all option names for the
d8c679f
+.B -R
d8c679f
+parameter.
d8c679f
+
d8c679f
+.TP
d8c679f
+.BI \-timeout\ <timeout>
d8c679f
+Specify the time after which
d8c679f
+.B dhclient
d8c679f
+will decide that no DHCP servers can be contacted when no responses have been
d8c679f
+received.
d8c679f
+
d8c679f
 .TP
d8c679f
 .BI \-n
d8c679f
 Do not configure any interfaces.  This is most likely to be useful in
7b69e54
diff -up dhcp-4.3.1b1/client/dhclient.c.fLPqYB dhcp-4.3.1b1/client/dhclient.c
7b69e54
--- dhcp-4.3.1b1/client/dhclient.c.fLPqYB	2014-07-02 19:58:38.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/client/dhclient.c	2014-07-10 17:38:44.520350055 +0200
5a3797e
@@ -39,6 +39,12 @@
82186fd
 #include <limits.h>
5a3797e
 #include <dns/result.h>
203b45c
 
203b45c
+/*
203b45c
+ * Defined in stdio.h when _GNU_SOURCE is set, but we don't want to define
203b45c
+ * that when building ISC code.
203b45c
+ */
203b45c
+extern int asprintf(char **strp, const char *fmt, ...);
203b45c
+
203b45c
 TIME default_lease_time = 43200; /* 12 hours... */
203b45c
 TIME max_lease_time = 86400; /* 24 hours... */
203b45c
 
7b69e54
@@ -88,6 +94,9 @@ int wanted_ia_na = -1;		/* the absolute
4bf24c8
 int wanted_ia_ta = 0;
4bf24c8
 int wanted_ia_pd = 0;
82186fd
 char *mockup_relay = NULL;
203b45c
+int bootp_broadcast_always = 0;
203b45c
+
203b45c
+extern u_int32_t default_requested_options[];
203b45c
 
4bf24c8
 void run_stateless(int exit_mode);
203b45c
 
7b69e54
@@ -125,6 +134,15 @@ main(int argc, char **argv) {
82186fd
 	int local_family_set = 0;
4bf24c8
 #endif /* DHCPv6 */
203b45c
 	char *s;
203b45c
+	char *dhcp_client_identifier_arg = NULL;
203b45c
+	char *dhcp_host_name_arg = NULL;
203b45c
+	char *dhcp_fqdn_arg = NULL;
203b45c
+	char *dhcp_vendor_class_identifier_arg = NULL;
203b45c
+	char *dhclient_request_options = NULL;
203b45c
+
203b45c
+	int timeout_arg = 0;
203b45c
+	char *arg_conf = NULL;
203b45c
+	int arg_conf_len = 0;
203b45c
 
82186fd
 	/* Initialize client globals. */
82186fd
 	memset(&default_duid, 0, sizeof(default_duid));
7b69e54
@@ -325,6 +343,88 @@ main(int argc, char **argv) {
7b69e54
 					 strlen(PACKAGE_VERSION)));
7b69e54
 			IGNORE_RET(write(STDERR_FILENO, "\n", 1));
4bf24c8
 			exit(0);
2ade8d8
+		} else if (!strcmp(argv[i], "-C")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
82186fd
+			if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) {
2ade8d8
+				log_error("-C option dhcp-client-identifier string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1);
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			dhcp_client_identifier_arg = argv[i];
4bf24c8
+		} else if (!strcmp(argv[i], "-B")) {
203b45c
+			bootp_broadcast_always = 1;
4bf24c8
+		} else if (!strcmp(argv[i], "-H")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
82186fd
+			if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) {
4bf24c8
+				log_error("-H option host-name string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1);
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			if (dhcp_host_name_arg != NULL) {
203b45c
+				log_error("The -H <host-name> and -F <fqdn> arguments are mutually exclusive");
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			dhcp_host_name_arg = argv[i];
4bf24c8
+		} else if (!strcmp(argv[i], "-F")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
82186fd
+			if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) {
4bf24c8
+				log_error("-F option fqdn.fqdn string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1);
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			if (dhcp_fqdn_arg != NULL) {
203b45c
+				log_error("Only one -F <fqdn> argument can be specified");
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			if (dhcp_host_name_arg != NULL) {
203b45c
+				log_error("The -F <fqdn> and -H <host-name> arguments are mutually exclusive");
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			dhcp_fqdn_arg = argv[i];
4bf24c8
+		} else if (!strcmp(argv[i], "-timeout")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			if ((timeout_arg = atoi(argv[i])) <= 0) {
663dcea
+				log_error("timeout option must be > 0 - bad value: %s",argv[i]);
203b45c
+				exit(1);
203b45c
+			}
4bf24c8
+		} else if (!strcmp(argv[i], "-V")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
82186fd
+			if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) {
4bf24c8
+				log_error("-V option vendor-class-identifier string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1);
203b45c
+				exit(1);
203b45c
+			}
203b45c
+
203b45c
+			dhcp_vendor_class_identifier_arg = argv[i];
4bf24c8
+		} else if (!strcmp(argv[i], "-R")) {
203b45c
+			if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
4bf24c8
+				usage();
4bf24c8
+				exit(1);
203b45c
+			}
203b45c
+
4bf24c8
+			dhclient_request_options = argv[i];
4bf24c8
 		} else if (argv[i][0] == '-') {
4bf24c8
 		    usage();
4bf24c8
 		} else if (interfaces_requested < 0) {
7b69e54
@@ -507,6 +607,156 @@ main(int argc, char **argv) {
203b45c
 	/* Parse the dhclient.conf file. */
4bf24c8
 	read_client_conf();
203b45c
 
203b45c
+	/* Parse any extra command line configuration arguments: */
203b45c
+	if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) {
203b45c
+		arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg);
203b45c
+
203b45c
+		if ((arg_conf == 0) || (arg_conf_len <= 0))
2ade8d8
+			log_fatal("Unable to send -C option dhcp-client-identifier");
203b45c
+	}
203b45c
+
203b45c
+	if ((dhcp_host_name_arg != NULL) && (*dhcp_host_name_arg != '\0')) {
203b45c
+		if (arg_conf == 0) {
203b45c
+			arg_conf_len = asprintf(&arg_conf, "send host-name \"%s\";", dhcp_host_name_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -H option host-name");
203b45c
+		} else {
203b45c
+			char *last_arg_conf = arg_conf;
203b45c
+			arg_conf = NULL;
4bf24c8
+			arg_conf_len = asprintf(&arg_conf, "%s\nsend host-name \"%s\";", last_arg_conf, dhcp_host_name_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -H option host-name");
203b45c
+
203b45c
+			free(last_arg_conf);
203b45c
+		}
203b45c
+	}
203b45c
+
203b45c
+	if ((dhcp_fqdn_arg != NULL) && (*dhcp_fqdn_arg != '\0')) {
203b45c
+		if (arg_conf == 0) {
203b45c
+			arg_conf_len = asprintf(&arg_conf,  "send fqdn.fqdn \"%s\";", dhcp_fqdn_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -F option fqdn.fqdn");
203b45c
+		} else {
203b45c
+			char *last_arg_conf = arg_conf;
203b45c
+			arg_conf = NULL;
4bf24c8
+			arg_conf_len = asprintf(&arg_conf, "%s\nsend fqdn.fqdn \"%s\";", last_arg_conf, dhcp_fqdn_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0)  || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -F option fqdn.fqdn");
203b45c
+
203b45c
+			free(last_arg_conf);
203b45c
+		}
203b45c
+	}
203b45c
+
203b45c
+	if (timeout_arg) {
203b45c
+		if (arg_conf == 0) {
203b45c
+			arg_conf_len = asprintf(&arg_conf,  "timeout %d;", timeout_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
4bf24c8
+				log_fatal("Unable to process -timeout timeout argument");
203b45c
+		} else {
203b45c
+			char *last_arg_conf = arg_conf;
203b45c
+			arg_conf = NULL;
4bf24c8
+			arg_conf_len = asprintf(&arg_conf, "%s\ntimeout %d;", last_arg_conf, timeout_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len == 0))
4bf24c8
+				log_fatal("Unable to process -timeout timeout argument");
203b45c
+
203b45c
+			free(last_arg_conf);
203b45c
+		}
203b45c
+	}
203b45c
+
203b45c
+	if ((dhcp_vendor_class_identifier_arg != NULL) && (*dhcp_vendor_class_identifier_arg != '\0')) {
203b45c
+		if (arg_conf == 0) {
203b45c
+			arg_conf_len = asprintf(&arg_conf,  "send vendor-class-identifier \"%s\";", dhcp_vendor_class_identifier_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -V option vendor-class-identifier");
203b45c
+		} else {
203b45c
+			char *last_arg_conf = arg_conf;
203b45c
+			arg_conf = NULL;
203b45c
+			arg_conf_len = asprintf(&arg_conf, "%s\nsend vendor-class-identifier \"%s\";", last_arg_conf, dhcp_vendor_class_identifier_arg);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to send -V option vendor-class-identifier");
203b45c
+
203b45c
+			free(last_arg_conf);
203b45c
+		}
203b45c
+	}
203b45c
+
203b45c
+	if (dhclient_request_options != NULL) {
203b45c
+		if (arg_conf == 0) {
203b45c
+			arg_conf_len = asprintf(&arg_conf,  "request %s;", dhclient_request_options);
203b45c
+
203b45c
+			if ((arg_conf == 0) || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to parse -R <request options list> argument");
203b45c
+		} else {
203b45c
+			char *last_arg_conf = arg_conf;
203b45c
+			arg_conf = NULL;
203b45c
+			arg_conf_len = asprintf(&arg_conf, "%s\nrequest %s;", last_arg_conf, dhclient_request_options);
203b45c
+
203b45c
+			if ((arg_conf == 0)  || (arg_conf_len <= 0))
203b45c
+				log_fatal("Unable to parse -R <request options list> argument");
203b45c
+
203b45c
+			free(last_arg_conf);
203b45c
+		}
203b45c
+	}
203b45c
+
203b45c
+	if (arg_conf) {
203b45c
+		if (arg_conf_len == 0)
203b45c
+			if ((arg_conf_len = strlen(arg_conf)) == 0)
203b45c
+				/* huh ? cannot happen ! */
2ade8d8
+				log_fatal("Unable to process -C/-H/-F/-timeout/-V/-R configuration arguments");
203b45c
+
203b45c
+		/* parse the extra dhclient.conf configuration arguments
203b45c
+		 * into top level config: */
203b45c
+		struct parse *cfile = (struct parse *)0;
203b45c
+		const char *val = NULL;
203b45c
+		int token;
203b45c
+
2ade8d8
+		status = new_parse(&cfile, -1, arg_conf, arg_conf_len, "extra dhclient -C/-H/-F/-timeout/-V/-R configuration arguments", 0);
203b45c
+
203b45c
+		if ((status != ISC_R_SUCCESS) || (cfile -> warnings_occurred))
2ade8d8
+			log_fatal("Cannot parse -C/-H/-F/-timeout/-V/-R configuration arguments !");
203b45c
+		/* more detailed parse failures will be logged */
203b45c
+
203b45c
+		do {
4bf24c8
+			token = peek_token(&val, (unsigned *)0, cfile);
203b45c
+			if (token == END_OF_FILE)
203b45c
+				break;
203b45c
+
4bf24c8
+			parse_client_statement(cfile, (struct interface_info *)0, &top_level_config);
203b45c
+		} while (1);
203b45c
+
203b45c
+		if (cfile -> warnings_occurred)
2ade8d8
+			log_fatal("Cannot parse -C/-H/-F/-timeout/-V/-R configuration arguments !");
4bf24c8
+		end_parse(&cfile);
203b45c
+
203b45c
+		if (timeout_arg) {
203b45c
+			/* we just set the toplevel timeout, but per-client
663dcea
+			 * timeouts may still be at defaults.
203b45c
+			 */
4bf24c8
+			for (ip=interfaces; ip; ip = ip->next) {
203b45c
+				if (ip->client->config->timeout == 60)
203b45c
+					ip->client->config->timeout = timeout_arg;
203b45c
+			}
203b45c
+		}
203b45c
+
203b45c
+		if ((dhclient_request_options != 0) && (top_level_config.requested_options != default_requested_options)) {
4bf24c8
+			for (ip=interfaces; ip; ip = ip->next) {
203b45c
+				if (ip->client->config->requested_options == default_requested_options)
203b45c
+					ip->client->config->requested_options = top_level_config.requested_options;
203b45c
+			}
203b45c
+		}
203b45c
+
203b45c
+		free(arg_conf);
203b45c
+		arg_conf = NULL;
203b45c
+		arg_conf_len = 0;
203b45c
+	}
203b45c
+
203b45c
 	/* Parse the lease database. */
4bf24c8
 	read_client_leases();
203b45c
 
7b69e54
@@ -756,6 +1006,10 @@ static void usage()
7b69e54
 		  "                [-s server-addr] [-cf config-file]\n"
7b69e54
 		  "                [-df duid-file] [-lf lease-file]\n"
d8c679f
 		  "                [-pf pid-file] [--no-pid] [-e VAR=val]\n"
2ade8d8
+		  "                [-C <dhcp-client-identifier>] [-B]\n"
d8c679f
+		  "                [-H <host-name> | -F <fqdn.fqdn>] [-timeout <timeout>]\n"
d8c679f
+		  "                [-V <vendor-class-identifier>]\n"
d8c679f
+		  "                [-R <request option list>]\n"
d8c679f
 		  "                [-sf script-file] [interface]");
d8c679f
 }
d8c679f
 
7b69e54
@@ -2531,7 +2785,8 @@ void make_discover (client, lease)
203b45c
 	client -> packet.xid = random ();
203b45c
 	client -> packet.secs = 0; /* filled in by send_discover. */
203b45c
 
203b45c
-	if (can_receive_unicast_unconfigured (client -> interface))
203b45c
+	if ((!(bootp_broadcast_always || client->config->bootp_broadcast_always))
203b45c
+	    && can_receive_unicast_unconfigured(client->interface))
203b45c
 		client -> packet.flags = 0;
203b45c
 	else
203b45c
 		client -> packet.flags = htons (BOOTP_BROADCAST);
7b69e54
@@ -2615,7 +2870,9 @@ void make_request (client, lease)
203b45c
 	} else {
203b45c
 		memset (&client -> packet.ciaddr, 0,
203b45c
 			sizeof client -> packet.ciaddr);
203b45c
-		if (can_receive_unicast_unconfigured (client -> interface))
203b45c
+		if ((!(bootp_broadcast_always ||
203b45c
+		    client ->config->bootp_broadcast_always)) &&
203b45c
+		    can_receive_unicast_unconfigured (client -> interface))
203b45c
 			client -> packet.flags = 0;
203b45c
 		else
203b45c
 			client -> packet.flags = htons (BOOTP_BROADCAST);
7b69e54
@@ -2677,7 +2934,8 @@ void make_decline (client, lease)
203b45c
 	client -> packet.hops = 0;
203b45c
 	client -> packet.xid = client -> xid;
203b45c
 	client -> packet.secs = 0; /* Filled in by send_request. */
203b45c
-	if (can_receive_unicast_unconfigured (client -> interface))
203b45c
+	if ((!(bootp_broadcast_always || client->config-> bootp_broadcast_always))
203b45c
+	    && can_receive_unicast_unconfigured (client->interface))
203b45c
 		client -> packet.flags = 0;
203b45c
 	else
203b45c
 		client -> packet.flags = htons (BOOTP_BROADCAST);
7b69e54
diff -up dhcp-4.3.1b1/common/conflex.c.fLPqYB dhcp-4.3.1b1/common/conflex.c
7b69e54
--- dhcp-4.3.1b1/common/conflex.c.fLPqYB	2014-07-02 19:58:38.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/common/conflex.c	2014-07-10 17:38:26.940599374 +0200
7b69e54
@@ -811,6 +811,8 @@ intern(char *atom, enum dhcp_token dfv)
4bf24c8
 			return BALANCE;
4bf24c8
 		if (!strcasecmp (atom + 1, "ound"))
4bf24c8
 			return BOUND;
4bf24c8
+		if (!strcasecmp (atom + 1, "ootp-broadcast-always"))
4bf24c8
+			return BOOTP_BROADCAST_ALWAYS;
4bf24c8
 		break;
4bf24c8
 	      case 'c':
9538db2
 		if (!strcasecmp(atom + 1, "ase"))
7b69e54
diff -up dhcp-4.3.1b1/includes/dhcpd.h.fLPqYB dhcp-4.3.1b1/includes/dhcpd.h
7b69e54
--- dhcp-4.3.1b1/includes/dhcpd.h.fLPqYB	2014-07-02 19:58:39.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/includes/dhcpd.h	2014-07-10 17:38:26.941599360 +0200
7b69e54
@@ -1152,6 +1152,9 @@ struct client_config {
4bf24c8
 	int do_forward_update;		/* If nonzero, and if we have the
4bf24c8
 					   information we need, update the
4bf24c8
 					   A record for the address we get. */
4bf24c8
+
4bf24c8
+	int bootp_broadcast_always;	/* If nonzero, always set the BOOTP_BROADCAST
4bf24c8
+					   flag in requests */
4bf24c8
 };
203b45c
 
4bf24c8
 /* Per-interface state used in the dhcp client... */
7b69e54
diff -up dhcp-4.3.1b1/includes/dhctoken.h.fLPqYB dhcp-4.3.1b1/includes/dhctoken.h
7b69e54
--- dhcp-4.3.1b1/includes/dhctoken.h.fLPqYB	2014-07-02 19:58:39.000000000 +0200
7b69e54
+++ dhcp-4.3.1b1/includes/dhctoken.h	2014-07-10 17:38:26.942599346 +0200
7b69e54
@@ -367,7 +367,8 @@ enum dhcp_token {
e83fb19
 	TOKEN_INFINIBAND = 668,
e83fb19
 	POOL6 = 669,
e83fb19
 	V6RELAY = 670,
e83fb19
-	V6RELOPT = 671
e83fb19
+	V6RELOPT = 671,
e83fb19
+	BOOTP_BROADCAST_ALWAYS = 672
4bf24c8
 };
203b45c
 
5a3797e
 #define is_identifier(x)	((x) >= FIRST_TOKEN &&	\