1 --- dhcp-3.0.5/server/bootp.c.unicast 2005-05-18 15:54:17.000000000 -0400
2 +++ dhcp-3.0.5/server/bootp.c 2007-03-30 16:16:00.000000000 -0400
6 int peer_has_leases = 0;
9 if (packet -> raw -> op != BOOTREQUEST)
12 ? inet_ntoa (packet -> raw -> giaddr)
13 : packet -> interface -> name);
15 - if (!locate_network (packet)) {
16 + if ((norelay = locate_network (packet)) == 0) {
17 log_info ("%s: network unknown", msgbuf);
24 + } else if (norelay == 2) {
25 + to.sin_addr = raw.ciaddr;
26 + to.sin_port = remote_port;
27 + if (fallback_interface) {
28 + result = send_packet (fallback_interface, (struct packet *)0, &raw, outgoing.packet_length, from, &to, &hto);
32 /* If it comes from a client that already knows its address
33 and is not requesting a broadcast response, and we can
34 --- dhcp-3.0.5/server/dhcp.c.unicast 2007-03-30 16:13:36.000000000 -0400
35 +++ dhcp-3.0.5/server/dhcp.c 2007-03-30 16:19:35.000000000 -0400
37 struct data_string data;
38 struct subnet *subnet = (struct subnet *)0;
39 struct option_cache *oc;
42 /* See if there's a subnet selection option. */
43 oc = lookup_option (&dhcp_universe, packet -> options,
44 @@ -3826,12 +3827,24 @@
45 from the interface, if there is one. If not, fail. */
46 if (!oc && !packet -> raw -> giaddr.s_addr) {
47 if (packet -> interface -> shared_network) {
48 - shared_network_reference
49 - (&packet -> shared_network,
50 - packet -> interface -> shared_network, MDL);
52 + struct in_addr any_addr;
53 + any_addr.s_addr = INADDR_ANY;
55 + if (!packet -> packet_type && memcmp(&packet -> raw -> ciaddr, &any_addr, 4)) {
57 + memcpy(cip.iabuf, &packet -> raw -> ciaddr, 4);
59 + if (!find_grouped_subnet(&subnet, packet->interface->shared_network, cip, MDL))
64 + shared_network_reference(&packet -> shared_network, packet -> interface -> shared_network, MDL);
73 /* If there's an SSO, and it's valid, use it to figure out the
74 @@ -3853,7 +3866,10 @@
75 data_string_forget (&data, MDL);
78 - memcpy (ia.iabuf, &packet -> raw -> giaddr, 4);
80 + memcpy (ia.iabuf, &packet->raw->ciaddr, 4);
82 + memcpy (ia.iabuf, &packet->raw->giaddr, 4);
85 /* If we know the subnet on which the IP address lives, use it. */
86 @@ -3861,7 +3877,10 @@
87 shared_network_reference (&packet -> shared_network,
88 subnet -> shared_network, MDL);
89 subnet_dereference (&subnet, MDL);
97 /* Otherwise, fail. */