diff options
author | Renato Botelho <renato@netgate.com> | 2016-10-18 11:01:47 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-10-18 11:01:47 -0200 |
commit | 94bd7fb3a52e375dcd25c416e36389f96060a8fd (patch) | |
tree | d0f3eee6ef938b6c45721aa628393d215a2908a0 /src/usr/local | |
parent | 6172f3dedbf1fbcc0991f1ab5ec3b1636a4eb7c7 (diff) | |
download | pfsense-94bd7fb3a52e375dcd25c416e36389f96060a8fd.zip pfsense-94bd7fb3a52e375dcd25c416e36389f96060a8fd.tar.gz |
Fix #6828
Until 2.3.x pfSense carried a patch that changed the behavior of 'route
change' command, making it add the route when it fails to change.
On 2.4 this patch was removed and will not be added back. This change
adjust PHP code to deal with route add / change and make it work
without the patch
Diffstat (limited to 'src/usr/local')
-rwxr-xr-x | src/usr/local/sbin/ppp-linkup | 12 | ||||
-rw-r--r-- | src/usr/local/sbin/prefixes.php | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/usr/local/sbin/ppp-linkup b/src/usr/local/sbin/ppp-linkup index 035de72..7b41e0a 100755 --- a/src/usr/local/sbin/ppp-linkup +++ b/src/usr/local/sbin/ppp-linkup @@ -50,12 +50,14 @@ if [ "${PROTOCOL}" == "inet" ]; then if echo "${DNS1_RAW}" | grep -q dns1; then DNS1=`echo "${DNS1_RAW}" | awk '{print $2}'` echo "${DNS1}" >> /var/etc/nameserver_${IF} - route change "${DNS1}" ${REMOTE_IP} + route change "${DNS1}" ${REMOTE_IP} \ + || route add "${DNS1}" ${REMOTE_IP} fi if echo "${DNS2_RAW}" | grep -q dns2; then DNS2=`echo "${DNS2_RAW}" | awk '{print $2}'` echo "${DNS2}" >> /var/etc/nameserver_${IF} - route change "${DNS2}" ${REMOTE_IP} + route change "${DNS2}" ${REMOTE_IP} \ + || route add "${DNS2}" ${REMOTE_IP} fi pfSctl -c 'service reload dns' sleep 1 @@ -75,12 +77,14 @@ elif [ "${PROTOCOL}" == "inet6" ]; then if echo "${DNS1_RAW}" | grep -q dns1; then DNS1=`echo "${DNS1_RAW}" | awk '{print $2}'` echo "${DNS1}" >> /var/etc/nameserver_v6${IF} - route change -inet6 "${DNS1}" ${REMOTE_IP} + route change -inet6 "${DNS1}" ${REMOTE_IP} \ + || route add -inet6 "${DNS1}" ${REMOTE_IP} fi if echo "${DNS2_RAW}" | grep -q dns2; then DNS2=`echo "${DNS2_RAW}" | awk '{print $2}'` echo "${DNS2}" >> /var/etc/nameserver_v6${IF} - route change -inet6 "${DNS2}" ${REMOTE_IP} + route change -inet6 "${DNS2}" ${REMOTE_IP} \ + || route add -inet6 "${DNS2}" ${REMOTE_IP} fi pfSctl -c 'service reload dns' sleep 1 diff --git a/src/usr/local/sbin/prefixes.php b/src/usr/local/sbin/prefixes.php index 29cbbf9..746de86 100644 --- a/src/usr/local/sbin/prefixes.php +++ b/src/usr/local/sbin/prefixes.php @@ -98,7 +98,8 @@ foreach ($duid_arr as $entry) { // echo "add routes\n"; if (count($routes) > 0) { foreach ($routes as $address => $prefix) { - echo "/sbin/route change -inet6 {$prefix} {$address}\n"; + echo "/sbin/route change -inet6 {$prefix} {$address} " . + "|| /sbin/route add -inet6 {$prefix} {$address}\n"; } } |