mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-03 07:45:20 +00:00
behave differently if we got a renewal via INIT-REBOOT
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dhclient.c,v 1.29 1997/03/05 06:30:08 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhclient.c,v 1.30 1997/03/05 08:38:02 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -456,8 +456,10 @@ void dhcpack (packet)
|
|||||||
? "BOUND"
|
? "BOUND"
|
||||||
: (ip -> client -> state == S_RENEWING
|
: (ip -> client -> state == S_RENEWING
|
||||||
? "RENEW"
|
? "RENEW"
|
||||||
: "REBIND")), ip -> client -> new -> medium);
|
: (ip -> client -> state == S_REBOOTING
|
||||||
if (ip -> client -> active)
|
? "REBOOT" : "REBIND"))),
|
||||||
|
ip -> client -> new -> medium);
|
||||||
|
if (ip -> client -> active && ip -> client -> state != S_REBOOTING)
|
||||||
script_write_params (ip, "old_", ip -> client -> active);
|
script_write_params (ip, "old_", ip -> client -> active);
|
||||||
script_write_params (ip, "new_", ip -> client -> new);
|
script_write_params (ip, "new_", ip -> client -> new);
|
||||||
if (ip -> client -> alias)
|
if (ip -> client -> alias)
|
||||||
|
@@ -38,8 +38,8 @@ if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || [ x$reason = xREBIND ];
|
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
||||||
then
|
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
|
||||||
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
||||||
[ x$alias_ip_address != x$old_ip_address ]; then
|
[ x$alias_ip_address != x$old_ip_address ]; then
|
||||||
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
|
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
|
||||||
@@ -54,7 +54,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || [ x$reason = xREBIND ];
|
|||||||
arp -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' |sh
|
arp -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' |sh
|
||||||
fi
|
fi
|
||||||
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
||||||
[ x$reason = xBOUND ]; then
|
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
||||||
ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
||||||
$new_broadcast_arg $medium
|
$new_broadcast_arg $medium
|
||||||
route add $new_ip_address 127.1 >/dev/null 2>&1
|
route add $new_ip_address 127.1 >/dev/null 2>&1
|
||||||
|
Reference in New Issue
Block a user