summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2018-09-17 13:18:05 +0100
committerRobby Workman <rworkman@slackware.com>2018-11-26 02:04:37 -0600
commit65f284e1f0a1f6aee4374cd8aa64e9a15b1a9390 (patch)
tree3415dc9ba274d2c9189e3360ec67e2aece7afee0 /rc.inet1
parenteb0f51a47d1f9dc566fee941738008f2d0bc2463 (diff)
downloadslacknetsetup-65f284e1f0a1f6aee4374cd8aa64e9a15b1a9390.tar.xz
Enable RA for DHCP/Fixed IP if explicitly told to do so
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet18
1 files changed, 8 insertions, 0 deletions
diff --git a/rc.inet1 b/rc.inet1
index 02c1193..6f3df52 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -218,6 +218,10 @@ if_up() {
# 15 seconds should be a reasonable default DHCP timeout. 30 was too much.
echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS[@]} ${1}" | $LOGGER
if /sbin/dhcpcd -t "${DHCP_TIMEOUT[$i]:-15}" "${DHCP_OPTIONS[@]}" ${1}; then
+ # Enable accepting of RA packets if explicitly told to.
+ if [ -e /proc/sys/net/ipv6 ] && [ "${USE_RA[$i]}" = "yes" ]; then
+ echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra
+ fi
IF_UP=1
else
echo "/etc/rc.d/rc.inet1: failed to obtain DHCP lease for ${1}" | $LOGGER
@@ -278,6 +282,10 @@ if_up() {
echo "/etc/rc.d/rc.inet1: /sbin/ip -6 address add ${IP6ADDR[$i]}/${PREFIXLEN[$i]#/} dev ${1}" | $LOGGER
if /sbin/ip -6 address add ${IP6ADDR[$i]}/${PREFIXLEN[$i]#/} dev ${1} && \
/sbin/ip link set dev ${1} up; then
+ # Enable accepting of RA packets if explicitly told to.
+ if [ "${USE_RA[$i]}" = "yes" ]; then
+ echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra
+ fi
IF_UP=1
else
echo "/etc/rc.d/rc.inet1: failed to a set IP ${IP6ADDR[$i]} for ${1}" | $LOGGER