Browse Source

Fresh pull from upstream lede-17.01 branch to fix several outstanding
bugs. Some support may have regressed as a result.

RISCi_ATOM 2 years ago
parent
commit
447cf1a2b7
100 changed files with 582 additions and 1319 deletions
  1. 1 1
      include/feeds.mk
  2. 2 2
      include/image-commands.mk
  3. 1 0
      include/image-legacy.mk
  4. 4 4
      include/image.mk
  5. 1 1
      include/prereq-build.mk
  6. 3 2
      include/toplevel.mk
  7. 5 3
      package/base-files/Makefile
  8. 2 5
      package/base-files/files/bin/config_generate
  9. 1 1
      package/base-files/files/etc/init.d/system
  10. 61 34
      package/base-files/files/lib/functions/network.sh
  11. 21 1
      package/base-files/files/lib/functions/uci-defaults.sh
  12. 4 1
      package/base-files/files/lib/preinit/10_indicate_preinit
  13. 1 1
      package/base-files/files/usr/lib/os-release
  14. 4 4
      package/base-files/image-config.in
  15. 7 7
      package/kernel/linux/modules/crypto.mk
  16. 0 1
      package/kernel/linux/modules/netdevices.mk
  17. 2 2
      package/kernel/linux/modules/netfilter.mk
  18. 1 1
      package/kernel/linux/modules/sound.mk
  19. 2 2
      package/kernel/linux/modules/video.mk
  20. 6 4
      package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
  21. 3 3
      package/kernel/mac80211/files/lib/wifi/mac80211.sh
  22. 0 10
      package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
  23. 0 20
      package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch
  24. 3 3
      package/libs/mbedtls/Makefile
  25. 27 27
      package/libs/mbedtls/patches/200-config.patch
  26. 1 1
      package/network/config/gre/Makefile
  27. 1 1
      package/network/config/gre/files/gre.sh
  28. 3 13
      package/network/services/dnsmasq/Makefile
  29. 0 46
      package/network/services/dnsmasq/files/dhcp-script.sh
  30. 1 1
      package/network/services/dnsmasq/files/dhcp.conf
  31. 67 304
      package/network/services/dnsmasq/files/dnsmasq.init
  32. 0 4
      package/network/services/dnsmasq/files/dnsmasq_acl.json
  33. 0 15
      package/network/services/dnsmasq/files/rfc6761.conf
  34. 0 126
      package/network/services/dnsmasq/patches/240-ubus.patch
  35. 1 1
      package/network/services/hostapd/Makefile
  36. 1 1
      package/network/services/hostapd/files/hostapd.sh
  37. 4 4
      package/network/services/odhcpd/Makefile
  38. 17 2
      package/network/services/odhcpd/files/odhcpd.defaults
  39. 5 4
      package/network/services/openvpn/Makefile
  40. 29 54
      package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch
  41. 3 3
      package/network/services/uhttpd/Makefile
  42. 1 1
      package/network/utils/comgt/Makefile
  43. 1 1
      package/network/utils/comgt/files/3g.sh
  44. 1 2
      package/network/utils/comgt/files/directip.sh
  45. 1 1
      package/network/utils/curl/Makefile
  46. 4 5
      package/network/utils/tcpdump/Makefile
  47. 39 35
      package/network/utils/tcpdump/patches/100-tcpdump_mini.patch
  48. 1 1
      scripts/checkpatch.pl
  49. 26 9
      scripts/feeds
  50. 1 1
      scripts/om-fwupgradecfg-gen.sh
  51. 3 2
      target/imagebuilder/Makefile
  52. 7 1
      target/linux/ar71xx/base-files/etc/board.d/01_leds
  53. 6 7
      target/linux/ar71xx/base-files/etc/board.d/02_network
  54. 3 0
      target/linux/ar71xx/base-files/etc/diag.sh
  55. 0 133
      target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  56. 4 0
      target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration
  57. 5 5
      target/linux/ar71xx/base-files/lib/ar71xx.sh
  58. 0 54
      target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
  59. 2 2
      target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  60. 1 1
      target/linux/ar71xx/config-4.4
  61. 15 13
      target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
  62. 1 1
      target/linux/ar71xx/files/arch/mips/ath79/Makefile
  63. 37 42
      target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c
  64. 0 87
      target/linux/ar71xx/files/arch/mips/ath79/mach-gl-usb150.c
  65. 2 0
      target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
  66. 1 1
      target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c
  67. 1 1
      target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
  68. 17 62
      target/linux/ar71xx/image/generic.mk
  69. 0 25
      target/linux/ar71xx/image/legacy-devices.mk
  70. 2 2
      target/linux/ar71xx/image/legacy.mk
  71. 2 2
      target/linux/ar71xx/image/mikrotik.mk
  72. 9 41
      target/linux/ar71xx/image/tp-link.mk
  73. 1 0
      target/linux/ar71xx/mikrotik/config-default
  74. 2 0
      target/linux/ar71xx/mikrotik/target.mk
  75. 1 0
      target/linux/ar71xx/nand/config-default
  76. 1 1
      target/linux/generic/patches-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
  77. 9 9
      target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
  78. 0 11
      target/linux/generic/patches-4.4/704-phy-no-genphy-soft-reset.patch
  79. 3 3
      target/linux/generic/patches-4.4/811-pci_disable_usb_common_quirks.patch
  80. 1 1
      target/linux/ramips/Makefile
  81. 9 6
      target/linux/ramips/base-files/etc/board.d/01_leds
  82. 34 10
      target/linux/ramips/base-files/etc/board.d/02_network
  83. 11 2
      target/linux/ramips/base-files/etc/diag.sh
  84. 16 4
      target/linux/ramips/base-files/lib/ramips.sh
  85. 5 1
      target/linux/ramips/base-files/lib/upgrade/platform.sh
  86. 1 0
      target/linux/ramips/base-files/sbin/fixup-mac-address
  87. 0 1
      target/linux/ramips/dts/3G150B.dts
  88. 0 1
      target/linux/ramips/dts/3G300M.dts
  89. 0 1
      target/linux/ramips/dts/A5-V11.dts
  90. 0 1
      target/linux/ramips/dts/AI-BR100.dts
  91. 0 1
      target/linux/ramips/dts/AIR3GII.dts
  92. 0 1
      target/linux/ramips/dts/ALL0256N-4M.dts
  93. 0 1
      target/linux/ramips/dts/ALL0256N-8M.dts
  94. 0 1
      target/linux/ramips/dts/ALL5002.dts
  95. 0 1
      target/linux/ramips/dts/ALL5003.dts
  96. 0 1
      target/linux/ramips/dts/ASL26555-16M.dts
  97. 0 1
      target/linux/ramips/dts/ASL26555-8M.dts
  98. 0 1
      target/linux/ramips/dts/AWAPN2403.dts
  99. 0 1
      target/linux/ramips/dts/AWM002-4M.dtsi
  100. 0 0
      target/linux/ramips/dts/AWM002-8M.dtsi

+ 1 - 1
include/feeds.mk

