netifd: add SLAAC ipv6 value for static-proto
authorSteven Barth <cyrus@openwrt.org>
Mon, 28 Jan 2013 13:53:48 +0000 (13:53 +0000)
committerSteven Barth <cyrus@openwrt.org>
Mon, 28 Jan 2013 13:53:48 +0000 (13:53 +0000)
SVN-Revision: 35346

package/network/config/netifd/Makefile
package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static [new file with mode: 0644]

index 73fa20fc7f8defd28021f57ba80666bdb4aae960..b7baf05da80202b79f29898f7b667d24b86fa2cc 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_VERSION:=2013-01-22.1
+PKG_VERSION:=2013-01-28
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static b/package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static
new file mode 100644 (file)
index 0000000..9f5b727
--- /dev/null
@@ -0,0 +1,16 @@
+case "$ACTION" in
+       ifup)
+               . /lib/functions.sh
+
+               local proto ip6slaac
+               config_load network
+               config_get proto "$INTERFACE" proto
+               config_get_bool ip6slaac "$INTERFACE" ip6slaac
+
+               if [ "$proto" = "static" -a "$ip6slaac" = "1" ]; then
+                       echo 2 > "/proc/sys/net/ipv6/conf/$DEVICE/accept_ra"
+                       echo 2 > "/proc/sys/net/ipv6/conf/$DEVICE/forwarding"
+               fi
+       ;;
+esac
+