--- routing-head-patched 2013-10-28 21:06:15.434495241 +0530 +++ routing-head-patched 2013-10-28 21:10:14.807836000 +0530 @@ -21,12 +21,21 @@ ROUTE_CMD="/sbin/route" +get_communication_channels(){ + for _a in inet inet6 atm ipx; do + if afexists $_a; then + comm_channel="${comm_channel} $_a" + fi + done +} + routing_start() { local _cmd _af _if _a _cmd=$1 _af=$2 _if=$3 + get_communication_channels case $_if in ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) _if="" ;; @@ -41,7 +50,7 @@ fi ;; ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) - for _a in inet inet6 ipx atm; do + for _a in $comm_channel; do afexists $_a && setroutes $_cmd $_a $_if done ;; @@ -56,6 +65,7 @@ local _af _if _a _af=$1 _if=$2 + get_communication_channels case $_if in ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) _if="" ;; @@ -74,7 +84,7 @@ fi ;; ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) - for _a in inet inet6 ipx atm; do + for _a in $comm_channel; do afexists $_a || continue eval static_${_a} delete $_if # When $_if is specified, do not flush routes. @@ -306,7 +316,9 @@ options_inet() { _ropts_initdone= + _all_false_checkyesno=true if checkyesno icmp_bmcastecho; then + _all_false_checkyesno=false ropts_init inet echo -n ' broadcast ping responses=YES' ${SYSCTL} net.inet.icmp.bmcastecho=1 > /dev/null @@ -315,6 +327,7 @@ fi if checkyesno icmp_drop_redirect; then + _all_false_checkyesno=false ropts_init inet echo -n ' ignore ICMP redirect=YES' ${SYSCTL} net.inet.icmp.drop_redirect=1 > /dev/null @@ -323,6 +336,7 @@ fi if checkyesno icmp_log_redirect; then + _all_false_checkyesno=false ropts_init inet echo -n ' log ICMP redirect=YES' ${SYSCTL} net.inet.icmp.log_redirect=1 > /dev/null @@ -331,6 +345,7 @@ fi if checkyesno gateway_enable; then + _all_false_checkyesno=false ropts_init inet echo -n ' gateway=YES' ${SYSCTL} net.inet.ip.forwarding=1 > /dev/null @@ -339,6 +354,7 @@ fi if checkyesno forward_sourceroute; then + _all_false_checkyesno=false ropts_init inet echo -n ' do source routing=YES' ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null @@ -347,6 +363,7 @@ fi if checkyesno accept_sourceroute; then + _all_false_checkyesno=false ropts_init inet echo -n ' accept source routing=YES' ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null @@ -355,6 +372,7 @@ fi if checkyesno arpproxy_all; then + _all_false_checkyesno=false ropts_init inet echo -n ' ARP proxyall=YES' ${SYSCTL} net.link.ether.inet.proxyall=1 > /dev/null @@ -362,14 +380,16 @@ ${SYSCTL} net.link.ether.inet.proxyall=0 > /dev/null fi - [ -n "${_ropts_initdone}" ] && echo '.' + [ -n "${_ropts_initdone}" ] || $_all_false_checkyesno } options_inet6() { _ropts_initdone= + _all_false_checkyesno=true if checkyesno ipv6_gateway_enable; then + _all_false_checkyesno=false ropts_init inet6 echo -n ' gateway=YES' ${SYSCTL} net.inet6.ip6.forwarding=1 > /dev/null @@ -377,21 +397,24 @@ ${SYSCTL} net.inet6.ip6.forwarding=0 > /dev/null fi - [ -n "${_ropts_initdone}" ] && echo '.' + [ -n "${_ropts_initdone}" ] || $_all_false_checkyesno } options_atm() { _ropts_initdone= + _all_false_checkyesno=true - [ -n "${_ropts_initdone}" ] && echo '.' + [ -n "${_ropts_initdone}" ] || $_all_false_checkyesno } options_ipx() { _ropts_initdone= + _all_false_checkyesno=true if checkyesno ipxgateway_enable; then + _all_false_checkyesno=false ropts_init ipx echo -n ' gateway=YES' ${SYSCTL} net.ipx.ipx.ipxforwarding=1 > /dev/null @@ -399,7 +422,7 @@ ${SYSCTL} net.ipx.ipx.ipxforwarding=0 > /dev/null fi - [ -n "${_ropts_initdone}" ] && echo '.' + [ -n "${_ropts_initdone}" ] || $_all_false_checkyesno } load_rc_config $name