aboutsummaryrefslogtreecommitdiffstats
path: root/examples/historical/patches/dhcpd-never-broadcast.diff
blob: ac6d24d053a7ab52b2b52b81f36ce17620331e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
diff -ur isc-dhcp-4.1.1-P1/includes/dhcpd.h isc-dhcp-4.1.1-P1.patched//includes/dhcpd.h
--- isc-dhcp-4.1.1-P1/includes/dhcpd.h	2012-04-04 16:49:44.000000000 +0200
+++ isc-dhcp-4.1.1-P1.patched//includes/dhcpd.h	2012-04-04 14:56:43.000000000 +0200
@@ -626,6 +626,7 @@
 #define SV_LIMIT_PREFS_PER_IA		57
 #define SV_DELAYED_ACK			58
 #define SV_MAX_ACK_DELAY		59
+#define SV_NEVER_BROADCAST		60
 
 #if !defined (DEFAULT_PING_TIMEOUT)
 # define DEFAULT_PING_TIMEOUT 1
diff -ur isc-dhcp-4.1.1-P1/server/bootp.c isc-dhcp-4.1.1-P1.patched//server/bootp.c
--- isc-dhcp-4.1.1-P1/server/bootp.c	2009-07-25 00:04:52.000000000 +0200
+++ isc-dhcp-4.1.1-P1.patched//server/bootp.c	2012-04-04 14:55:21.000000000 +0200
@@ -283,6 +283,15 @@
 					   &lease -> scope, oc, MDL))
 		raw.flags |= htons (BOOTP_BROADCAST);
 
+	/* The inverse. */
+	if ((oc = lookup_option (&server_universe,
+				options, SV_NEVER_BROADCAST)) &&
+	    evaluate_boolean_option_cache (&ignorep, packet, lease,
+					   (struct client_state *)0,
+					   packet -> options, options,
+					   &lease -> scope, oc, MDL))
+		raw.flags &= htons (~BOOTP_BROADCAST);
+
 	/* Figure out the address of the next server. */
 	memset (&d1, 0, sizeof d1);
 	oc = lookup_option (&server_universe, options, SV_NEXT_SERVER);
diff -ur isc-dhcp-4.1.1-P1/server/dhcp.c isc-dhcp-4.1.1-P1.patched//server/dhcp.c
--- isc-dhcp-4.1.1-P1/server/dhcp.c	2012-04-04 16:48:46.000000000 +0200
+++ isc-dhcp-4.1.1-P1.patched//server/dhcp.c	2012-04-04 14:55:45.000000000 +0200
@@ -2482,6 +2482,15 @@
 					   &lease -> scope, oc, MDL))
 		state -> bootp_flags |= htons (BOOTP_BROADCAST);
 
