0012-Revert-ipv6-remove-now-unneeded-source-dest-routing-workarounds.patch 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 21 Jun 2015 05:48:45 +0200
  3. Subject: Revert "ipv6: remove now unneeded source-dest-routing workarounds"
  4. This reverts commit 31214c38c8dd0f70366b523f9b0335145b9386bd.
  5. diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile
  6. index b7c2da7..21e69e6 100644
  7. --- a/package/network/ipv6/6in4/Makefile
  8. +++ b/package/network/ipv6/6in4/Makefile
  9. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
  10. PKG_NAME:=6in4
  11. PKG_VERSION:=21
  12. -PKG_RELEASE:=2
  13. +PKG_RELEASE:=1
  14. PKG_LICENSE:=GPL-2.0
  15. include $(INCLUDE_DIR)/package.mk
  16. diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh
  17. index af2ddca..0289df3 100755
  18. --- a/package/network/ipv6/6in4/files/6in4.sh
  19. +++ b/package/network/ipv6/6in4/files/6in4.sh
  20. @@ -27,8 +27,8 @@ proto_6in4_setup() {
  21. local iface="$2"
  22. local link="6in4-$cfg"
  23. - local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey
  24. - json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey
  25. + local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting
  26. + json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey sourcerouting
  27. [ -z "$peeraddr" ] && {
  28. proto_notify_error "$cfg" "MISSING_ADDRESS"
  29. @@ -48,17 +48,21 @@ proto_6in4_setup() {
  30. proto_init_update "$link" 1
  31. + local source=""
  32. + [ "$sourcerouting" != "0" ] && source="::/128"
  33. + proto_add_ipv6_route "::" 0 "" "" "" "$source"
  34. +
  35. [ -n "$ip6addr" ] && {
  36. local local6="${ip6addr%%/*}"
  37. local mask6="${ip6addr##*/}"
  38. [[ "$local6" = "$mask6" ]] && mask6=
  39. proto_add_ipv6_address "$local6" "$mask6"
  40. - proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
  41. + [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
  42. }
  43. [ -n "$ip6prefix" ] && {
  44. proto_add_ipv6_prefix "$ip6prefix"
  45. - proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
  46. + [ "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
  47. }
  48. proto_add_tunnel
  49. @@ -142,6 +146,7 @@ proto_6in4_init_config() {
  50. proto_config_add_int "mtu"
  51. proto_config_add_int "ttl"
  52. proto_config_add_string "tos"
  53. + proto_config_add_boolean "sourcerouting"
  54. }
  55. [ -n "$INCLUDE_ONLY" ] || {
  56. diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile
  57. index cde7117..f9b7eae 100644
  58. --- a/package/network/ipv6/6rd/Makefile
  59. +++ b/package/network/ipv6/6rd/Makefile
  60. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
  61. PKG_NAME:=6rd
  62. PKG_VERSION:=9
  63. -PKG_RELEASE:=2
  64. +PKG_RELEASE:=1
  65. PKG_LICENSE:=GPL-2.0
  66. include $(INCLUDE_DIR)/package.mk
  67. diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh
  68. index 6c68b3b..b485136 100644
  69. --- a/package/network/ipv6/6rd/files/6rd.sh
  70. +++ b/package/network/ipv6/6rd/files/6rd.sh
  71. @@ -14,8 +14,8 @@ proto_6rd_setup() {
  72. local iface="$2"
  73. local link="6rd-$cfg"
  74. - local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone
  75. - json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink zone
  76. + local mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone
  77. + json_get_vars mtu df ttl tos ipaddr peeraddr ip6prefix ip6prefixlen ip4prefixlen tunlink sourcerouting zone
  78. [ -z "$ip6prefix" -o -z "$peeraddr" ] && {
  79. proto_notify_error "$cfg" "MISSING_ADDRESS"
  80. @@ -54,8 +54,13 @@ proto_6rd_setup() {
  81. proto_add_ipv6_address "$ip6addr" "$ip6prefixlen"
  82. proto_add_ipv6_prefix "$ip6lanprefix"
  83. - proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen"
  84. - proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix"
  85. + if [ "$sourcerouting" != "0" ]; then
  86. + proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "::/128"
  87. + proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6addr/$ip6prefixlen"
  88. + proto_add_ipv6_route "::" 0 "::$peeraddr" 4096 "" "$ip6lanprefix"
  89. + else
  90. + proto_add_ipv6_route "::" 0 "::$peeraddr" 4096
  91. + fi
  92. proto_add_tunnel
  93. json_add_string mode sit
  94. diff --git a/package/network/ipv6/6to4/Makefile b/package/network/ipv6/6to4/Makefile
  95. index fcec90d..6be2cc5 100644
  96. --- a/package/network/ipv6/6to4/Makefile
  97. +++ b/package/network/ipv6/6to4/Makefile
  98. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
  99. PKG_NAME:=6to4
  100. PKG_VERSION:=12
  101. -PKG_RELEASE:=2
  102. +PKG_RELEASE:=1
  103. PKG_LICENSE:=GPL-2.0
  104. include $(INCLUDE_DIR)/package.mk
  105. diff --git a/package/network/ipv6/6to4/files/6to4.sh b/package/network/ipv6/6to4/files/6to4.sh
  106. index 57efc52..ce1de53 100755
  107. --- a/package/network/ipv6/6to4/files/6to4.sh
  108. +++ b/package/network/ipv6/6to4/files/6to4.sh
  109. @@ -34,8 +34,8 @@ proto_6to4_setup() {
  110. local iface="$2"
  111. local link="6to4-$cfg"
  112. - local mtu ttl tos ipaddr
  113. - json_get_vars mtu ttl tos ipaddr
  114. + local mtu ttl tos ipaddr sourcerouting
  115. + json_get_vars mtu ttl tos ipaddr sourcerouting
  116. ( proto_add_host_dependency "$cfg" 0.0.0.0 )
  117. @@ -65,8 +65,13 @@ proto_6to4_setup() {
  118. proto_add_ipv6_address "$local6" 16
  119. proto_add_ipv6_prefix "$prefix6::/48"
  120. - proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16"
  121. - proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48"
  122. + if [ "$sourcerouting" != "0" ]; then
  123. + proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "::/128"
  124. + proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$local6/16"
  125. + proto_add_ipv6_route "::" 0 "::192.88.99.1" "" "" "$prefix6::/48"
  126. + else
  127. + proto_add_ipv6_route "::" 0 "::192.88.99.1"
  128. + fi
  129. proto_add_tunnel
  130. json_add_string mode sit
  131. diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
  132. index a90f5ce..ddd6917 100644
  133. --- a/package/network/ipv6/odhcp6c/Makefile
  134. +++ b/package/network/ipv6/odhcp6c/Makefile
  135. @@ -8,7 +8,7 @@
  136. include $(TOPDIR)/rules.mk
  137. PKG_NAME:=odhcp6c
  138. -PKG_VERSION:=2015-06-09
  139. +PKG_VERSION:=2015-05-16
  140. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  141. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  142. diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
  143. index 650c9b2..6cd59fa 100755
  144. --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
  145. +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
  146. @@ -86,9 +86,10 @@ setup_interface () {
  147. entry="${entry#*,}"
  148. local metric="${entry%%,*}"
  149. - if [ -z "$gw" ]; then
  150. + if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then
  151. proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
  152. else
  153. + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128"
  154. for prefix in $PREFIXES $ADDRESSES; do
  155. local paddr="${prefix%%,*}"
  156. proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr"
  157. diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
  158. index adcb100..9fb6fa3 100755
  159. --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
  160. +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
  161. @@ -23,6 +23,7 @@ proto_dhcpv6_init_config() {
  162. proto_config_add_string zone_464xlat
  163. proto_config_add_string zone
  164. proto_config_add_string 'ifaceid:ip6addr'
  165. + proto_config_add_string 'sourcerouting:bool'
  166. proto_config_add_string "userclass"
  167. proto_config_add_string "vendorclass"
  168. proto_config_add_boolean delegate
  169. @@ -34,8 +35,8 @@ proto_dhcpv6_setup() {
  170. local config="$1"
  171. local iface="$2"
  172. - local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
  173. - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
  174. + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
  175. + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
  176. # Configure
  177. @@ -69,6 +70,7 @@ proto_dhcpv6_setup() {
  178. [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
  179. [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map"
  180. [ -n "$iface_464xlat" ] && proto_export "IFACE_464XLAT=$iface_464xlat"
  181. + [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1"
  182. [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0"
  183. [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0"
  184. [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite"