mirror of
https://git.yoctoproject.org/poky
synced 2026-09-12 06:49:32 +02:00
netbase: Drop options file and options handling code, its replaced by sysctl.conf
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5078 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
@@ -15,64 +15,8 @@ if ! [ -x /sbin/ifup ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
spoofprotect_rp_filter () {
|
||||
# This is the best method: turn on Source Address Verification and get
|
||||
# spoof protection on all current and future interfaces.
|
||||
|
||||
if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
|
||||
for f in /proc/sys/net/ipv4/conf/*; do
|
||||
[ -e $f/rp_filter ] && echo 1 > $f/rp_filter
|
||||
done
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
spoofprotect () {
|
||||
echo -n "Setting up IP spoofing protection: "
|
||||
if spoofprotect_rp_filter; then
|
||||
echo "rp_filter."
|
||||
else
|
||||
echo "FAILED."
|
||||
fi
|
||||
}
|
||||
|
||||
ip_forward () {
|
||||
if [ -e /proc/sys/net/ipv4/ip_forward ]; then
|
||||
echo -n "Enabling packet forwarding... "
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
echo "done."
|
||||
fi
|
||||
}
|
||||
|
||||
syncookies () {
|
||||
if [ -e /proc/sys/net/ipv4/tcp_syncookies ]; then
|
||||
echo -n "Enabling TCP/IP SYN cookies... "
|
||||
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
|
||||
echo "done."
|
||||
fi
|
||||
}
|
||||
|
||||
doopt () {
|
||||
optname=$1
|
||||
default=$2
|
||||
opt=`grep "^$optname=" /etc/network/options`
|
||||
if [ -z "$opt" ]; then
|
||||
opt="$optname=$default"
|
||||
fi
|
||||
optval=${opt#$optname=}
|
||||
if [ "$optval" = "yes" ]; then
|
||||
eval $optname
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
doopt spoofprotect yes
|
||||
doopt syncookies no
|
||||
doopt ip_forward no
|
||||
|
||||
echo -n "Configuring network interfaces... "
|
||||
ifup -a
|
||||
echo "done."
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ip_forward=no
|
||||
spoofprotect=yes
|
||||
syncookies=no
|
||||
Reference in New Issue
Block a user