+	/* The inverse. */
+	if ((oc = lookup_option (&server_universe, state -> options,
+				SV_NEVER_BROADCAST)) &&
+	    evaluate_boolean_option_cache (&ignorep, packet, lease,
+					   (struct client_state *)0,
+					   packet -> options, state -> options,
+					   &lease -> scope, oc, MDL))
+		state -> bootp_flags &= htons (~BOOTP_BROADCAST);
+
 	/* Get the Maximum Message Size option from the packet, if one
 	   was sent. */
 	oc = lookup_option (&dhcp_universe, packet -> options,
diff -ur isc-dhcp-4.1.1-P1/server/dhcpd.conf.5 isc-dhcp-4.1.1-P1.patched//server/dhcpd.conf.5
--- isc-dhcp-4.1.1-P1/server/dhcpd.conf.5	2012-04-04 16:48:46.000000000 +0200
+++ isc-dhcp-4.1.1-P1.patched//server/dhcpd.conf.5	2012-04-04 16:45:44.000000000 +0200
@@ -1914,6 +1914,24 @@
 .RE
 .PP
 The
+.I never-broadcast
+statement
+.RS 0.25i
+.PP
+.B never-broadcast \fIflag\fR\fB;\fR
+.PP
+When using DHCP in routed networks, the router has to participate in rewriting
+and sending DHCP replies on to the user.    Unfortunately, some devices,
+in particular Cisco's Nexus series of switches, drop such DHCP reply packets
+with the broadcast bit in the flags field of the DHCP message header set.
+Thi means that some operating systems, in particular Microsoft Windows Vista,
+can have problems getting DHCP to work in such environments.   If you enable
+this flag, the DHCP server will never set the broadcast flags in the replies
+it sends, even if the client set the broadcast flag.   This flag overrides
+the never-broadcast flag if both are set.
+.RE
+.PP
+The
 .I always-reply-rfc1048
 statement
 .RS 0.25i
diff -ur isc-dhcp-4.1.1-P1/server/stables.c isc-dhcp-4.1.1-P1.patched//server/stables.c
--- isc-dhcp-4.1.1-P1/server/stables.c	2012-04-04 16:49:44.000000000 +0200
+++ isc-dhcp-4.1.1-P1.patched//server/stables.c	2012-04-04 14:56:43.000000000 +0200
@@ -203,6 +203,7 @@
 	{ "always-reply-rfc1048", "f",		&server_universe,  20, 1 },
 	{ "site-option-space", "X",		&server_universe,  21, 1 },
 	{ "always-broadcast", "f",		&server_universe,  22, 1 },
+	{ "never-broadcast", "f",		&server_universe,  60, 1 },
 	{ "ddns-domainname", "t",		&server_universe,  23, 1 },
 	{ "ddns-hostname", "t",			&server_universe,  24, 1 },
 	{ "ddns-rev-domainname", "t",		&server_universe,  25, 1 },
an>nms::config::sec_net_v6)->short(); my ($sec_first, $sec_last) = ("8000", "9999"); # Create PXE-boot configuration file for DHCP if ( not -f $dhcpd_conf ) { print STDERR "Creating file " . $dhcpd_conf . "\n"; open DHCPDFILE, ">" . $dhcpd_conf or die ( $! . " " . $dhcpd_conf); print DHCPDFILE <<"EOF"; # GENERATED BY make-dhcpd6.pl # IPv6 address valid lifetime # (at the end the address is no longer usable by the client) # (usual IPv6 default is 30 days) default-lease-time 3600; # IPv6 address preferred lifetime # (at the end the address is deprecated, i.e., the client should use # other addresses for new connections) # (usual IPv6 default is 7 days) preferred-lifetime 3600; # T1, the delay before Renew # (default is 1/2 preferred lifetime) option dhcp-renewal-time 1800; # T2, the delay before Rebind (if Renews failed) # (default is 3/4 preferred lifetime) option dhcp-rebinding-time 1800; # Enable RFC 5007 support allow leasequery; # Set preference to 255 (maximum) in order to avoid waiting for # additional servers when there is only one option dhcp6.preference 255; # Server side command to enable rapid-commit (2 packet exchange) option dhcp6.rapid-commit; # The delay before information-request refresh # (minimum is 10 minutes, maximum one day, default is to not refresh) # (set to 6 hours) option dhcp6.info-refresh-time 21600; # Don't let clients set their own FQDN ignore client-updates; # disable ddns ddns-update-style none; # make server authorative authoritative; # Global definitions for name server address(es) and domain search list option domain-name "$nms::config::tgname.gathering.org"; option dhcp6.name-servers $nms::config::pri_v6, $nms::config::sec_v6; key DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; secret $nms::config::ddns_key; } subnet6 $nms::config::pri_net_v6 {} subnet6 $nms::config::sec_net_v6 { range6 ${sec_net}${sec_first} ${sec_net}${sec_last}; } include "/etc/dhcp/v6-generated-include.conf"; include "$dhcpd_pxeconf"; #include "$dhcpd_wlc_conf"; #include "$dhcpd_voip_conf"; EOF close DHCPDFILE; } # Create PXE-boot configuration file for DHCP if ( not -f $dhcpd_pxeconf ) { print STDERR "Creating file " . $dhcpd_pxeconf . "\n"; open PXEFILE, ">" . $dhcpd_pxeconf or die ( $! . " " . $dhcpd_pxeconf); print PXEFILE <<"EOF"; option dhcp6.bootfile-url code 59 = string; option dhcp6.client-arch-type code 61 = array of unsigned integer 16; if option dhcp6.client-arch-type = 00:07 { option dhcp6.bootfile-url "tftp://[$nms::config::pxe_server_v6]/bootx64.efi"; } else { # support a hypothetical BIOS system that can PXE boot over IPv6 option dhcp6.bootfile-url "tftp://[$nms::config::pxe_server_v6]/pxelinux.0"; } EOF close PXEFILE; } # Create WLC configuration file if ( not -f $dhcpd_wlc_conf ) { print STDERR "Creating file " . $dhcpd_wlc_conf . "\n"; open WLCFILE, ">" . $dhcpd_wlc_conf or die ( $! . " " . $dhcpd_wlc_conf); print WLCFILE <<"EOF"; option space AP; option AP.server-address code 241 = array of ip-address; set vendor-string = option vendor-class-identifier; class "access-points" { match if substring (option vendor-class-identifier, 0, 8) = "Access Point"; vendor-option-space AP; option AP.server-address $nms::config::wlc1; } EOF close WLCFILE; } # Create VoIP config if ( not -f $dhcpd_voip_conf ) { print STDERR "Creating file " . $dhcpd_voip_conf . "\n"; open VOIPFILE, ">" . $dhcpd_voip_conf or die ( $! . " " . $dhcpd_voip_conf); print VOIPFILE <<"EOF"; option space CiscoVOIP; option CiscoVOIP.cm-tftp-server code 150 = array of ip-address; class "cisco-voip-lan" { match if substring (option vendor-class-identifier, 0, 28) = "Cisco Systems, Inc. IP Phone"; vendor-option-space CiscoVOIP; log( info, concat( "LOLOPHONE: " , option vendor-class-identifier )); option CiscoVOIP.cm-tftp-server $nms::config::voip1; next-server $nms::config::voip1; } class "cisco-voip-wlan" { match if substring (option vendor-class-identifier, 0, 33) = "Cisco Systems Inc. Wireless Phone"; vendor-option-space CiscoVOIP; log( info, concat( "BANANAPHONE: " , option vendor-class-identifier )); option CiscoVOIP.cm-tftp-server $nms::config::voip1; next-server $nms::config::voip1; } EOF close VOIPFILE; }