summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-03-22 17:49:30 +0000
committerRoy Marples <uberlord@gentoo.org>2006-03-22 17:49:30 +0000
commit68eb764596d931a78ff0552d633e970854cddbe2 (patch)
tree0218c317d1c7c437958a6b3d13d47dc9645551b1 /net-misc/dhcp/files
parentopal useflags (diff)
downloadgentoo-2-68eb764596d931a78ff0552d633e970854cddbe2.tar.gz
gentoo-2-68eb764596d931a78ff0552d633e970854cddbe2.tar.bz2
gentoo-2-68eb764596d931a78ff0552d633e970854cddbe2.zip
Tweaked patchset to apply cleanly.
Support PEER_DNS and PEER_NTP options. (Portage version: 2.1_pre6-r5)
Diffstat (limited to 'net-misc/dhcp/files')
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-hostname.patch18
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch34
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-mtu.patch36
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-ntp.patch171
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-resolvconf.patch292
5 files changed, 239 insertions, 312 deletions
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-hostname.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-hostname.patch
index de5b2e2abff6..a44f542bf308 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-hostname.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-hostname.patch
@@ -1,18 +1,6 @@
-diff -ru /tmp/client/scripts/bsdos client/scripts/bsdos
---- /tmp/client/scripts/bsdos 2006-03-21 10:54:43.311983617 +0000
-+++ client/scripts/bsdos 2006-03-21 10:55:46.000000000 +0000
-@@ -106,6 +106,7 @@
- [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
- current_hostname=`hostname`
- if [ x$current_hostname = x ] || \
-+ [ x$current_hostname = "x(none)" ] || \
- [ x$current_hostname = x$old_host_name ]; then
- if [ x$current_hostname = x ] || \
- [ x$new_host_name != x$old_host_name ]; then
-diff -ru /tmp/client/scripts/linux client/scripts/linux
---- /tmp/client/scripts/linux 2006-03-21 10:54:43.295982093 +0000
-+++ client/scripts/linux 2006-03-21 10:54:58.000000000 +0000
-@@ -137,6 +137,7 @@
+--- client/scripts/linux
++++ client/scripts/linux
+@@ -141,6 +141,7 @@
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
current_hostname=`hostname`
if [ x$current_hostname = x ] || \
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch
index e7366836f264..50a08fa4d96a 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch
@@ -1,6 +1,6 @@
--- client/scripts/bsdos
+++ client/scripts/bsdos
-@@ -68,6 +68,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -10,7 +10,7 @@
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
-@@ -128,7 +128,7 @@
+@@ -141,7 +141,7 @@
$new_broadcast_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -19,7 +19,7 @@
done
if [ "$new_static_routes" != "" ]; then
set $new_static_routes
-@@ -194,7 +194,7 @@
+@@ -207,7 +207,7 @@
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -30,7 +30,7 @@
while [ $# -gt 1 ]; do
--- client/scripts/freebsd
+++ client/scripts/freebsd
-@@ -92,6 +92,9 @@
+@@ -91,6 +91,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -40,7 +40,7 @@
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
-@@ -158,7 +158,7 @@
+@@ -157,7 +157,7 @@
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -49,7 +49,7 @@
done
if [ -n "$new_static_routes" ]; then
$LOGGER "New Static Routes: $new_static_routes"
-@@ -229,7 +229,7 @@
+@@ -228,7 +228,7 @@
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -60,7 +60,7 @@
while [ $# -gt 1 ]; do
--- client/scripts/linux
+++ client/scripts/linux
-@@ -91,6 +91,9 @@
+@@ -103,6 +103,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -70,7 +70,7 @@
if [ x$reason = xMEDIUM ]; then
# Linux doesn't do mediums (ok, ok, media).
-@@ -136,13 +136,11 @@
+@@ -148,13 +148,11 @@
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
[ x$alias_ip_address != x$old_ip_address ]; then
# Possible new alias. Remove old alias.
@@ -87,7 +87,7 @@
fi
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-@@ -155,14 +153,14 @@
+@@ -167,14 +165,14 @@
route add -net $new_network_number $new_subnet_arg dev $interface
fi
for router in $new_routers; do
@@ -104,7 +104,7 @@
fi
make_resolv_conf
exit_with_hooks 0
-@@ -175,12 +173,12 @@
+@@ -187,12 +185,12 @@
ifconfig $interface:0- inet 0
fi
if [ x$old_ip_address != x ]; then
@@ -120,7 +120,7 @@
fi
exit_with_hooks 0
fi
-@@ -201,15 +199,15 @@
+@@ -213,15 +211,15 @@
fi
if [ $relmajor -lt 2 ] || \
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
@@ -141,7 +141,7 @@
--- client/scripts/netbsd
+++ client/scripts/netbsd
-@@ -68,6 +68,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -151,7 +151,7 @@
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
-@@ -128,7 +128,7 @@
+@@ -141,7 +141,7 @@
$new_broadcast_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -160,7 +160,7 @@
done
if [ "$new_static_routes" != "" ]; then
set $new_static_routes
-@@ -194,7 +194,7 @@
+@@ -207,7 +207,7 @@
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -171,7 +171,7 @@
while [ $# -gt 1 ]; do
--- client/scripts/openbsd
+++ client/scripts/openbsd
-@@ -68,6 +68,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -181,7 +181,7 @@
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
-@@ -128,7 +128,7 @@
+@@ -141,7 +141,7 @@
$new_broadcast_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
@@ -190,7 +190,7 @@
done
if [ "$new_static_routes" != "" ]; then
set $new_static_routes
-@@ -194,7 +194,7 @@
+@@ -207,7 +207,7 @@
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-mtu.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-mtu.patch
index e9b7c477a6d5..576027ad5a09 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-mtu.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-mtu.patch
@@ -1,6 +1,6 @@
--- client/scripts/bsdos
+++ client/scripts/bsdos
-@@ -77,6 +77,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -10,7 +10,7 @@
if [ x$IF_METRIC != x ]; then
metric_arg="metric $IF_METRIC"
fi
-@@ -138,7 +141,7 @@
+@@ -141,7 +144,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -19,7 +19,7 @@
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router $metric_arg dev $interface >/dev/null 2>&1
-@@ -196,7 +199,7 @@
+@@ -198,7 +201,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -30,7 +30,7 @@
set $new_routers
--- client/scripts/freebsd
+++ client/scripts/freebsd
-@@ -86,6 +86,9 @@
+@@ -91,6 +91,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -40,7 +40,7 @@
if [ x$IF_METRIC != x ]; then
metric_arg="metric $IF_METRIC"
fi
-@@ -146,7 +149,7 @@
+@@ -151,7 +154,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -49,7 +49,7 @@
$LOGGER "New IP Address ($interface): $new_ip_address"
$LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
-@@ -211,7 +214,7 @@
+@@ -215,7 +218,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -60,7 +60,7 @@
$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
--- client/scripts/linux
+++ client/scripts/linux
-@@ -99,6 +99,9 @@
+@@ -103,6 +103,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -70,7 +70,7 @@
if [ x$IF_METRIC != x ]; then
metric_arg="metric $IF_METRIC"
fi
-@@ -158,7 +161,7 @@
+@@ -162,7 +165,7 @@
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
ifconfig $interface inet $new_ip_address $new_subnet_arg \
@@ -79,7 +79,7 @@
# Add a network route to the computed network address.
if [ $relmajor -lt 2 ] || \
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
-@@ -201,7 +204,7 @@
+@@ -204,7 +207,7 @@
ifconfig $interface:0- inet 0
fi
ifconfig $interface inet $new_ip_address $new_subnet_arg \
@@ -90,7 +90,7 @@
if ping -q -c 1 $1; then
--- client/scripts/netbsd
+++ client/scripts/netbsd
-@@ -77,6 +77,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -100,7 +100,7 @@
if [ x$IF_METRIC != x ]; then
metric_arg="metric $IF_METRIC"
fi
-@@ -137,7 +140,7 @@
+@@ -141,7 +144,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -109,7 +109,7 @@
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router $metric_arg dev $interface >/dev/null 2>&1
-@@ -195,7 +198,7 @@
+@@ -198,7 +201,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -120,7 +120,7 @@
set $new_routers
--- client/scripts/openbsd
+++ client/scripts/openbsd
-@@ -77,6 +77,9 @@
+@@ -81,6 +81,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -130,7 +130,7 @@
if [ x$IF_METRIC != x ]; then
metric_arg="metric $IF_METRIC"
fi
-@@ -137,7 +140,7 @@
+@@ -141,7 +144,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -139,7 +139,7 @@
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router $metric_arg dev $interface >/dev/null 2>&1
-@@ -195,7 +198,7 @@
+@@ -198,7 +201,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -150,7 +150,7 @@
set $new_routers
--- client/scripts/solaris
+++ client/scripts/solaris
-@@ -72,6 +72,9 @@
+@@ -76,6 +76,9 @@
if [ x$alias_subnet_mask != x ]; then
alias_subnet_arg="netmask $alias_subnet_mask"
fi
@@ -160,7 +160,7 @@
ifconfig=/sbin/ifconfig
-@@ -134,7 +137,7 @@
+@@ -138,7 +141,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
@@ -169,7 +169,7 @@
route add $new_ip_address 127.1 1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router 1 >/dev/null 2>&1
-@@ -176,7 +179,7 @@
+@@ -179,7 +181,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-ntp.patch
index 3684904e1e47..b5f9429a84c3 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-ntp.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-ntp.patch
@@ -1,6 +1,6 @@
--- client/clparse.c
+++ client/clparse.c
-@@ -63,6 +63,7 @@
+@@ -51,6 +51,7 @@
DHO_DOMAIN_NAME,
DHO_DOMAIN_NAME_SERVERS,
DHO_HOST_NAME,
@@ -10,7 +10,7 @@
--- client/scripts/bsdos
+++ client/scripts/bsdos
-@@ -7,6 +7,24 @@
+@@ -7,6 +7,26 @@
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
@@ -19,25 +19,27 @@
+}
+
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ x$new_ntp_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
--- client/scripts/freebsd
+++ client/scripts/freebsd
-@@ -32,8 +32,25 @@
+@@ -32,8 +32,28 @@
done
fi
fi
@@ -46,26 +48,29 @@
}
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
+}
++
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
exit_with_hooks() {
exit_status=$1
--- client/scripts/linux
+++ client/scripts/linux
-@@ -30,6 +30,24 @@
+@@ -30,6 +30,26 @@
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
@@ -74,25 +79,27 @@
+}
+
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
--- client/scripts/netbsd
+++ client/scripts/netbsd
-@@ -7,6 +7,24 @@
+@@ -7,6 +7,26 @@
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
@@ -101,25 +108,27 @@
+}
+
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
--- client/scripts/openbsd
+++ client/scripts/openbsd
-@@ -7,6 +7,24 @@
+@@ -7,6 +7,26 @@
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
@@ -128,25 +137,27 @@
+}
+
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
--- client/scripts/solaris
+++ client/scripts/solaris
-@@ -7,6 +7,24 @@
+@@ -7,6 +7,26 @@
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
@@ -155,18 +166,20 @@
+}
+
+make_ntp_conf() {
-+ if [ "x$new_ntp_servers" != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ conf="${conf}restrict default noquery notrust nomodify\n"
-+ conf="${conf}restrict 127.0.0.1\n"
-+ for ntpserver in $new_ntp_servers; do
-+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
-+ conf="${conf}server $ntpserver\n"
-+ done
-+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
-+ conf="${conf}logfile /var/log/ntp.log\n"
-+ echo -e "${conf}" > /etc/ntp.conf
-+ chmod 644 /etc/ntp.conf
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ echo -e "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
+ fi
}
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-resolvconf.patch
index 4355a5143225..466697cf63aa 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-resolvconf.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-resolvconf.patch
@@ -1,55 +1,41 @@
--- client/scripts/bsdos
+++ client/scripts/bsdos
-@@ -1,11 +1,20 @@
+@@ -1,11 +1,22 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- echo search $new_domain_name >/etc/resolv.conf
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ if [ x$new_domain_name != x ]; then
-+ conf="${conf}search $new_domain_name\n"
-+ fi
- for nameserver in $new_domain_name_servers; do
+- for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf
-+ conf="${conf}nameserver $nameserver\n"
- done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
-+ else
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
+- done
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
++ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver $nameserver\n"
++ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
fi
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
-@@ -176,6 +188,7 @@
- ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -221,6 +231,7 @@
- fi
- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
- |sh >/dev/null 2>&1
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-
--- client/scripts/freebsd
+++ client/scripts/freebsd
-@@ -11,25 +11,19 @@
+@@ -11,25 +11,21 @@
fi
make_resolv_conf() {
- if [ x"$new_domain_name_servers" != x ]; then
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
- if [ "x$new_domain_name" != x ]; then
+- if [ "x$new_domain_name" != x ]; then
- ( echo search $new_domain_name >/etc/resolv.conf )
- exit_status=$?
- else
@@ -59,207 +45,147 @@
- else
- ( touch /etc/resolv.conf )
- exit_status=$?
-- fi
-+ conf="${conf}search $new_domain_name\n"
- fi
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
+ fi
+- fi
- if [ $exit_status -ne 0 ]; then
- $LOGGER "WARNING: Unable to update resolv.conf: Error $exit_status"
-+ for nameserver in $new_domain_name_servers; do
-+ conf="${conf}nameserver $nameserver\n"
-+ done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
- else
-- for nameserver in $new_domain_name_servers; do
+- else
+ for nameserver in $new_domain_name_servers; do
- ( echo nameserver $nameserver >>/etc/resolv.conf )
-- done
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
++ conf="${conf}nameserver $nameserver\n"
+ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
fi
fi
# If we're making confs, may as well make an ntp.conf too
-@@ -207,6 +201,7 @@
- ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -256,6 +251,7 @@
- fi
- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' \
- |sh >/dev/null 2>&1
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-
--- client/scripts/linux
+++ client/scripts/linux
-@@ -23,12 +23,20 @@
+@@ -23,12 +23,22 @@
# of the $1 in its args.
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- echo search $new_domain_name >/etc/resolv.conf
- chmod 644 /etc/resolv.conf
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ if [ x$new_domain_name != x ]; then
-+ conf="${conf}search $new_domain_name\n"
-+ fi
- for nameserver in $new_domain_name_servers; do
+- for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf
-+ conf="${conf}nameserver $nameserver\n"
- done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
-+ else
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
+- done
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
++ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver $nameserver\n"
++ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
fi
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
-@@ -183,6 +191,7 @@
- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
- route add -host $alias_ip_address dev $interface:0
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -211,6 +220,7 @@
- exit_with_hooks 0
- fi
- ifconfig $interface inet 0.0.0.0
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-
--- client/scripts/netbsd
+++ client/scripts/netbsd
-@@ -1,11 +1,20 @@
+@@ -1,11 +1,22 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- echo search $new_domain_name >/etc/resolv.conf
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ if [ x$new_domain_name != x ]; then
-+ conf="${conf}search $new_domain_name\n"
-+ fi
- for nameserver in $new_domain_name_servers; do
+- for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf
-+ conf="${conf}nameserver $nameserver\n"
- done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
-+ else
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
+- done
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
++ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver $nameserver\n"
++ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
fi
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
-@@ -176,6 +185,7 @@
- ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -221,6 +231,7 @@
- fi
- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
- |sh >/dev/null 2>&1
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-
--- client/scripts/openbsd
+++ client/scripts/openbsd
-@@ -1,11 +1,20 @@
+@@ -1,11 +1,22 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- echo search $new_domain_name >/etc/resolv.conf
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ if [ x$new_domain_name != x ]; then
-+ conf="${conf}search $new_domain_name\n"
-+ fi
- for nameserver in $new_domain_name_servers; do
+- for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf
-+ conf="${conf}nameserver $nameserver\n"
- done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
-+ else
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
+- done
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
++ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver $nameserver\n"
++ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
fi
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
-@@ -176,6 +185,7 @@
- ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -221,6 +231,7 @@
- fi
- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
- |sh >/dev/null 2>&1
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-
--- client/scripts/solaris
+++ client/scripts/solaris
-@@ -1,11 +1,20 @@
+@@ -1,11 +1,22 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- echo search $new_domain_name >/etc/resolv.conf
-+ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
-+ conf="# Generated by dhclient for interface $interface\n"
-+ if [ x$new_domain_name != x ]; then
-+ conf="${conf}search $new_domain_name\n"
-+ fi
- for nameserver in $new_domain_name_servers; do
+- for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf
-+ conf="${conf}nameserver $nameserver\n"
- done
-+ if [ -x /sbin/resolvconf ]; then
-+ echo -e "$conf" | resolvconf -a "$interface"
-+ else
-+ echo -e "$conf" > /etc/resolv.conf
-+ chmod 644 /etc/resolv.conf
+- done
++ if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++ if [ x$new_domain_name != x ] || [ x$new_domain_name_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ if [ x$new_domain_name != x ]; then
++ conf="${conf}search $new_domain_name\n"
++ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver $nameserver\n"
++ done
++ if [ -x /sbin/resolvconf ]; then
++ echo -e "$conf" | resolvconf -a "$interface"
++ else
++ echo -e "$conf" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
fi
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
-@@ -157,6 +166,7 @@
- $ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1 1
- fi
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 0
- fi
-
-@@ -186,6 +196,7 @@
- for router in $old_routers; do
- route delete default $router >/dev/null 2>&1
- done
-+ [ -x /sbin/resolvconf ] && resolvconf -d "$interface"
- exit_with_hooks 1
- fi
-