@@ -47,7 +47,7 @@ endef
 # 1: destination file
 define FeedSourcesAppend
 ( \
-  echo "src/gz %n_core %U/%S/packages"; \
+  echo "src/gz %n_core %U/targets/%S/packages"; \
   $(strip $(if $(CONFIG_PER_FEED_REPO), \
 	$(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/packages/%A/$(feed)";) \
 	$(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \

+ 2 - 2
include/image-commands.mk

@@ -7,7 +7,7 @@ define Build/uImage
 	mkimage -A $(LINUX_KARCH) \
 		-O linux -T kernel \
 		-C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-		-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new
+		-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) libreCMC Linux-$(LINUX_VERSION))' -d $@ $@.new
 	@mv $@.new $@
 endef
 
@@ -22,7 +22,7 @@ endef
 
 define Build/netgear-dni
 	$(STAGING_DIR_HOST)/bin/mkdniimg \
-		-B $(NETGEAR_BOARD_ID) -v LEDE.$(REVISION) \
+		-B $(NETGEAR_BOARD_ID) -v libreCMC.$(REVISION) \
 		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
 		-r "$(1)" \
 		-i $@ -o $@.new

+ 1 - 0
include/image-legacy.mk

@@ -48,6 +48,7 @@ endef
 ifdef TARGET_PER_DEVICE_ROOTFS
   define Image/Build/Profile/Filesystem
 	cp $(KDIR)/root.$(2)+pkg=$(3) $(KDIR)/root.$(2)
+	$(call Image/Build/$(2),$(2))
 	$(call Image/Build/Profile,$(1),$(2))
   endef
 else

+ 4 - 4
include/image.mk

@@ -137,7 +137,7 @@ endef
 
 define Image/BuildKernel/MkuImage
 	mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
-		-n '$(call toupper,$(ARCH)) LEDE Linux-$(LINUX_VERSION)' -d $(4) $(5)
+		-n '$(call toupper,$(ARCH)) libreCMC Linux-$(LINUX_VERSION)' -d $(4) $(5)
 endef
 
 define Image/BuildKernel/MkFIT
@@ -277,7 +277,7 @@ endif
 
 ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
   define Image/Build/cpiogz
-	( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
+	( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
   endef
 endif
 
@@ -420,7 +420,7 @@ define Device/Build/initramfs
   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
 	cp $$^ $$@
 
-  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
+  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
 	@rm -f $$@
 	$$(call concat_cmd,$$(KERNEL_INITRAMFS))
 endef
@@ -444,7 +444,7 @@ define Device/Build/kernel
     ifdef CONFIG_IB
       install: $$(KDIR_KERNEL_IMAGE)
     endif
-    $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
+    $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
 	@rm -f $$@
 	$$(call concat_cmd,$$(KERNEL))
 	$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))

+ 1 - 1
include/prereq-build.mk

@@ -20,7 +20,7 @@ $(eval $(call TestHostCommand,working-make, \
 	$(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'))
 
 $(eval $(call TestHostCommand,case-sensitive-fs, \
-	LEDE can only be built on a case-sensitive filesystem, \
+	libreCMC can only be built on a case-sensitive filesystem, \
 	rm -f $(TMP_DIR)/test.*; touch $(TMP_DIR)/test.fs; \
 		test ! -f $(TMP_DIR)/test.FS))
 

+ 3 - 2
include/toplevel.mk

@@ -23,6 +23,7 @@ HOSTCC ?= $(CC)
 export REVISION
 export SOURCE_DATE_EPOCH
 export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
+export GIT_ASKPASS:=/bin/true
 export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
 
 # prevent perforce from messing with the patch utility
@@ -126,7 +127,7 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
 	if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
 		cp $(HOME)/.openwrt/defconfig .config; \
 	fi
-	$< Config.in
+	[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; $< Config.in
 
 prepare_kernel_conf: .config FORCE
 
@@ -170,7 +171,7 @@ else
   DOWNLOAD_DIRS = package/download
 endif
 
-download: .config FORCE
+download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile)
 	@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
 
 clean dirclean: .config

+ 5 - 3
package/base-files/Makefile

@@ -11,14 +11,15 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=172
+PKG_RELEASE:=173.1
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=usign/host
 PKG_LICENSE:=GPL-2.0
 
-PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
+# Extend depends from version.mk
+PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,7 +32,7 @@ define Package/base-files
   SECTION:=base
   CATEGORY:=Base system
   DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:librecmc-keyring +fstools +fwtool
-  TITLE:=Base filesystem for libreCMC
+  TITLE:=Base filesystem for Lede
   URL:=http://openwrt.org/
   VERSION:=$(PKG_RELEASE)-$(REVISION)
 endef
@@ -137,6 +138,7 @@ define Package/base-files/install
 
 	mkdir -p $(1)/CONTROL
 	mkdir -p $(1)/dev
+	mkdir -p $(1)/etc/config
 	mkdir -p $(1)/etc/crontabs
 	mkdir -p $(1)/etc/rc.d
 	mkdir -p $(1)/overlay

+ 2 - 5
package/base-files/files/bin/config_generate

@@ -119,17 +119,14 @@ generate_network() {
 		;;
 
 		pppoe)
-			# fixup IPv6 slave interface
-			ifname="pppoe-$1"
-
 			uci -q batch <<-EOF
 				set network.$1.proto='pppoe'
 				set network.$1.username='username'
 				set network.$1.password='password'
-				set network.$1.ipv6='auto'
+				set network.$1.ipv6='1'
 				delete network.${1}6
 				set network.${1}6='interface'
-				set network.${1}6.ifname='$ifname'
+				set network.${1}6.ifname='@${1}'
 				set network.${1}6.proto='dhcpv6'
 			EOF
 		;;

+ 1 - 1
package/base-files/files/etc/init.d/system

@@ -7,7 +7,7 @@ USE_PROCD=1
 validate_system_section()
 {
 	uci_validate_section system system "${1}" \
-		'hostname:string:lede' \
+		'hostname:string:librecmc' \
 		'conloglevel:uinteger' \
 		'buffersize:uinteger' \
 		'timezone:string:UTC' \

+ 61 - 34
package/base-files/files/lib/functions/network.sh

@@ -29,18 +29,9 @@ network_get_ipaddr() {
 # 1: destination variable
 # 2: interface
 network_get_ipaddr6() {
-	local __addr
-
-	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][0].address"; then
-		case "$__addr" in
-			*:)	export "$1=${__addr}1" ;;
-			*)	export "$1=${__addr}" ;;
-		esac
-		return 0
-	fi
-
-	unset $1
-	return 1
+	__network_ifstatus "$1" "$2" "['ipv6-address'][0].address" || \
+		__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['local-address'].address" || \
+		return 1
 }
 
 # determine first IPv4 subnet of given logical interface
@@ -54,7 +45,36 @@ network_get_subnet() {
 # 1: destination variable
 # 2: interface
 network_get_subnet6() {
-	__network_ifstatus "$1" "$2" "['ipv6-address'][0]['address','mask']" "/"
+	local __nets __addr
+
+	if network_get_subnets6 __nets "$2"; then
+		# Attempt to return first non-fe80::/10, non-fc::/7 range
+		for __addr in $__nets; do
+			case "$__addr" in fe[8ab]?:*|f[cd]??:*)
+				continue
+			esac
+			export "$1=$__addr"
+			return 0
+		done
+
+		# Attempt to return first non-fe80::/10 range
+		for __addr in $__nets; do
+			case "$__addr" in fe[8ab]?:*)
+				continue
+			esac
+			export "$1=$__addr"
+			return 0
+		done
+
+		# Return first item
+		for __addr in $__nets; do
+			export "$1=$__addr"
+			return 0
+		done
+	fi
+
+	unset "$1"
+	return 1
 }
 
 # determine first IPv6 prefix of given logical interface
@@ -78,14 +98,19 @@ network_get_ipaddrs6() {
 	local __addr
 	local __list=""
 
-	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*].address"; then
+	if __network_ifstatus "__addr" "$2" "['ipv6-address'][*].address"; then
 		for __addr in $__addr; do
-			case "$__addr" in
-				*:) __list="${__list:+$__list }${__addr}1" ;;
-				*)  __list="${__list:+$__list }${__addr}"  ;;
-			esac
+			__list="${__list:+$__list }${__addr}"
+		done
+	fi
+
+	if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address"; then
+		for __addr in $__addr; do
+			__list="${__list:+$__list }${__addr}"
 		done
+	fi
 
+	if [ -n "$__list" ]; then
 		export "$1=$__list"
 		return 0
 	fi
@@ -98,18 +123,13 @@ network_get_ipaddrs6() {
 # 1: destination variable
 # 2: interface
 network_get_ipaddrs_all() {
-	local __addr
-	local __list=""
+	local __addr __addr6
 
-	if __network_ifstatus "__addr" "$2" "['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address"; then
-		for __addr in $__addr; do
-			case "$__addr" in
-				*:) __list="${__list:+$__list }${__addr}1" ;;
-				*)  __list="${__list:+$__list }${__addr}"  ;;
-			esac
-		done
+	network_get_ipaddrs __addr "$2"
+	network_get_ipaddrs6 __addr6 "$2"
 
-		export "$1=$__list"
+	if [ -n "$__addr" -o -n "$__addr6" ]; then
+		export "$1=${__addr:+$__addr }$__addr6"
 		return 0
 	fi
 
@@ -128,17 +148,24 @@ network_get_subnets() {
 # 1: destination variable
 # 2: interface
 network_get_subnets6() {
-	local __addr
+	local __addr __mask
 	local __list=""
 
-	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*]['address','mask']" "/ "; then
+	if __network_ifstatus "__addr" "$2" "['ipv6-address'][*]['address','mask']" "/ "; then
 		for __addr in $__addr; do
-			case "$__addr" in
-				*:/*) __list="${__list:+$__list }${__addr%/*}1/${__addr##*/}" ;;
-				*)    __list="${__list:+$__list }${__addr}"                   ;;
-			esac
+			__list="${__list:+$__list }${__addr}"
 		done
+	fi
+
+	if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address" && \
+	   __network_ifstatus "__mask" "$2" "['ipv6-prefix-assignment'][*].mask"; then
+		for __addr in $__addr; do
+			__list="${__list:+$__list }${__addr}/${__mask%% *}"
+			__mask="${__mask#* }"
+		done
+	fi
 
+	if [ -n "$__list" ]; then
 		export "$1=$__list"
 		return 0
 	fi

+ 21 - 1
package/base-files/files/lib/functions/uci-defaults.sh

@@ -35,7 +35,7 @@ _ucidef_set_interface() {
 	json_select_object "$name"
 	json_add_string ifname "$iface"
 
-	if ! json_is_a protocol string; then
+	if ! json_is_a protocol string || [ -n "$proto" ]; then
 		case "$proto" in
 			static|dhcp|none|pppoe) : ;;
 			*)
@@ -619,6 +619,26 @@ ucidef_add_gpio_switch() {
 	json_select ..
 }
 
+ucidef_set_hostname() {
+	local hostname="$1"
+
+	json_select_object system
+		json_add_string hostname "$hostname"
+	json_select ..
+}
+
+ucidef_set_ntpserver() {
+	local server
+
+	json_select_object system
+		json_select_array ntpserver
+			for server in "$@"; do
+				json_add_string "" "$server"
+			done
+		json_select ..
+	json_select ..
+}
+
 board_config_update() {
 	json_init
 	[ -f ${CFG} ] && json_load "$(cat ${CFG})"

+ 4 - 1
package/base-files/files/lib/preinit/10_indicate_preinit

@@ -96,6 +96,8 @@ preinit_config_board() {
 }
 
 preinit_ip() {
+	[ "$pi_preinit_no_failsafe" = "y" ] && return
+
 	# if the preinit interface isn't specified and ifname is set in
 	# preinit.arch use that interface
 	if [ -z "$pi_ifname" ]; then
@@ -107,6 +109,8 @@ preinit_ip() {
 	elif [ -d "/etc/board.d/" ]; then
 		preinit_config_board
 	fi
+
+	preinit_net_echo "Doing Lede Preinit\n"
 }
 
 preinit_ip_deconfig() {
@@ -146,7 +150,6 @@ preinit_echo() {
 }
 
 pi_indicate_preinit() {
-	preinit_net_echo "Doing Lede Preinit\n"
 	set_state preinit
 }
 

+ 1 - 1
package/base-files/files/usr/lib/os-release

@@ -1,7 +1,7 @@
 NAME="%D"
 VERSION="%V, %N"
 ID="%d"
-ID_LIKE="lede openwrt"
+ID_LIKE="librecmc openwrt"
 PRETTY_NAME="%D %N %V"
 VERSION_ID="%v"
 HOME_URL="%m"

+ 4 - 4
package/base-files/image-config.in

@@ -92,7 +92,7 @@ config TARGET_PREINIT_NETMASK
 config TARGET_PREINIT_BROADCAST
 	string
 	prompt "Broadcast address for preinit network messages" if PREINITOPT
-	default "192.168.1.255"
+	default "192.168.10.255"
 	help
 		Broadcast address to which to send preinit network messages, as
 		as failsafe messages
@@ -201,13 +201,13 @@ if VERSIONOPT
 			 %c .. Configured release revision code or value of %R, lowercase
 			 %N .. Release name, uppercase
 			 %n .. Release name, lowercase
-			 %D .. Distribution name or "Lede", uppercase
-			 %d .. Distribution name or "lede", lowercase
+			 %D .. Distribution name or "libreCMC", uppercase
+			 %d .. Distribution name or "librecmc", lowercase
 			 %T .. Target name
 			 %S .. Target/Subtarget name
 			 %A .. Package architecture
 			 %t .. Build taint flags, e.g. "no-all busybox"
-			 %M .. Manufacturer name or "Lede"
+			 %M .. Manufacturer name or "libreCMC"
 			 %P .. Product name or "Generic"
 			 %h .. Hardware revision or "v0"
 

+ 7 - 7
package/kernel/linux/modules/crypto.mk

@@ -436,7 +436,7 @@ endef
 
 define KernelPackage/crypto-md5/octeon
   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-md5.ko
-  AUTOLOAD:=$(call AutoLoad,09,octeon-md5)
+  AUTOLOAD+=$(call AutoLoad,09,octeon-md5)
 endef
 
 $(eval $(call KernelPackage,crypto-md5))
@@ -468,12 +468,12 @@ endef
 
 define KernelPackage/crypto-sha1/octeon
   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko
-  AUTOLOAD:=$(call AutoLoad,09,octeon-sha1)
+  AUTOLOAD+=$(call AutoLoad,09,octeon-sha1)
 endef
 
 define KernelPackage/crypto-sha1/x86/64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko
-  AUTOLOAD:=$(call AutoLoad,09,sha1-ssse3)
+  AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3)
 endef
 
 $(eval $(call KernelPackage,crypto-sha1))
@@ -493,12 +493,12 @@ endef
 
 define KernelPackage/crypto-sha256/octeon
   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko
-  AUTOLOAD:=$(call AutoLoad,09,octeon-sha256)
+  AUTOLOAD+=$(call AutoLoad,09,octeon-sha256)
 endef
 
 define KernelPackage/crypto-sha256/x86/64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko
-  AUTOLOAD:=$(call AutoLoad,09,sha256-ssse3)
+  AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3)
 endef
 
 $(eval $(call KernelPackage,crypto-sha256))
@@ -518,12 +518,12 @@ endef
 
 define KernelPackage/crypto-sha512/octeon
   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko
-  AUTOLOAD:=$(call AutoLoad,09,octeon-sha512)
+  AUTOLOAD+=$(call AutoLoad,09,octeon-sha512)
 endef
 
 define KernelPackage/crypto-sha512/x86/64
   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko
-  AUTOLOAD:=$(call AutoLoad,09,sha512-ssse3)
+  AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3)
 endef
 
 $(eval $(call KernelPackage,crypto-sha512))

+ 0 - 1
package/kernel/linux/modules/netdevices.mk

@@ -446,7 +446,6 @@ endef
 
 $(eval $(call KernelPackage,ne2k-pci))
 
-
 define KernelPackage/e1000
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Intel(R) PRO/1000 PCI cards kernel support

+ 2 - 2
package/kernel/linux/modules/netfilter.mk

@@ -360,8 +360,6 @@ define KernelPackage/nf-nathelper/description
  Default Netfilter (IPv4) Conntrack and NAT helpers
  Includes:
  - ftp
- - irc
- - tftp
 endef
 
 $(eval $(call KernelPackage,nf-nathelper))
