0003-Update-odhcp6c-to-latest-git-master.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 11 Jan 2014 11:47:58 +0100
  3. Subject: Update odhcp6c to latest git master
  4. diff --git a/package/odhcp6c/Makefile b/package/odhcp6c/Makefile
  5. index e37b72e..ed51b98 100644
  6. --- a/package/odhcp6c/Makefile
  7. +++ b/package/odhcp6c/Makefile
  8. @@ -8,26 +8,37 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=odhcp6c
  11. -PKG_VERSION:=2013-10-02
  12. +PKG_VERSION:=2014-01-11
  13. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git
  17. PKG_SOURCE_PROTO:=git
  18. -PKG_SOURCE_VERSION:=357ecc1f5163bc7f74c64f4bca387e8d44a2eac5
  19. +PKG_SOURCE_VERSION:=8152153cb9c5b09862bf0c8a0d1005fa8dfdf262
  20. PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. +ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_prefix_class),0)
  24. + CMAKE_OPTIONS += -DEXT_PREFIX_CLASS=$(CONFIG_PACKAGE_odhcp6c_ext_prefix_class)
  25. +endif
  26. +
  27. define Package/odhcp6c
  28. - SECTION:=ipv6
  29. - CATEGORY:=IPv6
  30. + SECTION:=net
  31. + CATEGORY:=Network
  32. TITLE:=Embedded DHCPv6-client for OpenWrt
  33. DEPENDS:=+kmod-ipv6
  34. endef
  35. +define Package/odhcp6c/config
  36. + config PACKAGE_odhcp6c_ext_prefix_class
  37. + int "Prefix Class Extension ID (0 = disabled)"
  38. + depends on PACKAGE_odhcp6c
  39. + default 0
  40. +endef
  41. +
  42. define Package/odhcp6c/install
  43. $(INSTALL_DIR) $(1)/usr/sbin/
  44. $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/
  45. diff --git a/package/odhcp6c/files/dhcpv6.script b/package/odhcp6c/files/dhcpv6.script
  46. index 324a823..8bcf766 100755
  47. --- a/package/odhcp6c/files/dhcpv6.script
  48. +++ b/package/odhcp6c/files/dhcpv6.script
  49. @@ -64,23 +64,28 @@ setup_interface () {
  50. entry="${entry#*,}"
  51. local metric="${entry%%,*}"
  52. - proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
  53. + if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then
  54. + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
  55. + else
  56. + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128"
  57. + for prefix in $PREFIXES; do
  58. + local paddr="${prefix%%,*}"
  59. + proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr"
  60. + done
  61. + fi
  62. done
  63. proto_send_update "$INTERFACE"
  64. if [ -n "$AFTR_IP " -a -n "$IFACE_DSLITE" ]; then
  65. -uci -q batch <<-EOF >/dev/null
  66. -set network.$IFACE_DSLITE.proto=dslite
  67. -set network.$IFACE_DSLITE.auto=0
  68. -set network.$IFACE_DSLITE.peeraddr=$AFTR_IP
  69. -set network.$IFACE_DSLITE.tunlink=$INTERFACE
  70. -commit network
  71. -EOF
  72. -
  73. - ifdown "$IFACE_DSLITE"
  74. - /etc/init.d/network reload
  75. - ifup "$IFACE_DSLITE"
  76. + json_init
  77. + json_add_string name "$IFACE_DSLITE"
  78. + json_add_string ifname "@$INTERFACE"
  79. + json_add_string proto "dslite"
  80. + json_add_string peeraddr "$AFTR_IP"
  81. + json_add_string tunlink "$INTERFACE"
  82. + json_close_object
  83. + ubus call network add_dynamic "$(json_dump)"
  84. fi
  85. # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
  86. diff --git a/package/odhcp6c/files/dhcpv6.sh b/package/odhcp6c/files/dhcpv6.sh
  87. index bf6cd9a..0638d28 100755
  88. --- a/package/odhcp6c/files/dhcpv6.sh
  89. +++ b/package/odhcp6c/files/dhcpv6.sh
  90. @@ -10,18 +10,20 @@ proto_dhcpv6_init_config() {
  91. proto_config_add_string "clientid"
  92. proto_config_add_string "reqopts"
  93. proto_config_add_string "noslaaconly"
  94. + proto_config_add_string "forceprefix"
  95. proto_config_add_string "norelease"
  96. proto_config_add_string "ip6prefix"
  97. proto_config_add_string "iface_dslite"
  98. proto_config_add_string "ifaceid"
  99. + proto_config_add_string "sourcerouting"
  100. }
  101. proto_dhcpv6_setup() {
  102. local config="$1"
  103. local iface="$2"
  104. - local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
  105. - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
  106. + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting
  107. + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting
  108. # Configure
  109. @@ -35,6 +37,8 @@ proto_dhcpv6_setup() {
  110. [ "$noslaaconly" = "1" ] && append opts "-S"
  111. + [ "$forceprefix" = "1" ] && append opts "-F"
  112. +
  113. [ "$norelease" = "1" ] && append opts "-k"
  114. [ -n "$ifaceid" ] && append opts "-i$ifaceid"
  115. @@ -45,6 +49,7 @@ proto_dhcpv6_setup() {
  116. [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
  117. [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
  118. + [ "$sourcerouting" = "1" ] && proto_export "SOURCE_ROUTING=1"
  119. proto_export "INTERFACE=$config"
  120. proto_run_command "$config" odhcp6c \