/[pkgs]/devel/dhcp/dhcp-4.1.0-unicast-bootp.patch
ViewVC logotype

Contents of /devel/dhcp/dhcp-4.1.0-unicast-bootp.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Tue Jan 6 23:46:51 2009 UTC (10 months, 2 weeks ago) by dcantrel
Branch: MAIN
CVS Tags: F-12-split, dhcp-4_1_0-3_fc11, dhcp-4_1_0-2_fc11, dhcp-4_1_0-22_fc12, dhcp-4_1_0-1_fc11, dhcp-4_1_0-20_fc12, dhcp-4_1_0p1-5_fc12, dhcp-4_1_0-16_fc11, dhcp-4_1_0p1-13_fc13, dhcp-4_1_0-11_fc11, dhcp-4_1_0p1-11_fc12, dhcp-4_1_0-10_fc11, dhcp-4_1_0-15_fc11, dhcp-4_1_0-12_fc11, dhcp-4_1_0-14_fc11, F-11-split, dhcp-4_1_0p1-6_fc12, dhcp-4_1_0p1-7_fc12, dhcp-4_1_0p1-8_fc12, dhcp-4_1_0-4_fc11, dhcp-4_1_0p1-4_fc12, dhcp-4_1_0-13_fc11, dhcp-4_1_0-18_fc12, dhcp-4_1_0p1-14_fc13, dhcp-4_1_0-23_fc12, dhcp-4_1_0-6_fc11, dhcp-4_1_0-17_fc12, dhcp-4_1_0-19_fc12, dhcp-4_1_0p1-1_fc12, dhcp-4_1_0p1-3_fc12, dhcp-4_1_0p1-9_fc12, dhcp-4_1_0-9_fc11, dhcp-4_1_0p1-12_fc13, dhcp-4_1_0-26_fc12, dhcp-4_1_0p1-10_fc12, dhcp-4_1_0-8_fc11, dhcp-4_1_0-5_fc11, dhcp-4_1_0-25_fc12, dhcp-4_1_0-24_fc12, dhcp-4_1_0-7_fc11, dhcp-4_1_0-27_fc12, dhcp-4_1_0-21_fc12, dhcp-4_1_0p1-2_fc12, HEAD
File MIME type: text/x-patch
* Tue Jan 06 2009 David Cantrell <dcantrell@redhat.com> - 12:4.1.0-1
- Upgraded to ISC dhcp-4.1.0
- Had to rename the -T option to -timeout as ISC is now using -T
- Allow package rebuilders to easily enable DHCPv6 support with:
      rpmbuild --with DHCPv6 dhcp.spec
  Note that Fedora is still using the 'dhcpv6' package, but some
  users may want to experiment with the ISC DHCPv6 implementation
  locally.
1 diff -up dhcp-4.1.0/server/bootp.c.unicast dhcp-4.1.0/server/bootp.c
2 --- dhcp-4.1.0/server/bootp.c.unicast 2008-08-20 13:07:19.000000000 -1000
3 +++ dhcp-4.1.0/server/bootp.c 2009-01-06 10:13:29.000000000 -1000
4 @@ -58,6 +58,7 @@ void bootp (packet)
5 char msgbuf [1024];
6 int ignorep;
7 int peer_has_leases = 0;
8 + int norelay = 0;
9
10 if (packet -> raw -> op != BOOTREQUEST)
11 return;
12 @@ -73,7 +74,7 @@ void bootp (packet)
13 ? inet_ntoa (packet -> raw -> giaddr)
14 : packet -> interface -> name);
15
16 - if (!locate_network (packet)) {
17 + if ((norelay = locate_network (packet)) == 0) {
18 log_info ("%s: network unknown", msgbuf);
19 return;
20 }
21 @@ -390,6 +391,13 @@ void bootp (packet)
22 from, &to, &hto);
23 goto out;
24 }
25 + } else if (norelay == 2) {
26 + to.sin_addr = raw.ciaddr;
27 + to.sin_port = remote_port;
28 + if (fallback_interface) {
29 + result = send_packet (fallback_interface, (struct packet *)0, &raw, outgoing.packet_length, from, &to, &hto);
30 + goto out;
31 + }
32
33 /* If it comes from a client that already knows its address
34 and is not requesting a broadcast response, and we can
35 diff -up dhcp-4.1.0/server/dhcp.c.unicast dhcp-4.1.0/server/dhcp.c
36 --- dhcp-4.1.0/server/dhcp.c.unicast 2008-11-03 08:13:58.000000000 -1000
37 +++ dhcp-4.1.0/server/dhcp.c 2009-01-06 10:13:29.000000000 -1000
38 @@ -4111,6 +4111,7 @@ int locate_network (packet)
39 struct data_string data;
40 struct subnet *subnet = (struct subnet *)0;
41 struct option_cache *oc;
42 + int norelay = 0;
43
44 /* See if there's a Relay Agent Link Selection Option, or a
45 * Subnet Selection Option. The Link-Select and Subnet-Select
46 @@ -4126,12 +4127,24 @@ int locate_network (packet)
47 from the interface, if there is one. If not, fail. */
48 if (!oc && !packet -> raw -> giaddr.s_addr) {
49 if (packet -> interface -> shared_network) {
50 - shared_network_reference
51 - (&packet -> shared_network,
52 - packet -> interface -> shared_network, MDL);
53 - return 1;
54 + struct in_addr any_addr;
55 + any_addr.s_addr = INADDR_ANY;
56 +
57 + if (!packet -> packet_type && memcmp(&packet -> raw -> ciaddr, &any_addr, 4)) {
58 + struct iaddr cip;
59 + memcpy(cip.iabuf, &packet -> raw -> ciaddr, 4);
60 + cip.len = 4;
61 + if (!find_grouped_subnet(&subnet, packet->interface->shared_network, cip, MDL))
62 + norelay = 2;
63 + }
64 +
65 + if (!norelay) {
66 + shared_network_reference(&packet -> shared_network, packet -> interface -> shared_network, MDL);
67 + return 1;
68 + }
69 + } else {
70 + return 0;
71 }
72 - return 0;
73 }
74
75 /* If there's an option indicating link connection, and it's valid,
76 @@ -4154,7 +4167,10 @@ int locate_network (packet)
77 data_string_forget (&data, MDL);
78 } else {
79 ia.len = 4;
80 - memcpy (ia.iabuf, &packet -> raw -> giaddr, 4);
81 + if (norelay)
82 + memcpy (ia.iabuf, &packet->raw->ciaddr, 4);
83 + else
84 + memcpy (ia.iabuf, &packet->raw->giaddr, 4);
85 }
86
87 /* If we know the subnet on which the IP address lives, use it. */
88 @@ -4162,7 +4178,10 @@ int locate_network (packet)
89 shared_network_reference (&packet -> shared_network,
90 subnet -> shared_network, MDL);
91 subnet_dereference (&subnet, MDL);
92 - return 1;
93 + if (norelay)
94 + return norelay;
95 + else
96 + return 1;
97 }
98
99 /* Otherwise, fail. */

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2