You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB

mwan3: fix interface-bound traffic when interface is offline This commit fixed what 6d99b602 was supposed to fix without affecting interface-bound traffic. Before 6d99b602 interface-bound traffic was working normally as long as at least one interface was online. However when the last interface went offline, it was impossible to ping and such state was unrecoverable. Commit 6d99b602 fixed unrecoverable offline state problem (it was possible to ping -I iface) but messed inteface-bound traffic. Traffic with interface source address was not working if the interface was in "offline" state, even if another interface was online. The problem was caused by an inconsistent "offline" interface state: iptables-related rules were kept while routing table and policy were deleted. The idea behind this commit is to: 1. Keep all the rules for each interface (iptables, routing table, policy) regardless of its state. This ensures consistency, 2. Make interface state hotplug events affect only iptables' mwan3_policy_* rules. Interface-related iptables, routing table and policy is removed only when mwan3 is manually stopped. To make such changes possible, it's necessary to change the way mwan3_policy_* rule generator keeps track of interface state hotplug events. Until now, it checked for the existence of custom interface-related routing table (table id 1, 2, 3, ...). Clearly we can no longer rely on that so each interface state is stored explicitly in file. Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
7 years ago
  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=mwan3
  9. PKG_VERSION:=2.6.5
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
  12. PKG_LICENSE:=GPLv2
  13. include $(INCLUDE_DIR)/package.mk
  14. define Package/mwan3
  15. SECTION:=net
  16. CATEGORY:=Network
  17. SUBMENU:=Routing and Redirection
  18. DEPENDS:=+ip +ipset +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
  19. TITLE:=Multiwan hotplug script with connection tracking support
  20. MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
  21. PKGARCH:=all
  22. endef
  23. define Package/mwan3/description
  24. Hotplug script which makes configuration of multiple WAN interfaces simple
  25. and manageable. With loadbalancing/failover support for up to 250 wan
  26. interfaces, connection tracking and an easy to manage traffic ruleset.
  27. endef
  28. define Package/mwan3/conffiles
  29. /etc/config/mwan3
  30. /etc/mwan3.user
  31. endef
  32. define Build/Compile
  33. endef
  34. define Package/mwan3/postinst
  35. #!/bin/sh
  36. if [ -z "$${IPKG_INSTROOT}" ]; then
  37. /etc/init.d/rpcd restart
  38. fi
  39. exit 0
  40. endef
  41. define Package/mwan3/postrm
  42. #!/bin/sh
  43. if [ -z "$${IPKG_INSTROOT}" ]; then
  44. /etc/init.d/rpcd restart
  45. fi
  46. exit 0
  47. endef
  48. define Package/mwan3/install
  49. $(CP) ./files/* $(1)
  50. endef
  51. $(eval $(call BuildPackage,mwan3))