@@ -381,11 +379,13 @@ define KernelPackage/nf-nathelper-extra/description
  Includes:
  - amanda
  - h323
+ - irc
  - mms
  - pptp
  - proto_gre
  - sip
  - snmp_basic
+ - tftp
  - broadcast
 endef
 

+ 1 - 1
package/kernel/linux/modules/sound.mk

@@ -67,7 +67,7 @@ define KernelPackage/sound-core/uml
   FILES:= \
 	$(LINUX_DIR)/sound/soundcore.ko \
 	$(LINUX_DIR)/arch/um/drivers/hostaudio.ko
-  AUTOLOAD:=$(call AutoLoad,30,soundcore hostaudio)
+  AUTOLOAD+=$(call AutoLoad,30,soundcore hostaudio)
 endef
 
 define KernelPackage/sound-core/description

+ 2 - 2
package/kernel/linux/modules/video.mk

@@ -47,7 +47,7 @@ define KernelPackage/backlight-pwm
 	AUTOLOAD:=$(call AutoProbe,video pwm_bl)
 endef
 
-define KernelPackage/backlight/backlight-pwm
+define KernelPackage/backlight-pwm/description
 	Kernel module for PWM based Backlight support.
 endef
 
@@ -72,7 +72,7 @@ endef
 
 define KernelPackage/fb/x86
   FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko
-  AUTOLOAD:=$(call AutoLoad,06,fbdev fb)
+  AUTOLOAD+=$(call AutoLoad,06,fbdev fb)
 endef
 
 $(eval $(call KernelPackage,fb))

+ 6 - 4
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

