dhclient: Don't retry on DECLINE when -1 option used
Don't build with -D_GNU_SOURCE, configure.ac uses AC_USE_SYSTEM_EXTENSIONS
This commit is contained in:
		
							parent
							
								
									102f232ffe
								
							
						
					
					
						commit
						f3cba52167
					
				
							
								
								
									
										27
									
								
								dhcp-4.2.3-dhclient-decline-onetry.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								dhcp-4.2.3-dhclient-decline-onetry.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | |||||||
|  | diff -up dhcp-4.2.3/client/dhclient.c.decline-onetry dhcp-4.2.3/client/dhclient.c
 | ||||||
|  | --- dhcp-4.2.3/client/dhclient.c.decline-onetry	2011-11-24 14:21:50.000000000 +0100
 | ||||||
|  | +++ dhcp-4.2.3/client/dhclient.c	2011-11-24 14:23:44.472893215 +0100
 | ||||||
|  | @@ -1704,11 +1704,18 @@ void bind_lease (client)
 | ||||||
|  |  	if (script_go (client)) { | ||||||
|  |  		make_decline (client, client -> new); | ||||||
|  |  		send_decline (client); | ||||||
|  | -		destroy_client_lease (client -> new);
 | ||||||
|  | -		client -> new = (struct client_lease *)0;
 | ||||||
|  | -		client -> state = S_DECLINED;
 | ||||||
|  | -		state_init (client);
 | ||||||
|  | -		return;
 | ||||||
|  | +		if (onetry) {
 | ||||||
|  | +			if (!quiet)
 | ||||||
|  | +			  log_info ("Unable to obtain a lease on first try.%s",
 | ||||||
|  | +					"  Exiting.");
 | ||||||
|  | +			exit (2);
 | ||||||
|  | +		} else {
 | ||||||
|  | +			destroy_client_lease (client -> new);
 | ||||||
|  | +			client -> new = (struct client_lease *)0;
 | ||||||
|  | +			client -> state = S_DECLINED;
 | ||||||
|  | +			state_init (client);
 | ||||||
|  | +			return;
 | ||||||
|  | +		}
 | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  |  	/* Write out the new lease if it has been long enough. */ | ||||||
							
								
								
									
										15
									
								
								dhcp.spec
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								dhcp.spec
									
									
									
									
									
								
							| @ -22,7 +22,7 @@ | |||||||
| Summary:  Dynamic host configuration protocol software | Summary:  Dynamic host configuration protocol software | ||||||
| Name:     dhcp | Name:     dhcp | ||||||
| Version:  4.2.3 | Version:  4.2.3 | ||||||
| Release:  6%{?dist} | Release:  7%{?dist} | ||||||
| # NEVER CHANGE THE EPOCH on this package.  The previous maintainer (prior to | # NEVER CHANGE THE EPOCH on this package.  The previous maintainer (prior to | ||||||
| # dcantrell maintaining the package) made incorrect use of the epoch and | # dcantrell maintaining the package) made incorrect use of the epoch and | ||||||
| # that's why it is at 12 now.  It should have never been used, but it was. | # that's why it is at 12 now.  It should have never been used, but it was. | ||||||
| @ -76,6 +76,7 @@ Patch33:  dhcp-4.2.2-lpf-ib.patch | |||||||
| Patch34:  dhcp-4.2.2-improved-xid.patch | Patch34:  dhcp-4.2.2-improved-xid.patch | ||||||
| Patch35:  dhcp-4.2.2-gpxe-cid.patch | Patch35:  dhcp-4.2.2-gpxe-cid.patch | ||||||
| Patch36:  dhcp-4.2.2-systemtap.patch | Patch36:  dhcp-4.2.2-systemtap.patch | ||||||
|  | Patch37:  dhcp-4.2.3-dhclient-decline-onetry.patch | ||||||
| 
 | 
 | ||||||
| BuildRequires: autoconf | BuildRequires: autoconf | ||||||
| BuildRequires: automake | BuildRequires: automake | ||||||
| @ -328,6 +329,11 @@ rm bind/bind.tar.gz | |||||||
| # http://sourceware.org/systemtap/wiki/SystemTap | # http://sourceware.org/systemtap/wiki/SystemTap | ||||||
| %patch36 -p1 -b .systemtap | %patch36 -p1 -b .systemtap | ||||||
| 
 | 
 | ||||||
|  | # Send DHCPDECLINE and exit(2) when duplicate address was detected and | ||||||
|  | # dhclient had been started with '-1' (#756759). | ||||||
|  | # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #26735]) | ||||||
|  | %patch37 -p1 -b .decline-onetry | ||||||
|  | 
 | ||||||
| # Copy in the Fedora/RHEL dhclient script | # Copy in the Fedora/RHEL dhclient script | ||||||
| %{__install} -p -m 0755 %{SOURCE4} client/scripts/linux | %{__install} -p -m 0755 %{SOURCE4} client/scripts/linux | ||||||
| %{__install} -p -m 0644 %{SOURCE5} . | %{__install} -p -m 0644 %{SOURCE5} . | ||||||
| @ -367,7 +373,7 @@ done | |||||||
| #libtoolize --copy --force | #libtoolize --copy --force | ||||||
| autoreconf --verbose --force --install | autoreconf --verbose --force --install | ||||||
| 
 | 
 | ||||||
| CFLAGS="%{optflags} -fno-strict-aliasing -D_GNU_SOURCE" \ | CFLAGS="%{optflags} -fno-strict-aliasing" \ | ||||||
| %configure \ | %configure \ | ||||||
|     --with-srv-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd.leases \ |     --with-srv-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd.leases \ | ||||||
|     --with-srv6-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd6.leases \ |     --with-srv6-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd6.leases \ | ||||||
| @ -669,6 +675,11 @@ fi | |||||||
| %{_initddir}/dhcrelay | %{_initddir}/dhcrelay | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Thu Nov 24 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.3-7 | ||||||
|  | - Send DHCPDECLINE and exit(2) when duplicate address was detected and | ||||||
|  |   dhclient had been started with '-1' (#756759). | ||||||
|  | - Don't build with -D_GNU_SOURCE, configure.ac uses AC_USE_SYSTEM_EXTENSIONS | ||||||
|  | 
 | ||||||
| * Mon Nov 14 2011 Adam Tkac <atkac redhat com> - 12:4.2.3-6 | * Mon Nov 14 2011 Adam Tkac <atkac redhat com> - 12:4.2.3-6 | ||||||
| - rebuild against new bind | - rebuild against new bind | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user