1
0
This repository has been archived on 2025-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Anderson Luiz Alves 04a0df296c reapply
2018-11-21 19:33:35 -02:00

39 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
configure_dhcpv6()
{
# Alacn, 2018-01-28
# don't enable send ia-na by it self
return
local wanid=${WANID:-0}
local addrtype; eval addrtype=\${'WANConnectionDevice_'$wanid'_WANIP6Connection_AddressingType':-None}
# This script only activates on SLAAC+DHCP configurations
[ "$addrtype" != 'SLAAC+DHCP' ] && return
# We received a RA telling us to try DHCPv6 IANA
[ "${IFFLAGS%%ra_managed*}" = "${IFFLAGS}" ] && return
# Now, try to find a iana in configuration
local iaidx=0
local ialist; eval ialist=\${'WANConnectionDevice_'$wanid'_WANIP6Connection_DHCPv6_IA_List':-}
for iaidx in `strip $ialist`; do
local iatype; eval iatype=\${'WANConnectionDevice_'$wanid'_WANIP6Connection_DHCPv6_IA_'$iaidx'_Type':-}
[ "$iatype" != 'na' ] && continue
local iaen; eval iaen=\${'WANConnectionDevice_'$wanid'_WANIP6Connection_DHCPv6_IA_'$iaidx'_Enable':-1}
[ "$iaen" != 1 ] && {
base_log "Enabling IANA request for $IFNAME" debug
echo "cd WANConnectionDevice_${wanid}_WANIP6Connection_DHCPv6_IA_${iaidx}; set Enable 1; fcommit" | cli -s
}
return
done
base_log "Could not find a valid IANA configuration for $IFNAME, but RA tells us to try DHCPv6 ..." debug
}
configure_dhcpv6