mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
Improve the handling dhcp handling of pccard_ether.
There are now many configurations which have a NIC on board, and pccard slots. If a dhclient is running on the internal nic, the Improve the handling dhcp handling of pccard_ether. Improve the dhcp handling of pccard_ether. There are now many configurations which have a NIC on board and Improve the dhcp handling of pccard_ether. There are now many configurations which have a NIC on board and cardbus slots too. If a dhclient was already running on the internal NIC, the user was forced to kill a running dhclient manually. If now a pccard is included at startup time, /etc/rc.d/dhclient start does include it into the startup list for dhcp devices. That means you can now do dhcp on the internal and the pccard devices at the same time. If the card is plugged in later, a running dhclient (working for the internal interface only) is killed, and restarted, but the interface name of the new pccard is added to the internal name. After removal, /etc/rc.d/dhclient is started again. This script does nothing if there are no devices in /etc/rc.conf This is only a workaround for a well known problem. After we have a dhcp client which handles device adding and removal, it will go away.
This commit is contained in:
parent
9242daac21
commit
d10526a03b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118797
@ -299,6 +299,24 @@ list_net_interfaces()
|
||||
esac
|
||||
done
|
||||
|
||||
case ${pccard_ifconfig} in
|
||||
[Dd][Hh][Cc][Pp])
|
||||
for _if in ${removable_interfaces} ; do
|
||||
_test_if=`ifconfig ${_if} 2>&1`
|
||||
case "$_test_if" in
|
||||
"ifconfig: interface $_if does not exist")
|
||||
;;
|
||||
*)
|
||||
_dhcplist="${_dhcplist}${_aprefix}${_if}"
|
||||
[ -z "$_aprefix" ] && _aprefix=' '
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$type" in
|
||||
nodhcp)
|
||||
echo $_nodhcplist
|
||||
|
@ -12,11 +12,40 @@ stop_dhcp() {
|
||||
pidfile="/var/run/dhclient.${interface}.pid"
|
||||
elif [ -s /var/run/dhcpc.${interface}.pid ]; then
|
||||
pidfile="/var/run/dhcpc.${interface}.pid"
|
||||
elif [ -s /var/run/dhclient.pid ]; then
|
||||
# If dhclient is already running, record
|
||||
# it's interfaces.
|
||||
if [ -x /usr/bin/grep ]; then
|
||||
eval _active_list=\"`/bin/ps -axwww | \
|
||||
/usr/bin/grep dhclient | \
|
||||
/usr/bin/grep -v grep | \
|
||||
/usr/bin/sed -e 's|^.*dhclient||' | \
|
||||
/usr/bin/awk '{for (i=1;i<=NF;i++) \
|
||||
{ if ($i~/[a-zA-Z].[0-9]$/) \
|
||||
{ printf(" %s",$i) } }}'` \
|
||||
\"
|
||||
fi
|
||||
|
||||
_aprefix=
|
||||
for _if in _active_list ; do
|
||||
_test_if=`ifconfig ${_if} 2>&1`
|
||||
case "$_test_if" in
|
||||
"ifconfig: interface $_if does not exist")
|
||||
;;
|
||||
*)
|
||||
_dhcplist="${_dhcplist}${_aprefix}${_if}"
|
||||
[ -z "$_aprefix" ] && _aprefix=' '
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
pidfile="/var/run/dhclient.pid"
|
||||
else
|
||||
return
|
||||
fi
|
||||
kill `cat ${pidfile}`
|
||||
rm -f ${pidfile}
|
||||
sh `/etc/rc.d/dhclient start`
|
||||
}
|
||||
|
||||
start_dhcp() {
|
||||
@ -35,7 +64,7 @@ start_dhcp() {
|
||||
pidfile="/var/run/dhclient.${interface}.pid"
|
||||
dhclient_flags="${dhclient_flags} -pf ${pidfile}"
|
||||
fi
|
||||
${dhclient_program} ${dhclient_flags} ${interface}
|
||||
${dhclient_program} ${dhclient_flags} $_dhcplist ${interface}
|
||||
else
|
||||
echo "${dhclient_program}: DHCP client software not available"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user