diff options
| author | Roman Yeryomin <roman@advem.lv> | 2013-05-26 01:02:55 +0300 |
|---|---|---|
| committer | Roman Yeryomin <roman@advem.lv> | 2013-05-26 01:02:55 +0300 |
| commit | 342045a35b1981a89e4bc80842b10c065e1050da (patch) | |
| tree | 4140720b20e8d641c11da882010d6130a75fef21 /package/network/ipv6 | |
| parent | 7338133dde8238afce34676214b494c8db96689b (diff) | |
| parent | 1a116ce7818ecee5d167a9c0ebb1a0feca9120e6 (diff) | |
Merge trunk into realtek-unstable
Conflicts:
Config.in
feeds.conf.default
package/base-files/files/etc/hotplug2-common.rules
package/network/config/netifd/files/etc/init.d/network
Diffstat (limited to 'package/network/ipv6')
24 files changed, 458 insertions, 698 deletions
diff --git a/package/network/ipv6/6distributed/Makefile b/package/network/ipv6/6distributed/Makefile deleted file mode 100644 index 494ea91ed..000000000 --- a/package/network/ipv6/6distributed/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (C) 2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=6distributed -PKG_VERSION:=2012-12-02 -PKG_RELEASE=$(PKG_SOURCE_VERSION) - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_URL:=git://github.com/sbyx/6distributed.git -PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=161670c3866d79e6398a39c2ad220dcab86c00b4 - -PKG_MAINTAINER:=Steven Barth <steven@midlink.org> - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/6distributed - SECTION:=ipv6 - CATEGORY:=IPv6 - TITLE:=IPv6 host prefix distribution daemon - DEPENDS:=+kmod-ipv6 +libubus +libubox -endef - -define Package/6distributed/description - 6distributed is a daemon that distributes IPv6 prefixes locally across - downstream interfaces. It supports valid and preferred lifetimes and - delayed allocation so that an already acquired prefix can be distributed - on interfaces that come up later. -endef - -define Package/6distributed/install - $(INSTALL_DIR) $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/6distributed $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/6distributed.init $(1)/etc/init.d/6distributed -endef - -$(eval $(call BuildPackage,6distributed)) diff --git a/package/network/ipv6/6distributed/files/6distributed.init b/package/network/ipv6/6distributed/files/6distributed.init deleted file mode 100755 index c2dfd1cce..000000000 --- a/package/network/ipv6/6distributed/files/6distributed.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=15 - -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 -SERVICE_PID_FILE=/var/run/6distributed.pid -DISTRIBUTED_BIN=/usr/sbin/6distributed - -start() -{ - service_start $DISTRIBUTED_BIN -} - -stop() -{ - service_stop $DISTRIBUTED_BIN -} diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile index fcb0a7e75..992c5fc67 100644 --- a/package/network/ipv6/6in4/Makefile +++ b/package/network/ipv6/6in4/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6in4 -PKG_VERSION:=12 +PKG_VERSION:=14 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/6in4 - SECTION:=ipv6 - CATEGORY:=IPv6 + SECTION:=net + CATEGORY:=Network DEPENDS:=+kmod-ipv6 +kmod-sit TITLE:=IPv6-in-IPv4 configuration support MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org> diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index 651d7b97b..647a2f89c 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -14,8 +14,8 @@ proto_6in4_setup() { local iface="$2" local link="6in4-$cfg" - local mtu ttl ipaddr peeraddr ip6addr tunnelid username password - json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password + local mtu ttl ipaddr peeraddr ip6addr ip6prefix tunnelid username password + json_get_vars mtu ttl ipaddr peeraddr ip6addr ip6prefix tunnelid username password [ -z "$peeraddr" ] && { proto_notify_error "$cfg" "MISSING_ADDRESS" @@ -43,6 +43,8 @@ proto_6in4_setup() { proto_add_ipv6_address "$local6" "$mask6" } + [ -n "$ip6prefix" ] && proto_add_ipv6_prefix "$ip6prefix" + proto_add_tunnel json_add_string mode sit json_add_int mtu "${mtu:-1280}" @@ -63,8 +65,10 @@ proto_6in4_setup() { local max=3 while [ $((++try)) -le $max ]; do - wget -qO/dev/null "$url" 2>/dev/null && break - sleep 1 + ( exec wget -qO/dev/null "$url" 2>/dev/null ) & + local pid=$! + ( sleep 5; kill $pid 2>/dev/null ) & + wait $pid && break done } } @@ -79,6 +83,7 @@ proto_6in4_init_config() { proto_config_add_string "ipaddr" proto_config_add_string "ip6addr" + proto_config_add_string "ip6prefix" proto_config_add_string "peeraddr" proto_config_add_string "tunnelid" proto_config_add_string "username" diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 3d4549674..c70159619 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd -PKG_VERSION:=2 +PKG_VERSION:=4 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/6rd - SECTION:=ipv6 - CATEGORY:=IPv6 + SECTION:=net + CATEGORY:=Network DEPENDS:=+kmod-ipv6 +kmod-sit TITLE:=6rd configuration support MAINTAINER:=Stéphan Kochen <stephan@kochen.nl> diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 59c3169b3..7d6cc3ebd 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -42,9 +42,13 @@ proto_6rd_setup() { local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen") local ip6addr="${ip6subnet%%::*}::1" + # Determine the IPv6 prefix + local ip6lanprefix="$ip6subnet/$(($ip6prefixlen + 32 - $ip4prefixlen))" + proto_init_update "$link" 1 proto_add_ipv6_address "$ip6addr" "$ip6prefixlen" - proto_add_ipv6_route "::" 0 "::$peeraddr" + proto_add_ipv6_prefix "$ip6lanprefix" + proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 proto_add_tunnel json_add_string mode sit diff --git a/package/network/ipv6/6relayd/Makefile b/package/network/ipv6/6relayd/Makefile index e0a12d32f..8e23de277 100644 --- a/package/network/ipv6/6relayd/Makefile +++ b/package/network/ipv6/6relayd/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6relayd -PKG_VERSION:=2012-11-27 +PKG_VERSION:=2013-05-24 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=git://github.com/sbyx/6relayd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=fa0f64a2d916ba488141c7272af7b355dd1002eb +PKG_SOURCE_VERSION:=ad1874d490612f1a459194171451ef5641607e0e PKG_MAINTAINER:=Steven Barth <steven@midlink.org> @@ -23,20 +23,19 @@ include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk define Package/6relayd - SECTION:=ipv6 - CATEGORY:=IPv6 - TITLE:=IPv6-Relay and Server (RD-, DHCPv6- & NDP-Proxy) + SECTION:=net + CATEGORY:=Network + TITLE:=DHCPv6(-PD)/RA Server & Relay DEPENDS:=+kmod-ipv6 endef define Package/6relayd/description - 6relayd is an IPv6-tool that relays IPv6-management protocols like router - discovery, neighbor discovery and DHCPv6 so that clients on routed (non- - bridged) interfaces can use the public address prefix, DHCPv6 and DNS-service - of a master interface. This is useful to avoid NAT in chained IPv6-routers. + 6relayd is a daemon for serving and relaying IPv6 management protocols to + configure clients and downstream routers. - It can also be used as a lightweight router advertisement daemon and provide - stateless DHCPv6 service where size matters. + 6relayd provides server services for RA, stateless DHCPv6, DHCPv6-PD and can + be used to relay RA, DHCPv6 and NDP between routed (non-bridged) interfaces + in case no delegated prefixes are provided by the upstream router. endef define Package/6relayd/conffiles @@ -46,6 +45,7 @@ endef define Package/6relayd/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/6relayd $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/6relayd-update $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface $(INSTALL_DATA) ./files/6relayd.hotplug $(1)/etc/hotplug.d/iface/30-6relay $(INSTALL_DIR) $(1)/etc/config diff --git a/package/network/ipv6/6relayd/files/6relayd-update b/package/network/ipv6/6relayd/files/6relayd-update new file mode 100755 index 000000000..20980f222 --- /dev/null +++ b/package/network/ipv6/6relayd/files/6relayd-update @@ -0,0 +1,3 @@ +#!/bin/sh +# Make dnsmasq reread hostfile +killall -SIGHUP dnsmasq diff --git a/package/network/ipv6/6relayd/files/6relayd.config b/package/network/ipv6/6relayd/files/6relayd.config index c5431d31b..a4376c0a0 100644 --- a/package/network/ipv6/6relayd/files/6relayd.config +++ b/package/network/ipv6/6relayd/files/6relayd.config @@ -1,8 +1,18 @@ +config server default + option master wan6 + list network lan + option rd server + option dhcpv6 server + option fallback_relay 'rd dhcpv6 ndp' + option compat_ula 1 + + # Example #1: Create a relay for several networks in proxy mode # This can be used to proxy Router Discovery, DHCPv6 and NDP. -#config relay -# option network 'wan lan' +#config server examplerelay +# option master 'wan' +# option network 'lan' # option rd 'relay' # option dhcpv6 'relay' # option ndp 'relay' @@ -11,7 +21,8 @@ # Example #2: Provide Router Discovery and stateless DHCPv6 in server mode # This can be used as a small radvd and stateless DHCPv6-server replacement. -#config server +#config server exampleserver # option network 'lan' # option rd 'server' # option dhcpv6 'server' + diff --git a/package/network/ipv6/6relayd/files/6relayd.hotplug b/package/network/ipv6/6relayd/files/6relayd.hotplug index e29a34a09..79052822f 100644 --- a/package/network/ipv6/6relayd/files/6relayd.hotplug +++ b/package/network/ipv6/6relayd/files/6relayd.hotplug @@ -1,2 +1,6 @@ #!/bin/sh -/etc/init.d/6relayd enabled && /etc/init.d/6relayd start +/etc/init.d/6relayd enabled || exit 0 +[ -n "$INTERFACE" ] || exit 0 + +. /etc/init.d/6relayd +restart_affected "$INTERFACE" diff --git a/package/network/ipv6/6relayd/files/6relayd.init b/package/network/ipv6/6relayd/files/6relayd.init index 8c50336d0..b26d6c5e3 100644 --- a/package/network/ipv6/6relayd/files/6relayd.init +++ b/package/network/ipv6/6relayd/files/6relayd.init @@ -1,26 +1,23 @@ #!/bin/sh /etc/rc.common # Copyright (c) 2011-2012 OpenWrt.org START=80 +args="" -resolve_ifname() { - grep -qs "^ *$1:" /proc/net/dev && { - append ifaces "$1" - } -} +add_static_lease() { + local cfg="$1" + + local duid id + config_get duid "$cfg" duid + config_get id "$cfg" id + + [ -n "$duid" -a -n "$id" ] && append args "-a$duid:$id" -resolve_network() { - local ifn - fixup_interface "$1" - config_get ifn "$1" ifname - [ -z "$ifn" ] && return 1 - resolve_ifname "$ifn" } start_6relayd() { local cfg="$1" local mode="$2" - local args="-s -l" - local ifaces="" + args="-l/tmp/hosts/6relayd,/usr/sbin/6relayd-update" SERVICE_DAEMONIZE=1 SERVICE_WRITE_PID=1 @@ -33,43 +30,113 @@ start_6relayd() { fi } - local net networks - config_get networks "$cfg" network - for net in $networks; do - resolve_network "$net" || { - return 1 - } - done + # Detect master interface + local master masterif + config_get masterif "$cfg" master + network_get_device master "$masterif" + [ -z "$master" ] && master="." - local ifn ifnames - config_get ifnames "$cfg" ifname - for ifn in $ifnames; do - resolve_ifname "$ifn" + # Detect slave interfaces + local slaves="" + local slaveifs + config_get slaveifs "$cfg" network + for slaveif in $slaveifs; do + local slave + network_get_device slave "$slaveif" + # Compatibility with old config format + if [ "$mode" = "relay" -a "$master" = "." ]; then + [ -z "$slave" ] && return 0 + master="$slave" + else + [ -n "$slave" ] && append slaves "$slave" + fi done - local rd - config_get rd "$cfg" rd - [ -n "$rd" ] && append args "-R$rd" + # Bail if no slaves are active + [ -z "$slaves" ] && return 0 - local dhcpv6 + # Configure services + local rd dhcpv6 ndp + config_get rd "$cfg" rd config_get dhcpv6 "$cfg" dhcpv6 - [ -n "$dhcpv6" ] && append args "-D$dhcpv6" - - local ndp config_get ndp "$cfg" ndp - [ "$ndp" == "relay" ] && append args "-N -r" - local always_rewrite_dns + # Test for fallback mode + local fallback fallback_relay + config_get fallback_relay "$cfg" fallback_relay + + if [ -n "$fallback_relay" -a "$master" != "." ]; then + local prefix + network_get_prefix6 prefix "$masterif" + [ -z "$prefix" ] && fallback=1 + fi + + if [ -n "$fallback" ]; then + for service in $fallback_relay; do + eval "$service=relay" + done + fi + + # Configure feature options + local always_rewrite_dns rewrite_dns_addr config_get_bool always_rewrite_dns "$cfg" always_rewrite_dns 0 - [ $always_rewrite_dns -eq 1 ] && append args "-n" + config_get rewrite_dns_addr "$cfg" rewrite_dns_addr + [ "$always_rewrite_dns" -eq 1 -o -n "$rewrite_dns_addr" ] && append args "-n$rewrite_dns_addr" + + local always_assume_default + config_get_bool always_assume_default "$cfg" always_assume_default 0 + [ "$always_assume_default" -eq 1 ] && append args "-u" - # In server mode the first interface needs to be passed twice - [ "$mode" == "server" ] && ifaces=". $ifaces" + local compat_ula + config_get_bool compat_ula "$cfg" compat_ula 0 + [ "$compat_ula" -eq 1 ] && append args "-c" - service_start /usr/sbin/6relayd $args $ifaces + local management_level + config_get management_level "$cfg" management_level + [ -n "$management_level" ] && append args "-m$management_level" + + config_foreach add_static_lease lease + + [ "$ndp" = "relay" ] && append args "-N -s" + [ "$rd" = "relay" ] && append args "-Rrelay" + [ "$rd" = "server" ] && append args "-Rserver" + [ "$dhcpv6" = "relay" ] && append args "-Drelay" + [ "$dhcpv6" = "server" ] && append args "-Dserver" + [ "$ndp" != "relay" -a "$rd" != "relay" -a "$dhcpv6" != "relay" ] && master="." + + service_start /usr/sbin/6relayd $args $master $slaves +} + +restart_affected_6relayd() { + local cfg="$1" + local net="$2" + local mode="$3" + + local master slaves + config_get master "$cfg" master + config_get slaves "$cfg" network + + for iface in $master $slaves; do + if [ "$iface" = "$net" ]; then + SERVICE_PID_FILE="/var/run/6relayd-$cfg.pid" + service_stop /usr/sbin/6relayd + rm -f "$SERVICE_PID_FILE" + start_6relayd "$cfg" "$mode" + fi + done +} + +restart_affected() { + . /lib/functions/service.sh + . /lib/functions/network.sh + local net="$1" + config_load 6relayd + config_foreach restart_affected_6relayd server "$net" + config_foreach restart_affected_6relayd relay "$net" "relay" } stop() { + . /lib/functions/service.sh for pid in /var/run/6relayd-*.pid; do SERVICE_PID_FILE="$pid" service_stop /usr/sbin/6relayd @@ -78,8 +145,9 @@ stop() { } start() { - include /lib/network + . /lib/functions/service.sh + . /lib/functions/network.sh config_load 6relayd + config_foreach start_6relayd server config_foreach start_6relayd relay relay - config_foreach start_6relayd server server } diff --git a/package/network/ipv6/6to4/Makefile b/package/network/ipv6/6to4/Makefile index f29571d86..8bdbb82d6 100644 --- a/package/network/ipv6/6to4/Makefile +++ b/package/network/ipv6/6to4/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6to4 -PKG_VERSION:=11 +PKG_VERSION:=12 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/6to4 - SECTION:=ipv6 - CATEGORY:=IPv6 + SECTION:=net + CATEGORY:=Network DEPENDS:=+kmod-ipv6 +kmod-sit TITLE:=IPv6-to-IPv4 configuration support MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org> diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh index 3a616f675..6f2fbd840 100755 --- a/package/network/ipv6/6to4/files/6to4.sh +++ b/package/network/ipv6/6to4/files/6to4.sh @@ -29,82 +29,13 @@ test_6to4_rfc1918() return 1 } -set_6to4_radvd_interface() { - local cfgid="$1" - local lanif="${2:-lan}" - local ifmtu="${3:-1280}" - local ifsection="" - - find_ifsection() { - local net - local cfg="$1" - config_get net "$cfg" interface - - [ "$net" = "$lanif" ] && { - ifsection="$cfg" - return 1 - } - } - - config_foreach find_ifsection interface - - [ -z "$ifsection" ] && { - ifsection="iface_$sid" - uci_set_state radvd "$ifsection" "" interface - uci_set_state radvd "$ifsection" interface "$lanif" - } - - uci_set_state radvd "$ifsection" ignore 0 - uci_set_state radvd "$ifsection" IgnoreIfMissing 1 - uci_set_state radvd "$ifsection" AdvSendAdvert 1 - uci_set_state radvd "$ifsection" MaxRtrAdvInterval 30 - uci_set_state radvd "$ifsection" AdvLinkMTU "$ifmtu" -} - -set_6to4_radvd_prefix() { - local cfgid="$1" - local lanif="${2:-lan}" - local wanif="${3:-wan}" - local prefix="${4:-0:0:0:1::/64}" - local vlt="${5:-300}" - local plt="${6:-120}" - local pfxsection="" - - find_pfxsection() { - local net base - local cfg="$1" - config_get net "$cfg" interface - config_get base "$cfg" Base6to4Interface - - [ "$net" = "$lanif" ] && [ "$base" = "$wanif" ] && { - pfxsection="$cfg" - return 1 - } - } - - config_foreach find_pfxsection prefix - - [ -z "$pfxsection" ] && { - pfxsection="prefix_${sid}_${lanif}" - uci_set_state radvd "$pfxsection" "" prefix - uci_set_state radvd "$pfxsection" ignore 0 - uci_set_state radvd "$pfxsection" interface "$lanif" - uci_set_state radvd "$pfxsection" prefix "$prefix" - uci_set_state radvd "$pfxsection" AdvOnLink 1 - uci_set_state radvd "$pfxsection" AdvAutonomous 1 - uci_set_state radvd "$pfxsection" AdvValidLifetime "$vlt" - uci_set_state radvd "$pfxsection" AdvPreferredLifetime "$plt" - uci_set_state radvd "$pfxsection" Base6to4Interface "$wanif" - } -} - proto_6to4_setup() { local cfg="$1" local iface="$2" local link="6to4-$cfg" - local mtu ttl ipaddr adv_subnet adv_interface adv_valid_lifetime adv_preferred_lifetime - json_get_vars mtu ttl ipaddr adv_subnet adv_interface adv_valid_lifetime adv_preferred_lifetime + local mtu ttl ipaddr + json_get_vars mtu ttl ipaddr ( proto_add_host_dependency "$cfg" 0.0.0.0 ) @@ -132,6 +63,7 @@ proto_6to4_setup() { proto_init_update "$link" 1 proto_add_ipv6_address "$local6" 16 + proto_add_ipv6_prefix "$prefix6::/48" proto_add_ipv6_route "::" 0 "::192.88.99.1" proto_add_tunnel @@ -142,53 +74,10 @@ proto_6to4_setup() { proto_close_tunnel proto_send_update "$cfg" - - [ -f /etc/config/radvd ] && /etc/init.d/radvd enabled && { - local sid="6to4_$cfg" - - uci_revert_state radvd - config_load radvd - - adv_subnet=$((0x${adv_subnet:-1})) - - local adv_subnets="" - - for adv_interface in ${adv_interface:-lan}; do - local adv_ifname - network_get_device adv_ifname "${adv_interface:-lan}" || continue - - local subnet6="$(printf "%s:%x::1/64" "$prefix6" $adv_subnet)" - - logger -t "$link" " * Advertising IPv6 subnet $subnet6 on ${adv_interface:-lan} ($adv_ifname)" - ip -6 addr add $subnet6 dev $adv_ifname - - set_6to4_radvd_interface "$sid" "$adv_interface" "$mtu" - set_6to4_radvd_prefix "$sid" "$adv_interface" \ - "$wanif" "$(printf "0:0:0:%x::/64" $adv_subnet)" \ - "$adv_valid_lifetime" "$adv_preferred_lifetime" - - adv_subnets="${adv_subnets:+$adv_subnets }$adv_ifname:$subnet6" - adv_subnet=$(($adv_subnet + 1)) - done - - uci_set_state network "$cfg" adv_subnets "$adv_subnets" - - /etc/init.d/radvd restart - } } proto_6to4_teardown() { local cfg="$1" - local link="6to4-$cfg" - - local adv_subnets=$(uci_get_state network "$cfg" adv_subnets) - - grep -qs "^ *$link:" /proc/net/dev && { - [ -n "$adv_subnets" ] && { - uci_revert_state radvd - /etc/init.d/radvd enabled && /etc/init.d/radvd restart - } - } } proto_6to4_init_config() { @@ -198,10 +87,6 @@ proto_6to4_init_config() { proto_config_add_string "ipaddr" proto_config_add_int "mtu" proto_config_add_int "ttl" - proto_config_add_string "adv_interface" - proto_config_add_string "adv_subnet" - proto_config_add_int "adv_valid_lifetime" - proto_config_add_int "adv_preferred_lifetime" } [ -n "$INCLUDE_ONLY" ] || { diff --git a/package/network/ipv6/ds-lite/Makefile b/package/network/ipv6/ds-lite/Makefile new file mode 100644 index 000000000..688ddf901 --- /dev/null +++ b/package/network/ipv6/ds-lite/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ds-lite +PKG_VERSION:=1 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ds-lite + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-ipv6 +kmod-ip6-tunnel + TITLE:=Dual-Stack Lite (DS-Lite) configuration support + MAINTAINER:=Steven Barth <steven@midlink.org> + PKGARCH:=all +endef + +define Package/ds-lite/description +Provides support for Dual-Stack Lite in /etc/config/network. +Refer to http://wiki.openwrt.org/doc/uci/network for +configuration details. +endef + +define Build/Compile +endef + +define Build/Configure +endef + +define Package/ds-lite/install + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/dslite.sh $(1)/lib/netifd/proto/dslite.sh +endef + +$(eval $(call BuildPackage,ds-lite)) diff --git a/package/network/ipv6/ds-lite/files/dslite.sh b/package/network/ipv6/ds-lite/files/dslite.sh new file mode 100755 index 000000000..67887881e --- /dev/null +++ b/package/network/ipv6/ds-lite/files/dslite.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# dslite.sh - IPv4-in-IPv6 tunnel backend +# Copyright (c) 2013 OpenWrt.org + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . /lib/functions/network.sh + . ../netifd-proto.sh + init_proto "$@" +} + +proto_dslite_setup() { + local cfg="$1" + local iface="$2" + local link="dslite-$cfg" + + local mtu ttl peeraddr ip6addr tunlink + json_get_vars mtu ttl peeraddr ip6addr tunlink + + [ -z "$peeraddr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" + proto_block_restart "$cfg" + return + } + + ( proto_add_host_dependency "$cfg" "::" "$tunlink" ) + + [ -z "$ip6addr" ] && { + local wanif="$tunlink" + if [ -z "$wanif" ] && ! network_find_wan6 wanif; then + proto_notify_error "$cfg" "NO_WAN_LINK" + return + fi + + if ! network_get_ipaddr6 ip6addr "$wanif"; then + proto_notify_error "$cfg" "NO_WAN_LINK" + return + fi + } + + proto_init_update "$link" 1 + proto_add_ipv4_route "0.0.0.0" 0 + proto_add_ipv4_address "192.0.0.2" "" "" "192.0.0.1" + + proto_add_tunnel + json_add_string mode ipip6 + json_add_int mtu "${mtu:-1280}" + json_add_int ttl "${ttl:-64}" + json_add_string local "$ip6addr" + json_add_string remote "$peeraddr" + [ -n "$tunlink" ] && json_add_string link "$tunlink" + proto_close_tunnel + + proto_send_update "$cfg" +} + +proto_dslite_teardown() { + local cfg="$1" +} + +proto_dslite_init_config() { + no_device=1 + available=1 + + proto_config_add_string "ip6addr" + proto_config_add_string "peeraddr" + proto_config_add_string "tunlink" + proto_config_add_int "mtu" + proto_config_add_int "ttl" +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol dslite +} diff --git a/package/network/ipv6/ipv6-support/Makefile b/package/network/ipv6/ipv6-support/Makefile deleted file mode 100644 index db1396359..000000000 --- a/package/network/ipv6/ipv6-support/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (C) 2010-2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ipv6-support -PKG_VERSION:=2012-11-29 -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/ipv6-support - SECTION:=ipv6 - CATEGORY:=IPv6 - DEPENDS:=+kmod-ipv6 +6relayd +odhcp6c +6distributed +ip6tables +ubus - TITLE:=Basic IPv6-support for Customer Edge Routers - MAINTAINER:=Steven Barth <steven@midlink.org> - PKGARCH:=all -endef - -define Package/ipv6-support/description -This package provides basic IPv6 support including Router Discovery, -DHCPv6 (client & server), prefix delegation and distribution. -endef - -define Build/Compile -endef - -define Build/Configure -endef - -define Package/ipv6-support/conffiles -/etc/config/network6 -endef - -define Package/ipv6-support/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DATA) ./files/ipv6.hotplug $(1)/etc/hotplug.d/iface/20-ipv6 - $(INSTALL_DIR) $(1)/lib/ipv6 - $(INSTALL_DATA) ./files/support.sh $(1)/lib/ipv6/support.sh - $(INSTALL_BIN) ./files/dhcpv6.sh $(1)/lib/ipv6/dhcpv6.sh - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/network6.config $(1)/etc/config/network6 -endef - -$(eval $(call BuildPackage,ipv6-support)) diff --git a/package/network/ipv6/ipv6-support/files/dhcpv6.sh b/package/network/ipv6/ipv6-support/files/dhcpv6.sh deleted file mode 100755 index 67fa174d1..000000000 --- a/package/network/ipv6/ipv6-support/files/dhcpv6.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012 OpenWrt.org -. /lib/ipv6/support.sh -. /lib/netifd/netifd-proto.sh - -local device="$1" -local state="$2" -local network="" - -resolve_network network "$device" - -# Unknown network -[ -z "$network" ] && exit 0 - - -# Announce prefixes -for prefix in $PREFIXES; do - announce_prefix "$prefix" "$network" -done - -for prefix in $PREFIXES_LOST; do - announce_prefix "$prefix" "$network" delprefix -done - - -# Enable relaying if requested -local prefix_fallback -config_get prefix_fallback "$network" prefix_fallback -[ "$prefix_fallback" == "relay" -a -z "$PREFIXES" -a "$state" != "unbound" ] && - restart_relay "$network" 1 - -# Disable relay if requested -[ "$prefix_fallback" != "relay" -o -n "$PREFIXES" -o "$state" == "unbound" ] && - stop_relay "$network" - - -# Operations in case of success -[ "$state" == "timeout" || "$state" == "unbound" ] && exit 0 - -local peerdns -config_get_bool peerdns "$network" peerdns 0 -[ "peerdns" -eq "1" ] && { - proto_init_update "*" 1 - for server in $RDNSS; do - proto_add_dns_server "$server" - done - for domain in $DOMAINS; do - proto_add_dns_search "$domain" - done - proto_send_update "$network" -} - diff --git a/package/network/ipv6/ipv6-support/files/ipv6.hotplug b/package/network/ipv6/ipv6-support/files/ipv6.hotplug deleted file mode 100644 index e3379b6b2..000000000 --- a/package/network/ipv6/ipv6-support/files/ipv6.hotplug +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012 OpenWrt.org -[ "$DEVICE" == "lo" ] && exit 0 -. /lib/ipv6/support.sh - -local mode -config_get mode "$INTERFACE" mode - -case "$ACTION" in - ifup) - [ "$mode" != "downstream" ] && enable_static $INTERFACE $DEVICE - [ "$mode" == "upstream" ] && enable_upstream $INTERFACE $DEVICE - [ "$mode" == "downstream" ] && enable_downstream $INTERFACE $DEVICE - ;; - ifdown) - disable_interface $INTERFACE $DEVICE - ;; -esac diff --git a/package/network/ipv6/ipv6-support/files/network6.config b/package/network/ipv6/ipv6-support/files/network6.config deleted file mode 100644 index 4632bba0b..000000000 --- a/package/network/ipv6/ipv6-support/files/network6.config +++ /dev/null @@ -1,17 +0,0 @@ -config interface wan - option mode upstream - option ula_prefix auto - option request_prefix auto - option prefix_fallback relay - option peerdns 1 - - -config interface lan - option mode downstream - option advertise_prefix 64 - option relay_master wan - - -config interface 6in4 - option mode static - list static_prefix 2001:DB8::/48 diff --git a/package/network/ipv6/ipv6-support/files/support.sh b/package/network/ipv6/ipv6-support/files/support.sh deleted file mode 100644 index 5525a3a56..000000000 --- a/package/network/ipv6/ipv6-support/files/support.sh +++ /dev/null @@ -1,304 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012 OpenWrt.org -. /lib/functions.sh -. /lib/functions/service.sh -. /lib/functions/network.sh - -config_load network6 - - -conf_get() { - local __return="$1" - local __device="$2" - local __option="$3" - local __value=$(cat "/proc/sys/net/ipv6/conf/$device/$option") - eval "$__return=$__value" -} - - -conf_set() { - local device="$1" - local option="$2" - local value="$3" - echo "$value" > "/proc/sys/net/ipv6/conf/$device/$option" -} - - -stop_service() { - local __exe="$1" - SERVICE_PID_FILE="$2" - local __return="$3" - - service_check "$__exe" && { - service_stop "$__exe" - [ -n "$__return" ] && eval "$__return=1" - } - rm -f "$SERVICE_PID_FILE" -} - - -start_service() { - local cmd="$1" - local pidfile="$2" - - SERVICE_DAEMONIZE=1 - SERVICE_WRITE_PID=1 - SERVICE_PID_FILE="$pidfile" - service_start $cmd -} - - -resolve_network_add() { - local __section="$1" - local __device="$2" - local __return="$3" - - local __cdevice - network_get_device __cdevice "$__section" - [ "$__cdevice" != "$__device" ] && return - - eval "$__return"'="'"$__section"'"' -} - - -resolve_network() { - local __return="$1" - local __device="$2" - config_foreach resolve_network_add interface "$__device" "$__return" -} - - -announce_prefix() { - local prefix="$1" - local network="$2" - local cmd="$3" - - local addr=$(echo "$prefix" | cut -d/ -f1) - local rem=$(echo "$prefix" | cut -d/ -f2) - local length=$(echo "$rem" | cut -d, -f1) - local prefer="" - local valid="" - - # If preferred / valid provided - [ "$rem" != "$length" ] && { - prefer=$(echo "$rem" | cut -d, -f2) - valid=$(echo "$rem" | cut -d, -f3) - } - - local msg='{"network": "'"$network"'", "prefix": "'"$addr"'", "length": '"$length" - [ -n "$valid" ] && msg="$msg"', "valid": '"$valid"', "preferred": '"$prefer" - [ -z "$cmd" ] && cmd=newprefix - - ubus call 6distributed "$cmd" "$msg}" -} - - -disable_downstream() { - local network="$1" - - # Notify the address distribution daemon - ubus call 6distributed deliface '{"network": "'"$network"'"}' - - # Disable advertisement daemon - stop_service /usr/sbin/6relayd "/var/run/ipv6-downstream-$network.pid" -} - - -restart_relay_add() { - local __section="$1" - local __return="$2" - local __master="$3" - local __disable="$4" - - network_is_up "$__section" || return - - # Match master network - local __cmaster="" - config_get __cmaster "$__section" relay_master - [ "$__master" != "$__cmaster" ] && return - - # Disable any active distribution - disable_downstream "$__section" - - local __device="" - network_get_device __device "$__section" - - # Coming from stop relay, reenable distribution - [ "$__disable" == "disable" ] && { - enable_downstream "$__section" "$__device" - return - } - - - eval "$__return"'="$'"$__return"' '"$__device"'"' -} - - -stop_relay() { - local network="$1" - local pid="/var/run/ipv6-relay-$network.pid" - local was_running="" - - stop_service /usr/sbin/6relayd "$pid" was_running - - # Reenable normal distribution on slave interfaces - [ -n "$was_running" ] && config_foreach restart_relay_add interface dummy "$network" disable -} - - -restart_relay() { - local network="$1" - local force="$2" - local pid="/var/run/ipv6-relay-$network.pid" - - local not_running=0 - [ -f "$pid" ] || not_running=1 - - # Don't start if not desired - [ "$force" != "1" ] && [ "$not_running" == "1" ] && return - - # Kill current relay and distribution daemon - stop_relay "$network" - - # Detect master device - local device="" - network_get_device device $network - - # Generate command string - local cmd="/usr/sbin/6relayd -A $device " - config_foreach restart_relay_add interface cmd "$network" - - # Start relay - start_service "$cmd" "$pid" -} - - -restart_master_relay() { - local network="$1" - - # Disable active relaying to this interface - local relay_master - config_get relay_master "$network" relay_master - [ -n "$relay_master" ] && restart_relay "$relay_master" -} - - -disable_interface() { - local network="$1" - - # Delete all prefixes routed to this interface - ubus call 6distributed delprefix '{"network": "'"$network"'"}' - - # Restart Relay - restart_master_relay "$network" - - # Disable distribution - disable_downstream "$network" - - # Disable relay - stop_relay "$network" - - # Disable DHCPv6 client if enabled, state script will take care - stop_service /usr/sbin/odhcp6c "/var/run/ipv6-upstream-$network.pid" -} - - -enable_static() { - local network="$1" - local device="$2" - - # Enable global forwarding - local global_forward - conf_get global_forward all forwarding - [ "$global_forward" != "1" ] && conf_set all forwarding 1 - - # Configure device - conf_set "$device" accept_ra 1 - conf_set "$device" forwarding 1 - - # ULA-integration - local ula_prefix="" - config_get ula_prefix "$network" ula_prefix - - # ULA auto configuration (first init) - [ "$ula_prefix" == "auto" ] && { - local r1="" - local r2="" - local r3="" - - # Sometimes results are empty, therefore try until it works... - while [ -z "$r1" -o -z "$r2" -o -z "$r3" ]; do - r1=$(printf "%02x" $(($(</dev/urandom tr -dc 0-9 | dd bs=9 count=1) % 256))) - r2=$(printf "%01x" $(($(</dev/urandom tr -dc 0-9 | dd bs=9 count=1) % 65536))) - r3=$(printf "%01x" $(($(</dev/urandom tr -dc 0-9 | dd bs=9 count=1) % 65536))) - done - - ula_prefix="fd$r1:$r2:$r3::/48" - - # Save prefix so it will be preserved across reboots - uci set network6.$network.ula_prefix=$ula_prefix - uci commit network6 - } - - # Announce ULA - [ -n "$ula_prefix" ] && announce_prefix $ula_prefix $network - - # Announce all static prefixes - config_list_foreach "$network" static_prefix announce_prefix $network -} - - -enable_downstream() { - local network="$1" - local device="$2" - - # Get IPv6 prefixes - local length - config_get length "$network" advertise_prefix - [ -z "$length" ] && length=64 - [ "$length" -ne "0" ] && ubus call 6distributed newiface '{"network": "'"$network"'", "iface": "'"$device"'", "length": '"$length"'}' - - # Start RD & DHCPv6 service - local pid="/var/run/ipv6-downstream-$network.pid" - start_service "/usr/sbin/6relayd -Rserver -Dserver . $device" "$pid" - - # Try relaying if necessary - restart_master_relay "$network" -} - - -enable_upstream() { - local network="$1" - local device="$2" - - # Configure device - conf_set "$device" accept_ra 2 - conf_set "$device" forwarding 2 - - # Trigger RS - conf_set "$device" disable_ipv6 1 - conf_set "$device" disable_ipv6 0 - - # Configure DHCPv6-client - local dhcp6_opts="$device" - - # Configure DHCPv6-client (e.g. requested prefix) - local request_prefix - config_get request_prefix "$network" request_prefix - [ -z "$request_prefix" ] && request_prefix="auto" - [ "$request_prefix" != "no" ] && { - [ "$request_prefix" == "auto" ] && request_prefix=0 - dhcp6_opts="-P$request_prefix $dhcp6_opts" - } - - # Start DHCPv6 client - local pid="/var/run/ipv6-upstream-$network.pid" - start_service "/usr/sbin/odhcp6c -s/lib/ipv6/dhcpv6.sh $dhcp6_opts" "$pid" - - # Refresh RA on all interfaces - for pid in /var/run/ipv6-downstream-*.pid; do - kill -SIGUSR1 $(cat "$pid") - done -} - - diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index acb85af5e..ead0f666d 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,23 +8,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_VERSION:=2012-11-29 +PKG_VERSION:=2013-05-21 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=53e6041e90e9d69576240ff5e403f8fa35cc6a93 - +PKG_SOURCE_VERSION:=6677edeab2d7472b97a34461872c2c8985d6a57c PKG_MAINTAINER:=Steven Barth <steven@midlink.org> include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk define Package/odhcp6c - SECTION:=ipv6 - CATEGORY:=IPv6 + SECTION:=net + CATEGORY:=Network TITLE:=Embedded DHCPv6-client for OpenWrt DEPENDS:=+kmod-ipv6 endef @@ -32,6 +31,9 @@ endef define Package/odhcp6c/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/dhcpv6.sh $(1)/lib/netifd/proto/dhcpv6.sh + $(INSTALL_BIN) ./files/dhcpv6.script $(1)/lib/netifd/ endef $(eval $(call BuildPackage,odhcp6c)) diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script new file mode 100755 index 000000000..324a823ce --- /dev/null +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -0,0 +1,110 @@ +#!/bin/sh +[ -z "$2" ] && echo "Error: should be run by odhcpc6c" && exit 1 +. /lib/functions.sh +. /lib/netifd/netifd-proto.sh + +setup_interface () { + local device="$1" + proto_init_update "*" 1 + + # Merge RA-DNS + for radns in $RA_DNS; do + local duplicate=0 + for dns in $RDNSS; do + [ "$radns" = "$dns" ] && duplicate=1 + done + [ "$duplicate" = 0 ] && RDNSS="$RDNSS $radns" + done + + for dns in $RDNSS; do + proto_add_dns_server "$dns" + done + + for domain in $DOMAINS; do + proto_add_dns_search "$domain" + done + + for prefix in $PREFIXES; do + proto_add_ipv6_prefix "$prefix" + done + + [ -n "$USERPREFIX" ] && proto_add_ipv6_prefix "$USERPREFIX" + + # Merge addresses + for entry in $RA_ADDRESSES; do + local duplicate=0 + local addr="${entry%%/*}" + for dentry in $ADDRESSES; do + local daddr="${dentry%%/*}" + [ "$addr" = "$daddr" ] && duplicate=1 + done + [ "$duplicate" = "0" ] && ADDRESSES="$ADDRESSES $entry" + done + + for entry in $ADDRESSES; do + local addr="${entry%%/*}" + entry="${entry#*/}" + local mask="${entry%%,*}" + entry="${entry#*,}" + local preferred="${entry%%,*}" + entry="${entry#*,}" + local valid="${entry%%,*}" + + proto_add_ipv6_address "$addr" "$mask" "$preferred" "$valid" 1 + done + + for entry in $RA_ROUTES; do + local addr="${entry%%/*}" + entry="${entry#*/}" + local mask="${entry%%,*}" + entry="${entry#*,}" + local gw="${entry%%,*}" + entry="${entry#*,}" + local valid="${entry%%,*}" + entry="${entry#*,}" + local metric="${entry%%,*}" + + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" + done + + proto_send_update "$INTERFACE" + + if [ -n "$AFTR_IP " -a -n "$IFACE_DSLITE" ]; then +uci -q batch <<-EOF >/dev/null +set network.$IFACE_DSLITE.proto=dslite +set network.$IFACE_DSLITE.auto=0 +set network.$IFACE_DSLITE.peeraddr=$AFTR_IP +set network.$IFACE_DSLITE.tunlink=$INTERFACE +commit network +EOF + + ifdown "$IFACE_DSLITE" + /etc/init.d/network reload + ifup "$IFACE_DSLITE" + fi + + # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN +} + +teardown_interface() { + proto_init_update "*" 0 + proto_send_update "$INTERFACE" +} + +case "$2" in + bound) + teardown_interface "$1" + setup_interface "$1" + ;; + informed|updated|rebound|ra-updated) + setup_interface "$1" + ;; + started|stopped|unbound) + teardown_interface "$1" + ;; +esac + +# user rules +[ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user + +exit 0 diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh new file mode 100755 index 000000000..b2264ed90 --- /dev/null +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +. /lib/functions.sh +. ../netifd-proto.sh +init_proto "$@" + +proto_dhcpv6_init_config() { + proto_config_add_string "reqaddress" + proto_config_add_string "reqprefix" + proto_config_add_string "clientid" + proto_config_add_string "reqopts" + proto_config_add_string "noslaaconly" + proto_config_add_string "norelease" + proto_config_add_string "ip6prefix" +} + +proto_dhcpv6_setup() { + local config="$1" + local iface="$2" + + local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite + + + # Configure + local opts="" + [ -n "$reqaddress" ] && append opts "-N$reqaddress" + + [ -z "$reqprefix" -o "$reqprefix" = "auto" ] && reqprefix=0 + [ "$reqprefix" != "no" ] && append opts "-P$reqprefix" + + [ -n "$clientid" ] && append opts "-c$clientid" + + [ "$noslaaconly" = "1" ] && append opts "-S" + + [ "$norelease" = "1" ] && append opts "-k" + + for opt in $reqopts; do + append opts "-r$opt" + done + + [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix" + [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite" + + proto_export "INTERFACE=$config" + proto_run_command "$config" odhcp6c \ + -s /lib/netifd/dhcpv6.script \ + $opts $iface +} + +proto_dhcpv6_teardown() { + local interface="$1" + proto_kill_command "$interface" +} + +add_protocol dhcpv6 + diff --git a/package/network/ipv6/thc-ipv6/Makefile b/package/network/ipv6/thc-ipv6/Makefile index c5bbe6187..d63757a5e 100644 --- a/package/network/ipv6/thc-ipv6/Makefile +++ b/package/network/ipv6/thc-ipv6/Makefile @@ -37,8 +37,8 @@ THC_DEPENDS_thcping6 := +librt define BuildTool define Package/thc-ipv6-$(subst _,-,$(1)) TITLE:=THC-IPv6 $(1) utility - SECTION:=ipv6 - CATEGORY:=IPv6 + SECTION:=net + CATEGORY:=Network DEPENDS:=+libpcap $(THC_DEPENDS_$(1)) URL:=http://freeworld.thc.org/ SUBMENU:=THC-IPv6 attack and analyzing toolkit |
