summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-policyrouting/files
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2012-06-02 20:10:50 +0000
committerManuel Munz <freifunk@somakoma.de>2012-06-02 20:10:50 +0000
commit09f83d2edfe7b98ad9f76688e4afac2ec0651b07 (patch)
tree8f7707f695b19ed69c67ecf888bfc4bb5faa2b9b /contrib/package/freifunk-policyrouting/files
parent71542a81127b2354739ce72d7c6a733e2a8f1007 (diff)
contrib/freifunk-policyrouting: Add initial support for ipv6. More work is needed, but this first commit at least makes ipv6/olsrd working again when policyrouting is used.
Diffstat (limited to 'contrib/package/freifunk-policyrouting/files')
-rw-r--r--contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting b/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
index e3b0edeb3..68eba11cf 100644
--- a/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
+++ b/contrib/package/freifunk-policyrouting/files/etc/hotplug.d/iface/30-policyrouting
@@ -3,6 +3,9 @@
case $ACTION in
ifup)
pr=`uci get freifunk-policyrouting.pr.enable`
+ # check if ipv6 is enabled:
+ [ -f /proc/net/ipv6_route ] && has_ipv6=1
+
if [ $pr = "1" ]; then
logger -t policyrouting "Starting policy routing on $INTERFACE"
@@ -59,6 +62,12 @@ case $ACTION in
ip rule add fwmark 1 lookup olsr-default
ip rule add lookup main
ip rule add lookup olsr
+ if [ "$has_ipv6" = 1 ]; then
+ ip -6 rule del lookup main
+ ip -6 rule add fwmark 1 lookup olsr-default
+ ip -6 rule add lookup main
+ ip -6 rule add lookup olsr
+ fi
else
# Remove custom routing tables from olsrd
if [ "`uci -q get olsrd.@olsrd[0].RtTable`" == "111" ] || [ "`uci -q get olsrd.@olsrd[0].RtTableDefault`" == "112" ]; then
@@ -74,5 +83,9 @@ case $ACTION in
logger -t policyrouting "Deleting policy rules for $INTERFACE"
ip rule del fwmark 1 lookup olsr-default > /dev/null 2>&1
ip rule del lookup olsr > /dev/null 2>&1
+ if [ "$has_ipv6" = 1 ]; then
+ ip -6 rule del fwmark 1 lookup olsr-default > /dev/null 2>&1
+ ip -6 rule del lookup olsr > /dev/null 2>&1
+ fi
;;
esac