@@ -268,7 +268,7 @@ mac80211_hostapd_setup_base() {
 			vht_max_mpdu_hw=11454
 		[ "$vht_max_mpdu_hw" != 3895 ] && \
 			vht_capab="$vht_capab[MAX-MPDU-$vht_max_mpdu_hw]"
-			
+
 		# maximum A-MPDU length exponent
 		vht_max_a_mpdu_len_exp_hw=0
 		[ "$(($vht_cap & 58720256))" -ge 8388608 -a 1 -le "$vht_max_a_mpdu_len_exp" ] && \
@@ -566,7 +566,7 @@ mac80211_setup_adhoc() {
 	[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
 
 	iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \
-		${beacon_int:+beacon-interval $beacon_int} \
+		beacon-interval $beacon_int \
 		${brstr:+basic-rates $brstr} \
 		${mcval:+mcast-rate $mcval} \
 		${keyspec:+keys $keyspec}
@@ -646,7 +646,9 @@ mac80211_setup_vif() {
 				esac
 
 				freq="$(get_freq "$phy" "$channel")"
-				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode ${mcval:+mcast-rate $mcval}
+				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode \
+					${mcval:+mcast-rate $mcval} \
+					beacon-interval $beacon_int
 			fi
 
 			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
@@ -698,7 +700,7 @@ drv_mac80211_setup() {
 		country chanbw distance \
 		txpower antenna_gain \
 		rxantenna txantenna \
-		frag rts beacon_int htmode
+		frag rts beacon_int:100 htmode
 	json_get_values basic_rate_list basic_rate
 	json_select ..
 

+ 3 - 3
package/kernel/mac80211/files/lib/wifi/mac80211.sh

@@ -92,7 +92,7 @@ detect_mac80211() {
 			htmode="VHT80"
 		}
 
-		[ -n $htmode ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"
+		[ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"
 
 		if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then
 			path="$(readlink -f /sys/class/ieee80211/${dev}/device)"
@@ -123,8 +123,8 @@ detect_mac80211() {
 			set wireless.default_radio${devidx}.network=lan
 			set wireless.default_radio${devidx}.mode=ap
 			set wireless.default_radio${devidx}.ssid=libreCMC
-			set wireless.default_radio${devidx}.encryption=psk
-			set wireless.default_radio${devidx}.key=librecmc
+                        set wireless.default_radio${devidx}.encryption=psk
+                        set wireless.default_radio${devidx}.key=librecmc
 EOF
 		uci -q commit wireless
 

+ 0 - 10
package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch

@@ -1,10 +0,0 @@
---- a/drivers/net/wireless/marvell/mwl8k.c
-+++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5681,6 +5681,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
- MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
- 
- static const struct pci_device_id mwl8k_pci_id_table[] = {
-+	{ PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
- 	{ PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
- 	{ PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, },
- 	{ PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, },

+ 0 - 20
package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch

@@ -1,20 +0,0 @@
---- a/drivers/net/wireless/marvell/mwl8k.c
-+++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6264,6 +6264,8 @@ static int mwl8k_probe(struct pci_dev *p
- 
- 	priv->running_bsses = 0;
- 
-+	wait_for_completion(&priv->firmware_loading_complete);
-+
- 	return rc;
- 
- err_stop_firmware:
-@@ -6297,8 +6299,6 @@ static void mwl8k_remove(struct pci_dev
- 		return;
- 	priv = hw->priv;
- 
--	wait_for_completion(&priv->firmware_loading_complete);
--
- 	if (priv->fw_state == FW_STATE_ERROR) {
- 		mwl8k_hw_reset(priv);
- 		goto unmap;

+ 3 - 3
package/libs/mbedtls/Makefile

@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mbedtls
-PKG_VERSION:=2.5.1
-PKG_RELEASE:=2
+PKG_VERSION:=2.6.0
+PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
 PKG_SOURCE_URL:=https://tls.mbed.org/download/
-PKG_HASH:=312f020006f0d8e9ede3ed8e73d907a629baf6475229703941769372ab0adee2
+PKG_HASH:=a99959d7360def22f9108d2d487c9de384fe76c349697176b1f22370080d5810
 
 PKG_BUILD_PARALLEL:=1
 PKG_LICENSE:=GPL-2.0+

+ 27 - 27
package/libs/mbedtls/patches/200-config.patch

@@ -1,6 +1,6 @@
 --- a/include/mbedtls/config.h
 +++ b/include/mbedtls/config.h
-@@ -191,7 +191,7 @@
+@@ -220,7 +220,7 @@
   *
   * Uncomment to get errors on using deprecated functions.
   */
@@ -9,7 +9,7 @@
  
  /* \} name SECTION: System support */
  
-@@ -504,17 +504,17 @@
+@@ -539,17 +539,17 @@
   *
   * Comment macros to disable the curve and functions for it
   */
@@ -35,7 +35,7 @@
  #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
  
  /**
-@@ -539,8 +539,8 @@
+@@ -574,8 +574,8 @@
   * Requires: MBEDTLS_HMAC_DRBG_C
   *
   * Comment this macro to disable deterministic ECDSA.
@@ -45,7 +45,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
-@@ -586,7 +586,7 @@
+@@ -621,7 +621,7 @@
   *      MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
   *      MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
   */
@@ -54,7 +54,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
-@@ -605,8 +605,8 @@
+@@ -640,8 +640,8 @@
   *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
   *      MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
   *      MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
@@ -64,7 +64,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
-@@ -631,7 +631,7 @@
+@@ -666,7 +666,7 @@
   *      MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
   *      MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
   */
@@ -73,7 +73,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
-@@ -758,7 +758,7 @@
+@@ -793,7 +793,7 @@
   *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
   *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
   */
@@ -82,7 +82,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
-@@ -782,7 +782,7 @@
+@@ -817,7 +817,7 @@
   *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
   *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
   */
@@ -91,7 +91,7 @@
  
  /**
   * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
-@@ -886,7 +886,7 @@
+@@ -921,7 +921,7 @@
   * This option is only useful if both MBEDTLS_SHA256_C and
   * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
   */
@@ -100,7 +100,7 @@
  
  /**
   * \def MBEDTLS_ENTROPY_NV_SEED
-@@ -980,14 +980,14 @@
+@@ -1015,14 +1015,14 @@
   * Uncomment this macro to disable the use of CRT in RSA.
   *
   */
@@ -117,7 +117,7 @@
  
  /**
   * \def MBEDTLS_SHA256_SMALLER
-@@ -1003,7 +1003,7 @@
+@@ -1038,7 +1038,7 @@
   *
   * Uncomment to enable the smaller implementation of SHA256.
   */
@@ -126,7 +126,7 @@
  
  /**
   * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
-@@ -1122,8 +1122,8 @@
+@@ -1157,8 +1157,8 @@
   * misuse/misunderstand.
   *
   * Comment this to disable support for renegotiation.
@@ -136,7 +136,7 @@
  
  /**
   * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
-@@ -1297,8 +1297,8 @@
+@@ -1332,8 +1332,8 @@
   * callbacks are provided by MBEDTLS_SSL_TICKET_C.
   *
   * Comment this macro to disable support for SSL session tickets
@@ -146,7 +146,7 @@
  
  /**
   * \def MBEDTLS_SSL_EXPORT_KEYS
-@@ -1328,7 +1328,7 @@
+@@ -1363,7 +1363,7 @@
   *
   * Comment this macro to disable support for truncated HMAC in SSL
   */
@@ -155,7 +155,7 @@
  
  /**
   * \def MBEDTLS_THREADING_ALT
-@@ -1362,8 +1362,8 @@
+@@ -1397,8 +1397,8 @@
   * Requires: MBEDTLS_VERSION_C
   *
   * Comment this to disable run-time checking and save ROM space
@@ -165,7 +165,7 @@
  
  /**
   * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
-@@ -1684,7 +1684,7 @@
+@@ -1719,7 +1719,7 @@
   *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
   *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
   */
@@ -174,7 +174,7 @@
  
  /**
   * \def MBEDTLS_CCM_C
-@@ -1698,7 +1698,7 @@
+@@ -1733,7 +1733,7 @@
   * This module enables the AES-CCM ciphersuites, if other requisites are
   * enabled as well.
   */
@@ -183,7 +183,7 @@
  
  /**
   * \def MBEDTLS_CERTS_C
-@@ -1710,7 +1710,7 @@
+@@ -1745,7 +1745,7 @@
   *
   * This module is used for testing (ssl_client/server).
   */
@@ -192,7 +192,7 @@
  
  /**
   * \def MBEDTLS_CIPHER_C
-@@ -1763,7 +1763,7 @@
+@@ -1798,7 +1798,7 @@
   *
   * This module provides debugging functions.
   */
@@ -201,7 +201,7 @@
  
  /**
   * \def MBEDTLS_DES_C
-@@ -1788,8 +1788,8 @@
+@@ -1823,8 +1823,8 @@
   *      MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
   *
   * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
@@ -211,7 +211,7 @@
  
  /**
   * \def MBEDTLS_DHM_C
-@@ -1943,8 +1943,8 @@
+@@ -1978,8 +1978,8 @@
   * Requires: MBEDTLS_MD_C
   *
   * Uncomment to enable the HMAC_DRBG random number geerator.
@@ -221,7 +221,7 @@
  
  /**
   * \def MBEDTLS_MD_C
-@@ -2221,7 +2221,7 @@
+@@ -2256,7 +2256,7 @@
   * Caller:  library/md.c
   *
   */
@@ -230,7 +230,7 @@
  
  /**
   * \def MBEDTLS_RSA_C
-@@ -2299,8 +2299,8 @@
+@@ -2334,8 +2334,8 @@
   * Caller:
   *
   * Requires: MBEDTLS_SSL_CACHE_C
@@ -240,7 +240,7 @@
  
  /**
   * \def MBEDTLS_SSL_COOKIE_C
-@@ -2321,8 +2321,8 @@
+@@ -2356,8 +2356,8 @@
   * Caller:
   *
   * Requires: MBEDTLS_CIPHER_C
@@ -250,7 +250,7 @@
  
  /**
   * \def MBEDTLS_SSL_CLI_C
-@@ -2421,8 +2421,8 @@
+@@ -2456,8 +2456,8 @@
   * Module:  library/version.c
   *
   * This module provides run-time version information.
@@ -260,7 +260,7 @@
  
  /**
   * \def MBEDTLS_X509_USE_C
-@@ -2532,7 +2532,7 @@
+@@ -2567,7 +2567,7 @@
   * Module:  library/xtea.c
   * Caller:
   */
@@ -269,7 +269,7 @@
  
  /* \} name SECTION: mbed TLS modules */
  
-@@ -2646,7 +2646,7 @@
+@@ -2681,7 +2681,7 @@
   * recommended because of it is possible to generte SHA-1 collisions, however
   * this may be safe for legacy infrastructure where additional controls apply.
   */

+ 1 - 1
package/network/config/gre/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gre
 PKG_VERSION:=1
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk

+ 1 - 1
package/network/config/gre/files/gre.sh

@@ -25,7 +25,7 @@ gre_generic_setup() {
 	json_add_string mode "$mode"
 	json_add_int mtu "${mtu:-1280}"
 	[ -n "$df" ] && json_add_boolean df "$df"
-	[ -n "ttl" ] && json_add_int ttl "$ttl"
+	[ -n "$ttl" ] && json_add_int ttl "$ttl"
 	[ -n "$tos" ] && json_add_string tos "$tos"
 	json_add_boolean multicast "$multicast"
 	json_add_string local "$local"

+ 3 - 13
package/network/services/dnsmasq/Makefile

@@ -37,7 +37,6 @@ define Package/dnsmasq/Default
   CATEGORY:=Base system
   TITLE:=DNS and DHCP server
   URL:=http://www.thekelleys.org.uk/dnsmasq/
-  DEPENDS:=+libubus
   USERID:=dnsmasq=453:dnsmasq=453
 endef
 
@@ -49,14 +48,14 @@ endef
 define Package/dnsmasq-dhcpv6
 $(call Package/dnsmasq/Default)
   TITLE += (with DHCPv6 support)
-  DEPENDS+=@IPV6
+  DEPENDS:=@IPV6
   VARIANT:=dhcpv6
 endef
 
 define Package/dnsmasq-full
 $(call Package/dnsmasq/Default)
   TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default)
-  DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \
+  DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \
 	+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \
 	+PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack
   VARIANT:=full
@@ -138,7 +137,7 @@ endif
 
 MAKE_FLAGS := \
 	$(TARGET_CONFIGURE_OPTS) \
-	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
 	COPTS="$(COPTS)" \
 	PREFIX="/usr"
@@ -151,17 +150,8 @@ define Package/dnsmasq/install
 	$(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
 	$(INSTALL_DIR) $(1)/etc/init.d
 	$(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
-	$(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp
-	$(INSTALL_DIR) $(1)/etc/hotplug.d/neigh
 	$(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
-	$(INSTALL_DIR) $(1)/etc/hotplug.d/tftp
 	$(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec
-	$(INSTALL_DIR) $(1)/usr/share/dnsmasq
-	$(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/
-	$(INSTALL_DIR) $(1)/usr/lib/dnsmasq
-	$(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh
-	$(INSTALL_DIR) $(1)/usr/share/acl.d
-	$(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/
 endef
 
 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)

+ 0 - 46
package/network/services/dnsmasq/files/dhcp-script.sh

@@ -1,46 +0,0 @@
-#!/bin/sh
-
-[ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@"
-
-case "$1" in
-	add)
-		export ACTION="add"
-		export MACADDR="$2"
-		export IPADDR="$3"
-		export HOSTNAME="$4"
-		exec /sbin/hotplug-call dhcp
-	;;
-	del)
-		export ACTION="remove"
-		export MACADDR="$2"
-		export IPADDR="$3"
-		export HOSTNAME="$4"
-		exec /sbin/hotplug-call dhcp
-	;;
-	old)
-		export ACTION="update"
-		export MACADDR="$2"
-		export IPADDR="$3"
-		export HOSTNAME="$4"
-		exec /sbin/hotplug-call dhcp
-	;;
-	arp-add)
-		export ACTION="add"
-		export MACADDR="$2"
-		export IPADDR="$3"
-		exec /sbin/hotplug-call neigh
-	;;
-	arp-del)
-		export ACTION="remove"
-		export MACADDR="$2"
-		export IPADDR="$3"
-		exec /sbin/hotplug-call neigh
-	;;
-	tftp)
-		export ACTION="add"
-		export TFTP_SIZE="$2"
-		export TFTP_ADDR="$3"
-		export TFTP_PATH="$4"
-		exec /sbin/hotplug-call tftp
-	;;
-esac

+ 1 - 1
package/network/services/dnsmasq/files/dhcp.conf

@@ -15,7 +15,7 @@ config dnsmasq
 	option leasefile	'/tmp/dhcp.leases'
 	option resolvfile	'/tmp/resolv.conf.auto'
 	#list server		'/mycompany.local/1.2.3.4'
-	option nonwildcard	1 # bind to & keep track of interfaces
+	#option nonwildcard	1
 	#list interface		br-lan
 	#list notinterface	lo
 	#list bogusnxdomain     '64.94.110.11'

+ 67 - 304
package/network/services/dnsmasq/files/dnsmasq.init

@@ -8,8 +8,6 @@ PROG=/usr/sbin/dnsmasq
 
 ADD_LOCAL_DOMAIN=1
 ADD_LOCAL_HOSTNAME=1
-ADD_WAN_FQDN=0
-ADD_LOCAL_FQDN=""
 
 BASECONFIGFILE="/var/etc/dnsmasq.conf"
 BASEHOSTFILE="/tmp/hosts/dhcp"
@@ -17,10 +15,6 @@ BASETIMESTAMPFILE="/etc/dnsmasq.time"
 TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf"
 TIMEVALIDFILE="/var/state/dnsmasqsec"
 BASEDHCPSTAMPFILE="/var/run/dnsmasq"
-RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf"
-DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh"
-
-DNSMASQ_DHCP_VER=4
 
 xappend() {
 	local value="$1"
@@ -89,24 +83,12 @@ log_once() {
 		logger -t dnsmasq "$@"
 }
 
-has_handler() {
-	local file
-
-	for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do
-		[ -f "$file" ] && return 0
-	done
-
-	return 1
-}
-
 append_bool() {
 	local section="$1"
 	local option="$2"
 	local value="$3"
-	local default="$4"
 	local _loctmp
-	[ -z "$default" ] && default="0"
-	config_get_bool _loctmp "$section" "$option" "$default"
+	config_get_bool _loctmp "$section" "$option" 0
 	[ $_loctmp -gt 0 ] && xappend "$value"
 }
 
@@ -125,10 +107,6 @@ append_server() {
 	xappend "--server=$1"
 }
 
-append_rev_server() {
-        xappend "--rev-server=$1"
-}
-
 append_address() {
 	xappend "--address=$1"
 }
@@ -138,12 +116,12 @@ append_ipset() {
 }
 
 append_interface() {
-	network_get_device ifname "$1" || ifname="$1"
+	network_get_device ifname "$1" || return
 	xappend "--interface=$ifname"
 }
 
 append_notinterface() {
-	network_get_device ifname "$1" || ifname="$1"
+	network_get_device ifname "$1" || return
 	xappend "--except-interface=$ifname"
 }
 
@@ -159,10 +137,6 @@ append_pxe_service() {
 	xappend "--pxe-service=$1"
 }
 
-append_interface_name() {
-	xappend "--interface-name=$1,$2"
-}
-
 filter_dnsmasq() {
 	local cfg="$1" func="$2" match_cfg="$3" found_cfg
 
@@ -206,7 +180,6 @@ dhcp_remoteid_add() {
 }
 
 dhcp_circuitid_add() {
-	# TODO: DHCPV6 does not have circuitid; catch "option6:"
 	local cfg="$1"
 
 	config_get networkid "$cfg" networkid
@@ -239,7 +212,6 @@ dhcp_userclass_add() {
 }
 
 dhcp_vendorclass_add() {
-	# TODO: DHCPV6 vendor class has stricter definitions; catch? fixup?
 	local cfg="$1"
 
 	config_get networkid "$cfg" networkid
@@ -273,7 +245,6 @@ dhcp_match_add() {
 
 dhcp_host_add() {
 	local cfg="$1"
-	local hosttag nametime addrs duids
 
 	config_get_bool force "$cfg" force 0
 
@@ -285,9 +256,7 @@ dhcp_host_add() {
 
 	config_get name "$cfg" name
 	config_get ip "$cfg" ip
-	config_get hostid "$cfg" hostid
-
-	[ -n "$ip" -o -n "$name" -o -n "$hostid" ] || return 0
+	[ -n "$ip" -o -n "$name" ] || return 0
 
 	config_get_bool dns "$cfg" dns 0
 	[ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && {
@@ -295,105 +264,36 @@ dhcp_host_add() {
 	}
 
 	config_get mac "$cfg" mac
-	config_get duid "$cfg" duid
-	config_get tag "$cfg" tag
-
 	if [ -n "$mac" ]; then
 		# --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap
-		# many MAC are possible to track a laptop ON/OFF dock
 		macs=""
 		for m in $mac; do append macs "$m" ","; done
-	fi
-
-	if [ $DNSMASQ_DHCP_VER -eq 6 -a -n "$duid" ]; then
-		# --dhcp-host=id:00:03:00:01:12:00:00:01:02:03,[::beef],lap
-		# one (virtual) machine gets one DUID per RFC3315
-		duids="id:${duid// */}"
-	fi
-
-	if [ -z "$macs" -a -z "$duids" ]; then
-		# --dhcp-host=lap,192.168.0.199,[::beef]
+	else
+		# --dhcp-host=lap,192.168.0.199
 		[ -n "$name" ] || return 0
 		macs="$name"
 		name=""
 	fi
 
-	if [ -n "$hostid" ]; then
-		hex_to_hostid hostid "$hostid"
-	fi
+	config_get tag "$cfg" tag
 
-	tags=""
-	if [ -n "$tag" ]; then
-		for t in $tag; do append tags "$t" ",set:"; done
+	if [ "$DHCPv6CAPABLE" -eq 1 ]; then
+		config_get duid "$cfg" duid
+		config_get hostid "$cfg" hostid
+		if [ -n "$hostid" ]; then
+			hex_to_hostid hostid "$hostid"
+		fi
 	fi
 
 	config_get_bool broadcast "$cfg" broadcast 0
-	config_get leasetime "$cfg" leasetime
-
-	[ "$broadcast" = "0" ] && broadcast= || broadcast=",set:needs-broadcast"
+	[ "$broadcast" = "0" ] && broadcast=
 
-	hosttag="${networkid:+,set:${networkid}}${tags:+,set:${tags}}$broadcast"
-	nametime="${name:+,$name}${leasetime:+,$leasetime}"
-
-	if [ $DNSMASQ_DHCP_VER -eq 6 ]; then
-		addrs="${ip:+,$ip}${hostid:+,[::$hostid]}"
-		xappend "--dhcp-host=$macs${duids:+,$duids}$hosttag$addrs$nametime"
-	else
-		xappend "--dhcp-host=$macs$hosttag${ip:+,$ip}$nametime"
-	fi
-}
-
-dhcp_this_host_add() {
-	local net="$1"
-	local ifname="$2"
-	local mode="$3"
-	local routerstub routername ifdashname
-	local lanaddr lanaddr6 lanaddrs6 ulaprefix
-
-	if [ "$mode" -gt 0 ] ; then
-		ifdashname="${ifname//./-}"
-		routerstub="$( md5sum /etc/os-release )"
-		routerstub="router-${routerstub// */}"
-		routername="$( uci_get system @system[0] hostname $routerstub )"
-
-		if [ "$mode" -gt 1 ] ; then
-			if [ "$mode" -gt 2 ] ; then
-				if [ "$mode" -gt 3 ] ; then
-					append_interface_name "$ifdashname.$routername.$DOMAIN" "$ifname"
-				fi
-
-				append_interface_name "$routername.$DOMAIN" "$ifname"
-			fi
-
-			# All IP addresses discovered by dnsmasq will be labeled (except fe80::)
-			append_interface_name "$routername" "$ifname"
-
-		else
-			# This uses a static host file entry for only limited addresses.
-			# Use dnsmasq option "--expandhosts" to enable FQDN on host files.
-			ulaprefix="$(uci_get network @globals[0] ula_prefix)"
-			network_get_ipaddr lanaddr "$net"
-			network_get_ipaddrs6 lanaddrs6 "$net"
-
-			if [ -n "$lanaddr" ] ; then
-				dhcp_domain_add "" "$routername" "$lanaddr"
-			fi
+	config_get leasetime "$cfg" leasetime
 
-			if [ -n "$ulaprefix" -a -n "$lanaddrs6" ] ; then
-				for lanaddr6 in $lanaddrs6 ; do
-					case "$lanaddr6" in
-					"${ulaprefix%%:/*}"*)
-						dhcp_domain_add "" "$routername" "$lanaddr6"
-						;;
-					esac
-				done
-			fi
-		fi
-	fi
+	xappend "--dhcp-host=$macs${duid:+,id:$duid}${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}"
 }
 
 dhcp_tag_add() {
-	# NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions
 	local cfg="$1"
 
 	tag="$cfg"
@@ -424,7 +324,6 @@ dhcp_mac_add() {
 }
 
 dhcp_boot_add() {
-	# TODO: BOOTURL is different between DHCPv4 and DHCPv6
 	local cfg="$1"
 
 	config_get networkid "$cfg" networkid
@@ -447,30 +346,24 @@ dhcp_boot_add() {
 
 dhcp_add() {
 	local cfg="$1"
-	local dhcp6range="::"
-	local nettag
-	local tags
-
 	config_get net "$cfg" interface
 	[ -n "$net" ] || return 0
 
+	config_get dhcpv4 "$cfg" dhcpv4
+	[ "$dhcpv4" != "disabled" ] || return 0
+
 	config_get networkid "$cfg" networkid
 	[ -n "$networkid" ] || networkid="$net"
 
+	network_get_subnet subnet "$net" || return 0
 	network_get_device ifname "$net" || return 0
+	network_get_protocol proto "$net" || return 0
 
 	[ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && {
 		DNS_SERVERS="$DNS_SERVERS $dnsserver"
 	}
 
-	append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && {
-		# Many ISP do not have useful names for DHCP customers (your WAN).
-		dhcp_this_host_add "$net" "$ifname" "$ADD_WAN_FQDN"
-		return 0
-	}
-
-	network_get_subnet subnet "$net" || return 0
-	network_get_protocol proto "$net" || return 0
+	append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0
 
 	# Do not support non-static interfaces for now
 	[ static = "$proto" ] || return 0
@@ -482,107 +375,21 @@ dhcp_add() {
 	config_get_bool force "$cfg" force 0
 	[ $force -gt 0 ] || dhcp_check "$ifname" || return 0
 
-	config_get start "$cfg" start 100
-	config_get limit "$cfg" limit 150
-	config_get leasetime "$cfg" leasetime 12h
+	config_get start "$cfg" start
+	config_get limit "$cfg" limit
+	config_get leasetime "$cfg" leasetime
 	config_get options "$cfg" options
 	config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1
 
-	config_get dhcpv4 "$cfg" dhcpv4
-	config_get dhcpv6 "$cfg" dhcpv6
-
-	config_get ra "$cfg" ra
-	config_get ra_management "$cfg" ra_management
-	config_get ra_preference "$cfg" ra_preference
-	config_get dns "$cfg" dns
-
-	config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname"
-
-	# Put the router host name on this DHCP served interface address(es)
-	dhcp_this_host_add "$net" "$ifname" "$ADD_LOCAL_FQDN"
-
-	start="$( dhcp_calc "$start" )"
-
-	add_tag() {
-		tags="${tags}tag:$1,"
-	}
-	config_list_foreach "$cfg" tag add_tag
-
-	nettag="${networkid:+set:${networkid},}"
-
-	if [ "$limit" -gt 0 ] ; then
-		limit=$((limit-1))
-	fi
-
+	leasetime="${leasetime:-12h}"
+	start="$(dhcp_calc "${start:-100}")"
+	limit="${limit:-150}"
+	[ "$limit" -gt 0 ] && limit=$((limit-1))
 	eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)"
+	if [ "$dynamicdhcp" = "0" ]; then END="static"; fi
+	xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}"
 
-	if [ "$dynamicdhcp" = "0" ] ; then
-		END="static"
-		dhcp6range="::,static"
-	else
-		dhcp6range="::1000,::ffff"
-	fi
-
-
-	if [ "$dhcpv4" != "disabled" ] ; then
-		xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
-	fi
-
-
-	if [ $DNSMASQ_DHCP_VER -eq 6 -a "$ra" = "server" ] ; then
-		# Note: dnsmasq cannot just be a DHCPv6 server (all-in-1)
-		# and let some other machine(s) send RA pointing to it.
-
-		case $ra_preference in
-		*high*)
-			xappend "--ra-param=$ifname,high,0,7200"
-			;;
-		*low*)
-			xappend "--ra-param=$ifname,low,0,7200"
-			;;
-		*)
-			# Send UNSOLICITED RA at default interval and live for 2 hours.
-			# TODO: convert flexible lease time into route life time (only seconds).
-			xappend "--ra-param=$ifname,0,7200"
-			;;
-		esac
-
-		if [ "$dhcpv6" = "disabled" ] ; then
-			ra_management="3"
-		fi
-
-
-		case $ra_management in
-		0)
-			# SLACC with DCHP for extended options
-			xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-stateless,ra-names"
-			;;
-		2)
-			# DHCP address and RA only for management redirection
-			xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,$leasetime"
-			;;
-		3)
-			# SLAAC only but dnsmasq attempts to link HOSTNAME, DHCPv4 MAC, and SLAAC
-			xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-only,ra-names"
-			;;
-		*)
-			# SLAAC and full DHCP
-			xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,slaac,ra-names,$leasetime"
-			;;
-		esac
-
-		if [ -n "$dns" ]; then
-			dnss=""
-			for d in $dns; do append dnss "[$d]" ","; done
-		else
-			dnss="[::]"
-		fi
-
-		dhcp_option_append "option6:dns-server,$dnss" "$networkid"
-	fi
-
-	dhcp_option_add "$cfg" "$networkid" 0
-	dhcp_option_add "$cfg" "$networkid" 2
+	dhcp_option_add "$cfg" "$networkid"
 }
 
 dhcp_option_append() {
@@ -594,24 +401,21 @@ dhcp_option_append() {
 }
 
 dhcp_option_add() {
-	# NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions
 	local cfg="$1"
 	local networkid="$2"
 	local force="$3"
-	local opt="dhcp_option"
 
 	[ "$force" = "0" ] && force=
-	[ "$force" = "2" ] && opt="dhcp_option_force"
 
 	local list_len
-	config_get list_len "$cfg" "${opt}_LENGTH"
+	config_get list_len "$cfg" dhcp_option_LENGTH
 
 	if [ -n "$list_len" ]; then
-		config_list_foreach "$cfg" "$opt" dhcp_option_append "$networkid" "$force"
+		config_list_foreach "$cfg" dhcp_option dhcp_option_append "$networkid" "$force"
 	else
-		config_get dhcp_option "$cfg" "$opt"
+		config_get dhcp_option "$cfg" dhcp_option
 
-		[ -n "$dhcp_option" ] && echo "Warning: the 'option $opt' syntax is deprecated, use 'list $opt'" >&2
+		[ -n "$dhcp_option" ] && echo "Warning: the 'option dhcp_option' syntax is deprecated, use 'list dhcp_option'" >&2
 
 		local option
 		for option in $dhcp_option; do
@@ -729,7 +533,7 @@ dhcp_relay_add() {
 
 dnsmasq_start()
 {
-	local cfg="$1" disabled resolvfile user_dhcpscript
+	local cfg="$1" disabled
 
 	config_get_bool disabled "$cfg" disabled 0
 	[ "$disabled" -gt 0 ] && return 0
@@ -762,41 +566,6 @@ dnsmasq_start()
 
 	$PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0
 
-
-	if [ -x /usr/sbin/odhcpd -a -x /etc/init.d/odhcpd ] ; then
-		local odhcpd_is_main odhcpd_is_enabled
-		config_get odhcpd_is_main odhcpd maindhcp 0
-		/etc/init.d/odhcpd enabled && odhcpd_is_enabled=1 || odhcpd_is_enabled=0
-
-
-		if [ "$odhcpd_is_enabled" -eq 0 -a "$DHCPv6CAPABLE" -eq 1 ] ; then
-			# DHCP V4 and V6 in DNSMASQ
-			DNSMASQ_DHCP_VER=6
-		elif [ "$odhcpd_is_main" -gt 0 ] ; then
-			# ODHCPD is doing it all
-			DNSMASQ_DHCP_VER=0
-		else
-			# You have ODHCPD but use DNSMASQ for DHCPV4
-			DNSMASQ_DHCP_VER=4
-		fi
-
-	elif [ "$DHCPv6CAPABLE" -eq 1 ] ; then
-		# DHCP V4 and V6 in DNSMASQ
-		DNSMASQ_DHCP_VER=6
-	else
-		DNSMASQ_DHCP_VER=4
-	fi
-
-	# Allow DHCP/DHCPv6 to be handled by ISC DHCPD
-	if [ -x /usr/sbin/dhcpd ] ; then
-		if [ -x /etc/init.d/dhcpd ] ; then
-			/etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0
-		fi
-		if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
-			/etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4
-		fi
-	fi
-
 	append_bool "$cfg" authoritative "--dhcp-authoritative"
 	append_bool "$cfg" nodaemon "--no-daemon"
 	append_bool "$cfg" domainneeded "--domain-needed"
@@ -809,11 +578,12 @@ dnsmasq_start()
 	append_bool "$cfg" localise_queries "--localise-queries"
 	append_bool "$cfg" readethers "--read-ethers"
 	append_bool "$cfg" dbus "--enable-dbus"
+	append_bool "$cfg" boguspriv "--bogus-priv"
 	append_bool "$cfg" expandhosts "--expand-hosts"
 	config_get tftp_root "$cfg" "tftp_root"
 	[ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
 	append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
-	append_bool "$cfg" nonwildcard "--bind-dynamic" 1
+	append_bool "$cfg" nonwildcard "--bind-dynamic"
 	append_bool "$cfg" fqdn "--dhcp-fqdn"
 	append_bool "$cfg" proxydnssec "--proxy-dnssec"
 	append_bool "$cfg" localservice "--local-service"
@@ -824,7 +594,7 @@ dnsmasq_start()
 	append_bool "$cfg" noping "--no-ping"
 
 	append_parm "$cfg" logfacility "--log-facility"
-
+	append_parm "$cfg" dhcpscript "--dhcp-script"
 	append_parm "$cfg" cachesize "--cache-size"
 	append_parm "$cfg" dnsforwardmax "--dns-forward-max"
 	append_parm "$cfg" port "--port"
@@ -836,7 +606,6 @@ dnsmasq_start()
 	append_parm "$cfg" "domain" "--domain"
 	append_parm "$cfg" "local" "--server"
 	config_list_foreach "$cfg" "server" append_server
-	config_list_foreach "$cfg" "rev_server" append_rev_server
 	config_list_foreach "$cfg" "address" append_address
 	config_list_foreach "$cfg" "ipset" append_ipset
 	config_list_foreach "$cfg" "interface" append_interface
@@ -844,6 +613,7 @@ dnsmasq_start()
 	config_list_foreach "$cfg" "addnhosts" append_addnhosts
 	config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
 	append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
+	append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto"
 	append_parm "$cfg" "serversfile" "--servers-file"
 	append_parm "$cfg" "tftp_root" "--tftp-root"
 	append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
@@ -854,21 +624,12 @@ dnsmasq_start()
 
 	config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1
 	config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1
-	config_get ADD_LOCAL_FQDN "$cfg" add_local_fqdn ""
-	config_get ADD_WAN_FQDN "$cfg" add_wan_fqdn 0
-
-	if [ -z "$ADD_LOCAL_FQDN" ] ; then
-		# maintain support for previous UCI
-		ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME"
-	fi
 
 	config_get_bool readethers "$cfg" readethers
 	[ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
 
-	config_get user_dhcpscript $cfg dhcpscript
-	if has_handler || [ -n "$user_dhcpscript" ]; then
-		xappend "--dhcp-script=$DHCPSCRIPT"
-	fi
+	config_get resolvfile $cfg resolvfile
+	config_get dhcpscript $cfg dhcpscript
 
 	config_get leasefile $cfg leasefile "/tmp/dhcp.leases"
 	[ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
@@ -881,8 +642,6 @@ dnsmasq_start()
 		[ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile"
 	fi
 
-	[ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
-
 	config_get hostsfile "$cfg" dhcphostsfile
 	[ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
 
@@ -929,7 +688,6 @@ dnsmasq_start()
 	}
 
 	dhcp_option_add "$cfg" "" 0
-	dhcp_option_add "$cfg" "" 2
 
 	xappend "--dhcp-broadcast=tag:needs-broadcast"
 
@@ -963,31 +721,37 @@ dnsmasq_start()
 	config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg"
 	config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg"
 
+	# add own hostname
+	[ $ADD_LOCAL_HOSTNAME -eq 1 ] && {
+		local lanaddr lanaddr6
+		local ulaprefix="$(uci_get network @globals[0] ula_prefix)"
+		local hostname="$(uci_get system @system[0] hostname Lede)"
+
+		network_get_ipaddr lanaddr "lan" && {
+			dhcp_domain_add "" "$hostname" "$lanaddr"
+		}
+
+		[ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && {
+			for lanaddr6 in $lanaddr6; do
+				case "$lanaddr6" in
+					"${ulaprefix%%:/*}"*)
+						dhcp_domain_add "" "$hostname" "$lanaddr6"
+					;;
+				esac
+			done
+		}
+	}
+
 	echo >> $CONFIGFILE_TMP
 	config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg"
 	config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg"
 	echo >> $CONFIGFILE_TMP
 
-	config_get_bool boguspriv "$cfg" boguspriv 1
-	[ "$boguspriv" -gt 0 ] && {
-		xappend "--bogus-priv"
-		[ -r "$RFC6761FILE" ] && xappend "--conf-file=$RFC6761FILE"
-	}
-
-	if [ "$DNSMASQ_DHCP_VER" -gt 4 ] ; then
-		# Enable RA feature for when/if it is constructed,
-		# and RA is selected per interface pool (RA, DHCP, or both),
-		# but no one (should) want RA broadcast in syslog
-		config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
-		xappend "--enable-ra"
-		xappend "--quiet-ra"
-		append_bool "$cfg" quietdhcp "--quiet-dhcp6"
-
-	elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
+	config_get odhcpd_is_active odhcpd maindhcp
+	if [ "$odhcpd_is_active" != "1" ]; then
 		config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
 	fi
 
-
 	echo >> $CONFIGFILE_TMP
 	config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg"
 	echo >> $CONFIGFILE_TMP
@@ -1009,7 +773,6 @@ dnsmasq_start()
 	procd_open_instance $cfg
 	procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid
 	procd_set_param file $CONFIGFILE
-	[ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript"
 	procd_set_param respawn
 
 	local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf"
@@ -1018,7 +781,7 @@ dnsmasq_start()
 	fi
 
 	procd_add_jail dnsmasq ubus log
-	procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT
+	procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $dhcpscript /etc/hosts /etc/ethers $EXTRA_MOUNT
 	procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
 
 	procd_close_instance

+ 0 - 4
package/network/services/dnsmasq/files/dnsmasq_acl.json

@@ -1,4 +0,0 @@
-{
-	"user": "dnsmasq",
-	"publish": [ "dnsmasq" ]
-}

+ 0 - 15
package/network/services/dnsmasq/files/rfc6761.conf

@@ -1,15 +0,0 @@
-# RFC6761 included configuration file for dnsmasq
-#
-# includes a list of domains that should not be forwarded to Internet name servers
-# to reduce burden on them, asking questions that they won't know the answer to.
-
-server=/bind/
-server=/example/
-server=/example.com/
-server=/example.org/
-server=/example.net/
-server=/invalid/
-server=/local/
-server=/localhost/
-server=/onion/
-server=/test/

+ 0 - 126
package/network/services/dnsmasq/patches/240-ubus.patch

@@ -1,126 +0,0 @@
---- a/src/dnsmasq.c
-+++ b/src/dnsmasq.c
-@@ -19,6 +19,8 @@
- 
- #include "dnsmasq.h"
- 
-+#include <libubus.h>
-+
- struct daemon *daemon;
- 
- static volatile pid_t pid = 0;
-@@ -32,6 +34,62 @@ static void fatal_event(struct event_des
- static int read_event(int fd, struct event_desc *evp, char **msg);
- static void poll_resolv(int force, int do_reload, time_t now);
- 
-+static struct ubus_context *ubus;
-+static struct blob_buf b;
-+
-+static struct ubus_object_type ubus_object_type = {
-+	.name = "dnsmasq",
-+};
-+
-+static struct ubus_object ubus_object = {
-+	.name = "dnsmasq",
-+	.type = &ubus_object_type,
-+};
-+
-+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name)
-+{
-+	if (!ubus || !ubus_object.has_subscribers)
-+		return;
-+
-+	blob_buf_init(&b, 0);
-+	if (mac)
-+		blobmsg_add_string(&b, "mac", mac);
-+	if (ip)
-+		blobmsg_add_string(&b, "ip", ip);
-+	if (name)
-+		blobmsg_add_string(&b, "name", name);
-+	ubus_notify(ubus, &ubus_object, type, b.head, -1);
-+}
-+
-+static void set_ubus_listeners(void)
-+{
-+	if (!ubus)
-+		return;
-+
-+	poll_listen(ubus->sock.fd, POLLIN);
-+	poll_listen(ubus->sock.fd, POLLERR);
-+	poll_listen(ubus->sock.fd, POLLHUP);
-+}
-+
-+static void check_ubus_listeners()
-+{
-+	if (!ubus) {
-+		ubus = ubus_connect(NULL);
-+		if (ubus)
-+			ubus_add_object(ubus, &ubus_object);
-+		else
-+			return;
-+	}
-+
-+	if (poll_check(ubus->sock.fd, POLLIN))
-+		ubus_handle_event(ubus);
-+
-+	if (poll_check(ubus->sock.fd, POLLHUP)) {
-+		ubus_free(ubus);
-+		ubus = NULL;
-+	}
-+}
-+
- int main (int argc, char **argv)
- {
-   int bind_fallback = 0;
-@@ -911,6 +969,7 @@ int main (int argc, char **argv)
-       set_dbus_listeners();
- #endif	
-   
-+      set_ubus_listeners();
- #ifdef HAVE_DHCP
-       if (daemon->dhcp || daemon->relay4)
- 	{
-@@ -1041,6 +1100,8 @@ int main (int argc, char **argv)
-       check_dbus_listeners();
- #endif
-       
-+      check_ubus_listeners();
-+
-       check_dns_listeners(now);
- 
- #ifdef HAVE_TFTP
---- a/Makefile
-+++ b/Makefile
-@@ -85,7 +85,7 @@ all : $(BUILDDIR)
- 	@cd $(BUILDDIR) && $(MAKE) \
-  top="$(top)" \
-  build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \
-- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \
-+ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \
-  -f $(top)/Makefile dnsmasq 
- 
- mostly_clean :
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct
- #  endif
- #endif
- 
-+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name);
-+
- /* ipset.c */
- #ifdef HAVE_IPSET
- void ipset_init(void);
---- a/src/rfc2131.c
-+++ b/src/rfc2131.c
-@@ -1621,6 +1621,10 @@ static void log_packet(char *type, void
- 	      daemon->namebuff,
- 	      string ? string : "",
- 	      err ? err : "");
-+  if (!strcmp(type, "DHCPACK"))
-+	  ubus_event_bcast("dhcp.ack", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL);
-+  else if (!strcmp(type, "DHCPRELEASE"))
-+	  ubus_event_bcast("dhcp.release", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL);
- }
- 
- static void log_options(unsigned char *start, u32 xid)

+ 1 - 1
package/network/services/hostapd/Makefile

@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git

+ 1 - 1
package/network/services/hostapd/files/hostapd.sh

@@ -620,7 +620,7 @@ wpa_supplicant_add_network() {
 		scan_ssid=""
 	}
 
-	[[ "$_w_mode" = "adhoc" -o "$_w_mode" = "mesh" ]] && append network_data "$_w_modestr" "$N$T"
+	[ "$_w_mode" = "adhoc" -o "$_w_mode" = "mesh" ] && append network_data "$_w_modestr" "$N$T"
 
 	case "$auth_type" in
 		none) ;;

+ 4 - 4
package/network/services/odhcpd/Makefile

@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git
-PKG_SOURCE_DATE:=2017-04-28
-PKG_SOURCE_VERSION:=9268ca65d6e000b6cd4ed72d4a8fa427dada6f06
-PKG_MIRROR_HASH:=3c375291de38034f0965c92e509ca17788d3b31fe13abbc8f541b2e2452bc7fe
+PKG_SOURCE_DATE:=2017-10-02
+PKG_SOURCE_VERSION:=c6f3d5d4ea5154e5971fa0b1b1e9a9c07119429f
+PKG_MIRROR_HASH:=5ce8f52b5c6acea27d9733918e9c3bc8a154d516a02eef9b172c5e3d459f494c
 
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
 PKG_LICENSE:=GPL-2.0

+ 17 - 2
package/network/services/odhcpd/files/odhcpd.defaults

@@ -2,12 +2,27 @@
 uci -q get dhcp.odhcpd && exit 0
 touch /etc/config/dhcp
 
+. /usr/share/libubox/jshn.sh
+
+json_load "$(cat /etc/board.json)"
+json_select network
+json_select lan
+json_get_vars protocol
+json_select ..
+json_select ..
+
+case "$protocol" in
+# only enable server mode on statically addressed lan ports
+"static") MODE=server ;;
+*) MODE=disabled ;;
+esac
+
 uci batch <<EOF
 set dhcp.odhcpd=odhcpd
 set dhcp.odhcpd.maindhcp=0
 set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
 set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
-set dhcp.lan.dhcpv6=server
-set dhcp.lan.ra=server
+set dhcp.lan.dhcpv6=$MODE
+set dhcp.lan.ra=$MODE
 commit dhcp
 EOF

+ 5 - 4
package/network/services/openvpn/Makefile

@@ -9,14 +9,15 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openvpn
 
-PKG_VERSION:=2.4.4
-PKG_RELEASE:=1
+PKG_VERSION:=2.4.3
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=\
 	https://build.openvpn.net/downloads/releases/ \
-	https://swupdate.openvpn.net/community/releases/
+	https://swupdate.openvpn.net/community/releases/ \
+	http://www.eurephia.net/openvpn/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=96cd1b8fe1e8cb2920f07c3fd3985faea756e16fdeebd11d3e146d5bd2b04a80
+PKG_HASH:=7aa86167a5b8923e54e8795b814ed77288c793671f59fd830d9ab76d4b480571
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

+ 29 - 54
package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch

@@ -1,68 +1,43 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1068,62 +1068,15 @@ dnl
+@@ -1076,37 +1076,14 @@ dnl
  AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4])
  AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4])
  if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then
--    if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then
--	# if the user did not explicitly specify flags, try to autodetect
--	PKG_CHECK_MODULES([LZ4],
--			  [liblz4 >= 1.7.1],
--			  [have_lz4="yes"],
--			  [] # If this fails, we will do another test next
--	)
--    fi
-
-     saved_CFLAGS="${CFLAGS}"
-     saved_LIBS="${LIBS}"
-     CFLAGS="${CFLAGS} ${LZ4_CFLAGS}"
-     LIBS="${LIBS} ${LZ4_LIBS}"
-
--    # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars
--    # are used, check the version directly in the LZ4 include file
--    if test "${have_lz4}" != "yes"; then
--	AC_CHECK_HEADERS([lz4.h],
--			 [have_lz4h="yes"],
--			 [])
--
--	if test "${have_lz4h}" = "yes" ; then
--	    AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1])
--	    AC_COMPILE_IFELSE(
--		[AC_LANG_PROGRAM([[
--#include <lz4.h>
--				 ]],
--				 [[
--/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */
--#if LZ4_VERSION_NUMBER < 10701L
--#error LZ4 is too old
--#endif
--				 ]]
--				)],
--		[
--		    AC_MSG_RESULT([ok])
--		    have_lz4="yes"
--		],
--		[AC_MSG_RESULT([system LZ4 library is too old])]
--	    )
--	fi
--    fi
--
+-    AC_CHECKING([for LZ4 Library and Header files])
+-    havelz4lib=1
+ 
 -    # if LZ4_LIBS is set, we assume it will work, otherwise test
 -    if test -z "${LZ4_LIBS}"; then
--	AC_CHECK_LIB([lz4],
--		     [LZ4_compress],
--		     [LZ4_LIBS="-llz4"],
--		     [have_lz4="no"])
+-	AC_CHECK_LIB(lz4, LZ4_compress,
+-	    [ LZ4_LIBS="-llz4" ],
+-	    [
+-	        AC_MSG_RESULT([LZ4 library not found.])
+-	        havelz4lib=0
+-	    ])
 -    fi
++    AC_MSG_RESULT([Using LZ4 library in src/compat/compat-lz4.*])
++    AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
++    LZ4_LIBS=""
+ 
+-    saved_CFLAGS="${CFLAGS}"
+-    CFLAGS="${CFLAGS} ${LZ4_CFLAGS}"
+-    AC_CHECK_HEADERS(lz4.h,
+-       ,
+-       [
+-	   AC_MSG_RESULT([LZ4 headers not found.])
+-	   havelz4lib=0
+-       ])
 -
--    if test "${have_lz4}" != "yes" ; then
--	AC_MSG_RESULT([		usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
+-    if test $havelz4lib = 0 ; then
+-	AC_MSG_RESULT([LZ4 library or header not found, using version in src/compat/compat-lz4.*])
 -	AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
 -	LZ4_LIBS=""
 -    fi
-+    AC_MSG_RESULT([		usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
-+    AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
-+    LZ4_LIBS=""
      OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
      OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
-     AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library])
+     AC_DEFINE(ENABLE_LZ4, 1, [Enable LZ4 compression library])
+-    CFLAGS="${saved_CFLAGS}"
+ fi
+ 
+ 

+ 3 - 3
package/network/services/uhttpd/Makefile

@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git
-PKG_SOURCE_DATE:=2016-10-25
-PKG_SOURCE_VERSION:=1628fa4b34aa143187353f81e8001b9a15286bda
-PKG_MIRROR_HASH:=2ac4ba8dc0b349d72174aac9ff693a73a214295a9890fe3d2a8eedcad54d06e3
+PKG_SOURCE_DATE:=2017-08-19
+PKG_SOURCE_VERSION:=3fd58e9b6da7d9e1a4710dbeefc2d289baea09fb
+PKG_MIRROR_HASH:=69bba3b04c5e1975b99dee4fc47672ebf5ab282f115249a46be0fe0b961eb34b
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 PKG_LICENSE:=ISC
 

+ 1 - 1
package/network/utils/comgt/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=comgt
 PKG_VERSION:=0.32
-PKG_RELEASE:=28
+PKG_RELEASE:=29
 
 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/comgt

+ 1 - 1
package/network/utils/comgt/files/3g.sh

@@ -109,4 +109,4 @@ proto_3g_teardown() {
 	proto_kill_command "$interface"
 }
 
-[ -z "NOT_INCLUDED" ] || add_protocol 3g
+[ -z "$NOT_INCLUDED" ] || add_protocol 3g

+ 1 - 2
package/network/utils/comgt/files/directip.sh

@@ -44,8 +44,7 @@ proto_directip_setup() {
 		return 1
 	}
 
-	cardinfo=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom)
-	[ -n $(echo "$cardinfo" | grep -q "Sierra Wireless") ] || {
+	gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | grep -q "Sierra Wireless" || {
 		proto_notify_error "$interface" BAD_DEVICE
 		proto_block_restart "$interface"
 		return 1

+ 1 - 1
package/network/utils/curl/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=curl
 PKG_VERSION:=7.52.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \

+ 4 - 5
package/network/utils/tcpdump/Makefile

@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpdump
-PKG_VERSION:=4.9.1
+PKG_VERSION:=4.9.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
-	http://www.at.tcpdump.org/
-PKG_HASH:=f9448cf4deb2049acf713655c736342662e652ef40dbe0a8f6f8d5b9ce5bd8f3
+PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
+	http://www.tcpdump.org/release/
+PKG_HASH:=798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
@@ -76,7 +76,6 @@ endif
 MAKE_FLAGS += \
 	CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
 
-
 define Package/tcpdump/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/

+ 39 - 35
package/network/utils/tcpdump/patches/100-tcpdump_mini.patch

@@ -115,7 +115,7 @@
  	$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
 --- a/addrtoname.c
 +++ b/addrtoname.c
-@@ -566,8 +566,10 @@ linkaddr_string(netdissect_options *ndo,
+@@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo,
  	if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN)
  		return (etheraddr_string(ndo, ep));
  
@@ -125,8 +125,8 @@
 +#endif
  
  	tp = lookup_bytestring(ndo, ep, len);
- 	if (tp->e_name)
-@@ -1202,6 +1204,7 @@ init_addrtoname(netdissect_options *ndo,
+	if (tp->bs_name)
+@@ -1214,6 +1216,7 @@ init_addrtoname(netdissect_options *ndo,
  	init_ipxsaparray(ndo);
  }
  
@@ -134,7 +134,7 @@
  const char *
  dnaddr_string(netdissect_options *ndo, u_short dnaddr)
  {
-@@ -1221,6 +1224,7 @@ dnaddr_string(netdissect_options *ndo, u
+@@ -1233,6 +1236,7 @@ dnaddr_string(netdissect_options *ndo, u
  
  	return(tp->name);
  }
@@ -247,7 +247,7 @@
  		return (1);
 @@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo,
  		}
- 		isoclns_print(ndo, p + 1, length - 1, caplen - 1);
+		isoclns_print(ndo, p + 1, length - 1);
  		return(1);
 +#endif
  
@@ -335,7 +335,7 @@
          break;
 --- a/print-ip6.c
 +++ b/print-ip6.c
-@@ -303,6 +303,7 @@ ip6_print(netdissect_options *ndo, const
+@@ -305,6 +305,7 @@ ip6_print(netdissect_options *ndo, const
  				return;
  			nh = *cp;
  			break;
@@ -343,13 +343,16 @@
  		case IPPROTO_FRAGMENT:
  			advance = frag6_print(ndo, cp, (const u_char *)ip6);
  			if (advance < 0 || ndo->ndo_snapend <= cp + advance)
-@@ -324,16 +325,19 @@ ip6_print(netdissect_options *ndo, const
- 			advance = mobility_print(ndo, cp, (const u_char *)ip6);
+@@ -328,6 +329,7 @@ ip6_print(netdissect_options *ndo, const
+				return;
  			nh = *cp;
  			return;
 +#endif
  		case IPPROTO_ROUTING:
+			ND_TCHECK(*cp);
  			advance = rt6_print(ndo, cp, (const u_char *)ip6);
+@@ -335,12 +337,14 @@ ip6_print(netdissect_options *ndo, const
+				return;
  			nh = *cp;
  			break;
 +#ifndef TCPDUMP_MINI
@@ -363,15 +366,15 @@
  		case IPPROTO_TCP:
  			tcp_print(ndo, cp, len, (const u_char *)ip6, fragmented);
  			return;
-@@ -343,6 +347,7 @@ ip6_print(netdissect_options *ndo, const
+@@ -350,6 +354,7 @@ ip6_print(netdissect_options *ndo, const
  		case IPPROTO_ICMPV6:
  			icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented);
  			return;
 +#ifndef TCPDUMP_MINI
  		case IPPROTO_AH:
  			advance = ah_print(ndo, cp);
- 			nh = *cp;
-@@ -371,6 +376,7 @@ ip6_print(netdissect_options *ndo, const
+			if (advance < 0)
+@@ -382,6 +387,7 @@ ip6_print(netdissect_options *ndo, const
  		case IPPROTO_PIM:
  			pim_print(ndo, cp, len, (const u_char *)ip6);
  			return;
@@ -379,7 +382,7 @@
  
  		case IPPROTO_OSPF:
  			ospf6_print(ndo, cp, len);
-@@ -384,9 +390,11 @@ ip6_print(netdissect_options *ndo, const
+@@ -395,9 +401,11 @@ ip6_print(netdissect_options *ndo, const
  		        ip_print(ndo, cp, len);
  			return;
  
@@ -393,7 +396,7 @@
  			gre_print(ndo, cp, len);
 --- a/print-ip.c
 +++ b/print-ip.c
-@@ -329,6 +329,7 @@ ip_print_demux(netdissect_options *ndo,
+@@ -344,6 +344,7 @@ ip_print_demux(netdissect_options *ndo,
  again:
  	switch (ipds->nh) {
  
@@ -401,7 +404,7 @@
  	case IPPROTO_AH:
  		if (!ND_TTEST(*ipds->cp)) {
  			ND_PRINT((ndo, "[|AH]"));
-@@ -367,7 +368,9 @@ again:
+@@ -382,7 +383,9 @@ again:
  		 */
  		break;
  	}
@@ -411,7 +414,7 @@
  	case IPPROTO_SCTP:
  		sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len);
  		break;
-@@ -375,6 +378,7 @@ again:
+@@ -390,6 +393,7 @@ again:
  	case IPPROTO_DCCP:
  		dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len);
  		break;
@@ -419,7 +422,7 @@
  
  	case IPPROTO_TCP:
  		/* pass on the MF bit plus the offset to detect fragments */
-@@ -394,6 +398,7 @@ again:
+@@ -409,6 +413,7 @@ again:
  			   ipds->off & (IP_MF|IP_OFFMASK));
  		break;
  
@@ -427,7 +430,7 @@
  	case IPPROTO_PIGP:
  		/*
  		 * XXX - the current IANA protocol number assignments
-@@ -414,14 +419,17 @@ again:
+@@ -429,14 +434,17 @@ again:
  	case IPPROTO_EIGRP:
  		eigrp_print(ndo, ipds->cp, ipds->len);
  		break;
@@ -445,7 +448,7 @@
  
  	case IPPROTO_OSPF:
  		ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip);
-@@ -454,6 +462,7 @@ again:
+@@ -469,6 +477,7 @@ again:
  		gre_print(ndo, ipds->cp, ipds->len);
  		break;
  
@@ -453,14 +456,14 @@
  	case IPPROTO_MOBILE:
  		mobile_print(ndo, ipds->cp, ipds->len);
  		break;
-@@ -482,6 +491,7 @@ again:
+@@ -497,6 +506,7 @@ again:
  	case IPPROTO_PGM:
  		pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip);
  		break;
 +#endif
  
  	default:
- 		if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL)
+		if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL)
 --- a/print-llc.c
 +++ b/print-llc.c
 @@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const
@@ -495,21 +498,22 @@
  
  #ifdef ENABLE_SMB
  	if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI
-@@ -322,11 +326,13 @@ llc_print(netdissect_options *ndo, const
+@@ -322,12 +326,13 @@ llc_print(netdissect_options *ndo, const
  		return (hdrlen);
  	}
  #endif
 +#ifndef TCPDUMP_MINI
  	if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS
  	    && control == LLC_UI) {
- 		isoclns_print(ndo, p, length, caplen);
+		isoclns_print(ndo, p, length);
  		return (hdrlen);
  	}
+-
 +#endif
- 
  	if (!ndo->ndo_eflag) {
  		if (ssap == dsap) {
-@@ -480,6 +486,7 @@ snap_print(netdissect_options *ndo, cons
+			if (src == NULL || dst == NULL)
+@@ -480,6 +485,7 @@ snap_print(netdissect_options *ndo, cons
  
  	case OUI_CISCO:
                  switch (et) {
@@ -517,7 +521,7 @@
                  case PID_CISCO_CDP:
                          cdp_print(ndo, p, length, caplen);
                          return (1);
-@@ -492,6 +499,7 @@ snap_print(netdissect_options *ndo, cons
+@@ -492,6 +498,7 @@ snap_print(netdissect_options *ndo, cons
                  case PID_CISCO_VTP:
                          vtp_print(ndo, p, length);
                          return (1);
@@ -525,7 +529,7 @@
                  case PID_CISCO_PVST:
                  case PID_CISCO_VLANBRIDGE:
                          stp_print(ndo, p, length);
-@@ -504,6 +512,7 @@ snap_print(netdissect_options *ndo, cons
+@@ -504,6 +511,7 @@ snap_print(netdissect_options *ndo, cons
  	case OUI_RFC2684:
  		switch (et) {
  
@@ -533,7 +537,7 @@
  		case PID_RFC2684_ETH_FCS:
  		case PID_RFC2684_ETH_NOFCS:
  			/*
-@@ -565,6 +574,7 @@ snap_print(netdissect_options *ndo, cons
+@@ -565,6 +573,7 @@ snap_print(netdissect_options *ndo, cons
  			 */
  			fddi_print(ndo, p, length, caplen);
  			return (1);
@@ -549,7 +553,7 @@
  
 +#ifndef TCPDUMP_MINI
  	case BSD_AFNUM_ISO:
- 		isoclns_print(ndo, p, length, caplen);
+		isoclns_print(ndo, p, length);
  		break;
 @@ -127,6 +128,7 @@ null_if_print(netdissect_options *ndo, c
  	case BSD_AFNUM_IPX:
@@ -561,7 +565,7 @@
  		/* unknown AF_ value */
 --- a/print-ppp.c
 +++ b/print-ppp.c
-@@ -1358,6 +1358,7 @@ trunc:
+@@ -1367,6 +1367,7 @@ trunc:
  	return 0;
  }
  
@@ -569,7 +573,7 @@
  static void
  ppp_hdlc(netdissect_options *ndo,
           const u_char *p, int length)
-@@ -1436,6 +1437,7 @@ trunc:
+@@ -1445,6 +1446,7 @@ trunc:
  	free(b);
  	ND_PRINT((ndo, "[|ppp]"));
  }
@@ -577,7 +581,7 @@
  
  
  /* PPP */
-@@ -1443,10 +1445,12 @@ static void
+@@ -1452,10 +1454,12 @@ static void
  handle_ppp(netdissect_options *ndo,
             u_int proto, const u_char *p, int length)
  {
@@ -590,7 +594,7 @@
  
  	switch (proto) {
  	case PPP_LCP: /* fall through */
-@@ -1479,6 +1483,7 @@ handle_ppp(netdissect_options *ndo,
+@@ -1488,6 +1492,7 @@ handle_ppp(netdissect_options *ndo,
  	case PPP_IPV6:
  		ip6_print(ndo, p, length);
  		break;
@@ -598,7 +602,7 @@
  	case ETHERTYPE_IPX:	/*XXX*/
  	case PPP_IPX:
  		ipx_print(ndo, p, length);
-@@ -1490,6 +1495,7 @@ handle_ppp(netdissect_options *ndo,
+@@ -1499,6 +1504,7 @@ handle_ppp(netdissect_options *ndo,
  	case PPP_MPLS_MCAST:
  		mpls_print(ndo, p, length);
  		break;
@@ -606,7 +610,7 @@
  	case PPP_COMP:
  		ND_PRINT((ndo, "compressed PPP data"));
  		break;
-@@ -1630,6 +1636,7 @@ ppp_if_print(netdissect_options *ndo,
+@@ -1639,6 +1645,7 @@ ppp_if_print(netdissect_options *ndo,
  	return (0);
  }
  
@@ -614,7 +618,7 @@
  /*
   * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like
   * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547,
-@@ -1857,6 +1864,7 @@ printx:
+@@ -1866,6 +1873,7 @@ printx:
  #endif /* __bsdi__ */
  	return (hdrlength);
  }

+ 1 - 1
scripts/checkpatch.pl

@@ -173,7 +173,7 @@ if ($tree) {
 	}
 
 	if (!defined $root) {
-		print "Must be run from the top-level dir. of a LEDE tree\n";
+		print "Must be run from the top-level dir. of a libreCMC tree\n";
 		exit(2);
 	}
 }

+ 26 - 9
scripts/feeds

@@ -130,6 +130,7 @@ my %update_method = (
 		'init_branch'   => "git clone --depth 1 --branch '%s' '%s' '%s'",
 		'init_commit'   => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
 		'update'	=> "git pull --ff",
+		'update_force'	=> "git pull --ff || (git reset --hard HEAD; git pull --ff; exit 1)",
 		'controldir'	=> ".git",
 		'revision'	=> "git rev-parse --short HEAD | tr -d '\n'"},
 	'src-git-full' => {
@@ -137,6 +138,7 @@ my %update_method = (
 		'init_branch'   => "git clone --branch '%s' '%s' '%s'",
 		'init_commit'   => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
 		'update'	=> "git pull --ff",
+		'update_force'	=> "git pull --ff || (git reset --hard HEAD; git pull --ff; exit 1)",
 		'controldir'	=> ".git",
 		'revision'	=> "git rev-parse --short HEAD | tr -d '\n'"},
 	'src-gitsvn' => {
@@ -161,11 +163,12 @@ my %update_method = (
 # src-git: pull broken
 # src-cpy: broken if `basename $src` != $name
 
-sub update_feed_via($$$$) {
+sub update_feed_via($$$$$) {
 	my $type = shift;
 	my $name = shift;
 	my $src = shift;
 	my $relocate = shift;
+	my $force = shift;
 
 	my $m = $update_method{$type};
 	my $localpath = "./feeds/$name";
@@ -186,7 +189,11 @@ sub update_feed_via($$$$) {
 	} elsif ($m->{'init_commit'} and $commit) {
 		# in case git hash has been provided don't update the feed
 	} else {
-		system("cd '$safepath'; $m->{'update'}") == 0 or return 1;
+		my $update_cmd = $m->{'update'};
+		if ($force && exists $m->{'update_force'}) {
+			$update_cmd = $m->{'update_force'};
+		}
+		system("cd '$safepath'; $update_cmd") == 0 or return 1;
 	}
 
 	return 0;
@@ -664,13 +671,15 @@ sub uninstall {
 	return 0;
 }
 
-sub update_feed($$$$)
+sub update_feed($$$$$)
 {
 	my $type=shift;
 	my $name=shift;
 	my $src=shift;
 	my $perform_update=shift;
+	my $force_update=shift;
 	my $force_relocate=update_location( $name, "@$src" );
+	my $rv=0;
 
 	if( $force_relocate ) {
 		warn "Source of feed $name has changed, replacing copy\n";
@@ -683,9 +692,16 @@ sub update_feed($$$$)
 		my $failed = 1;
 		foreach my $feedsrc (@$src) {
 			warn "Updating feed '$name' from '$feedsrc' ...\n";
-			next unless update_feed_via($type, $name, $feedsrc, $force_relocate) == 0;
+			if (update_feed_via($type, $name, $feedsrc, $force_relocate, $force_update) != 0) {
+				if ($force_update) {
+					$rv=1;
+					$failed=0;
+					warn "failed, ignore.\n";
+					next;
+				}
+				last;
+			}
 			$failed = 0;
-			last;
 		}
 		$failed and do {
 			warn "failed.\n";
@@ -697,7 +713,7 @@ sub update_feed($$$$)
 		warn "failed.\n";
 		return 1;
 	};
-	return 0;
+	return $rv;
 }
 
 sub update {
@@ -709,7 +725,7 @@ sub update {
 	$ENV{SCAN_COOKIE} = $$;
 	$ENV{OPENWRT_VERBOSE} = 's';
 
-	getopts('ahi', \%opts);
+	getopts('ahif', \%opts);
 
 	if ($opts{h}) {
 		usage();
@@ -729,7 +745,7 @@ sub update {
 	if ( ($#ARGV == -1) or $opts{a}) {
 		foreach my $feed (@feeds) {
 			my ($type, $name, $src) = @$feed;
-			update_feed($type, $name, $src, $perform_update) == 0 or $failed=1;
+			update_feed($type, $name, $src, $perform_update, $opts{f}) == 0 or $failed=1;
 		}
 	} else {
 		while ($feed_name = shift @ARGV) {
@@ -738,7 +754,7 @@ sub update {
 				if($feed_name ne $name) {
 					next;
 				}
-				update_feed($type, $name, $src, $perform_update) == 0 or $failed=1;
+				update_feed($type, $name, $src, $perform_update, $opts{f}) == 0 or $failed=1;
 			}
 		}
 	}
@@ -796,6 +812,7 @@ Commands:
 	Options:
 	    -a :           Update all feeds listed within feeds.conf. Otherwise the specified feeds will be updated.
 	    -i :           Recreate the index only. No feed update from repository is performed.
+	    -f :           Force updating feeds even if there are changed, uncommitted files.
 
 	clean:             Remove downloaded/generated files.
 

+ 1 - 1
scripts/om-fwupgradecfg-gen.sh

@@ -1,4 +1,4 @@
-#/bin/sh
+#!/bin/sh
 #
 # Copyright (C) 2011 OpenWrt.org
 #

+ 3 - 2
target/imagebuilder/Makefile

@@ -18,6 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
 IB_KDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(KERNEL_BUILD_DIR))
 IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))
 IB_DTSDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))/arch/$(ARCH)/boot/dts/
+IB_IDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(STAGING_DIR_IMAGE))
 
 all: compile
 
@@ -72,8 +73,8 @@ endif
 		$(INSTALL_DIR) $(IB_LDIR)/scripts/dtc; \
 		$(INSTALL_BIN) $(LINUX_DIR)/scripts/dtc/dtc $(IB_LDIR)/scripts/dtc/dtc; \
 	fi
-	if [ -d $(LINUX_DIR)/arch/$(ARCH)/boot/dts ]; then \
-		$(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/* $(IB_DTSDIR); \
+	if [ -d $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts ]; then \
+		$(CP) -L $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts/* $(IB_DTSDIR); \
 	fi
 	$(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' $(PKG_BUILD_DIR)/include/version.mk
 	find $(PKG_BUILD_DIR) -name CVS -o -name .git -o -name .svn \

+ 7 - 1
target/linux/ar71xx/base-files/etc/board.d/01_leds

@@ -49,6 +49,10 @@ antrouter-r1)
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
 	ucidef_set_led_default "btc" "BTC" "$board:green:btc" "0"