revert change made in 4.2.3-3 because of failing failover (#765967)

don't need to fix lease files ownership before starting service
dhclient-script: allow static route with a 0.0.0.0 next-hop addressi (#769463
This commit is contained in:
Jiri Popelka 2011-12-20 18:26:43 +01:00
parent fbce21e755
commit 0acc1b8c2c
5 changed files with 19 additions and 79 deletions

View File

@ -405,7 +405,10 @@ dhconfig() {
fi fi
gateway=${static_routes[$i+1]} gateway=${static_routes[$i+1]}
if is_router_reachable ${gateway}; then # special case 0.0.0.0 to allow static routing for link-local addresses
# (including IPv4 multicast) which will not have a next-hop (#769463)
if [ "${gateway}" = "0.0.0.0" ] ||
is_router_reachable ${gateway}; then
metric='' metric=''
for t in ${route_targets[@]}; do for t in ${route_targets[@]}; do
if [ ${t} = ${target} ]; then if [ ${t} = ${target} ]; then
@ -434,11 +437,9 @@ dhconfig() {
# gateways # gateways
if [[ ( "${DEFROUTE}" != "no" ) && if [[ ( "${DEFROUTE}" != "no" ) &&
(( -z "${GATEWAYDEV}" ) || (( -z "${GATEWAYDEV}" ) || ( "${GATEWAYDEV}" = "${interface}" )) ]]; then
( "${GATEWAYDEV}" = "${interface}" )) ]]; then
if [[ ( -z "$GATEWAY" ) || if [[ ( -z "$GATEWAY" ) ||
(( -n "$DHCLIENT_IGNORE_GATEWAY" ) && (( -n "$DHCLIENT_IGNORE_GATEWAY" ) && ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then
( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then
metric="${METRIC:-}" metric="${METRIC:-}"
let i="${METRIC:-0}" let i="${METRIC:-0}"
default_routers=() default_routers=()

View File

@ -1,48 +1,7 @@
diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c diff -up dhcp-4.2.3-P1/server/dhcpd.c.paranoia dhcp-4.2.3-P1/server/dhcpd.c
--- dhcp-4.2.3/server/dhcpd.c.paranoia 2011-10-26 19:10:08.162925489 +0200 --- dhcp-4.2.3-P1/server/dhcpd.c.paranoia 2011-12-20 18:02:26.000000000 +0100
+++ dhcp-4.2.3/server/dhcpd.c 2011-10-26 19:12:34.541095509 +0200 +++ dhcp-4.2.3-P1/server/dhcpd.c 2011-12-20 18:03:43.840037108 +0100
@@ -699,11 +699,11 @@ main(int argc, char **argv) { @@ -771,22 +771,6 @@ main(int argc, char **argv) {
group_write_hook = group_writer;
- /* Start up the database... */
- db_startup (lftest);
-
- if (lftest)
+ if (lftest) {
+ /* Start up the database... */
+ db_startup (lftest);
exit (0);
+ }
/* Discover all the network interfaces and initialize them. */
discover_interfaces(DISCOVER_SERVER);
@@ -743,24 +743,6 @@ main(int argc, char **argv) {
#if defined (TRACING)
trace_seed_stash (trace_srandom, seed + cur_time);
#endif
- postdb_startup ();
-
-#ifdef DHCPv6
- /*
- * Set server DHCPv6 identifier.
- * See dhcpv6.c for discussion of setting DUID.
- */
- if (set_server_duid_from_option() == ISC_R_SUCCESS) {
- write_server_duid();
- } else {
- if (!server_duid_isset()) {
- if (generate_new_server_duid() != ISC_R_SUCCESS) {
- log_fatal("Unable to set server identifier.");
- }
- write_server_duid();
- }
- }
-#endif /* DHCPv6 */
#ifndef DEBUG
if (daemon) {
@@ -771,22 +753,6 @@ main(int argc, char **argv) {
exit (0); exit (0);
} }
@ -65,7 +24,7 @@ diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c
/* /*
* Deal with pid files. If the user told us * Deal with pid files. If the user told us
* not to write a file we don't read one either * not to write a file we don't read one either
@@ -823,6 +789,42 @@ main(int argc, char **argv) { @@ -823,6 +807,22 @@ main(int argc, char **argv) {
} }
} }
@ -84,26 +43,6 @@ diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c
+ log_fatal ("setuid(%d): %m", (int) set_uid); + log_fatal ("setuid(%d): %m", (int) set_uid);
+ } + }
+#endif /* PARANOIA */ +#endif /* PARANOIA */
+
+ db_startup(lftest);
+ postdb_startup ();
+
+#ifdef DHCPv6
+ /*
+ * Set server DHCPv6 identifier.
+ * See dhcpv6.c for discussion of setting DUID.
+ */
+ if (set_server_duid_from_option() == ISC_R_SUCCESS) {
+ write_server_duid();
+ } else {
+ if (!server_duid_isset()) {
+ if (generate_new_server_duid() != ISC_R_SUCCESS) {
+ log_fatal("Unable to set server identifier.");
+ }
+ write_server_duid();
+ }
+ }
+#endif /* DHCPv6 */
+ +
/* If we were requested to log to stdout on the command line, /* If we were requested to log to stdout on the command line,
keep doing so; otherwise, stop. */ keep doing so; otherwise, stop. */

View File

@ -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: 10.%{patchver}%{?dist} Release: 11.%{patchver}%{?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.
@ -313,7 +313,6 @@ rm bind/bind.tar.gz
# Write PID file BEFORE changing of the effective user/group ID. # Write PID file BEFORE changing of the effective user/group ID.
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #25806]) # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #25806])
# Write lease file AFTER changing of the effective user/group ID.
%patch32 -p1 -b .paranoia %patch32 -p1 -b .paranoia
# IPoIB support (#660681) # IPoIB support (#660681)
@ -659,6 +658,13 @@ fi
%changelog %changelog
* Wed Dec 21 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.3-11.P1
- revert change made in 4.2.3-3 because of failing failover inicialization (#765967)
the procedure is now:
init lease file, init failover, init PID file, change effective user/group ID
- don't need to fix lease files ownership before starting service
- dhclient-script: allow static route with a 0.0.0.0 next-hop address (#769463)
* Tue Dec 20 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.3-10.P1 * Tue Dec 20 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.3-10.P1
- hopefully we don't need 12-dhcpd anymore as 'After=network.target' - hopefully we don't need 12-dhcpd anymore as 'After=network.target'
in dhcpd[6].service should take care of the original problem (#565921) in dhcpd[6].service should take care of the original problem (#565921)

View File

@ -4,9 +4,6 @@ After=syslog.target network.target
[Service] [Service]
EnvironmentFile=/etc/sysconfig/dhcpd EnvironmentFile=/etc/sysconfig/dhcpd
# For the case where /var/lib/dhcpd/dhcpd.leases is owned by root:root as a
# consequence of running dhcpd without '-user dhcpd -group dhcpd'
ExecStartPre=/bin/chown -R dhcpd:dhcpd /var/lib/dhcpd/
ExecStart=/usr/sbin/dhcpd -d -user dhcpd -group dhcpd --no-pid $DHCPDARGS ExecStart=/usr/sbin/dhcpd -d -user dhcpd -group dhcpd --no-pid $DHCPDARGS
[Install] [Install]

View File

@ -4,9 +4,6 @@ After=syslog.target network.target
[Service] [Service]
EnvironmentFile=/etc/sysconfig/dhcpd6 EnvironmentFile=/etc/sysconfig/dhcpd6
# For the case where /var/lib/dhcpd/dhcpd6.leases is owned by root:root as a
# consequence of running dhcpd without '-user dhcpd -group dhcpd'
ExecStartPre=/bin/chown -R dhcpd:dhcpd /var/lib/dhcpd/
ExecStart=/usr/sbin/dhcpd -d -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS ExecStart=/usr/sbin/dhcpd -d -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS
[Install] [Install]