lol
1diff --exclude '*~' -rc dhcp-4.1.0p1-orig/client/scripts/linux dhcp-4.1.0p1/client/scripts/linux
2*** dhcp-4.1.0p1-orig/client/scripts/linux 2008-05-23 15:56:07.000000000 +0200
3--- dhcp-4.1.0p1/client/scripts/linux 2009-09-29 17:56:57.000000000 +0200
4***************
5*** 67,72 ****
6--- 67,80 ----
7 exit $exit_status
8 }
9
10+ # Delete the old addresses, routes and ARP information for this
11+ # interface.
12+ flush_if() {
13+ ${ip} -4 address flush dev $interface
14+ ${ip} -4 route flush dev $interface
15+ ${ip} -4 neighbour flush dev $interface
16+ }
17+
18 # Invoke the local dhcp client enter hooks, if they exist.
19 if [ -f /etc/dhclient-enter-hooks ]; then
20 exit_status=0
21***************
22*** 150,159 ****
23 ifconfig $interface:0- inet 0
24 fi
25 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
26! # IP address changed. Bringing down the interface will delete all routes,
27! # and clear the ARP cache.
28! ifconfig $interface inet 0 down
29!
30 fi
31 if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
32 [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
33--- 158,165 ----
34 ifconfig $interface:0- inet 0
35 fi
36 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
37! # IP address changed.
38! flush_if
39 fi
40 if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
41 [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
42***************
43*** 189,196 ****
44 ifconfig $interface:0- inet 0
45 fi
46 if [ x$old_ip_address != x ]; then
47! # Shut down interface, which will delete routes and clear arp cache.
48! ifconfig $interface inet 0 down
49 fi
50 if [ x$alias_ip_address != x ]; then
51 ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
52--- 195,201 ----
53 ifconfig $interface:0- inet 0
54 fi
55 if [ x$old_ip_address != x ]; then
56! flush_if
57 fi
58 if [ x$alias_ip_address != x ]; then
59 ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
60***************
61*** 225,231 ****
62 make_resolv_conf
63 exit_with_hooks 0
64 fi
65! ifconfig $interface inet 0 down
66 exit_with_hooks 1
67 fi
68
69--- 230,236 ----
70 make_resolv_conf
71 exit_with_hooks 0
72 fi
73! flush_if
74 exit_with_hooks 1
75 fi
76