Compare commits

...

150 commits

Author SHA1 Message Date
Moritz Warning
ff31270ed7
Merge pull request #327 from wigyori/for-15.05-ndppd2
ndppd: fix source URL
2018-03-04 00:34:24 +01:00
Bastian Bittorf
6865dcb07e
Merge pull request #306 from HRogge/for-15.05
OONF 0.14.1-1
2017-12-13 12:41:57 +01:00
elektra42
cb742b8574
Merge pull request #328 from wigyori/for-15.05-batmand2
CC: batmand: move download source
2017-11-13 13:28:44 +01:00
Alexander Ryzhov
f62f82020d ndppd: fix source URL (#209)
Signed-off-by: Alexander Ryzhov <openwrt@ryzhov-al.ru>
2017-11-10 21:30:39 +01:00
Sven Eckelmann
6684bff253 batmand: Use git repository to retrieve sources
The current package is build around the subversion repository which does
not exist anymore. The package can therefore be moved to the git repository
to have an official source for the revision used in OpenWrt.

The SVN version of batman r1439 was actually r1435. The git export of revision
r1435 is referenced by this commit. The version number was only increased
to 1440 to create a new source tarball. SVN revision r1440 is not a commit
for batman and therefore no code changes in batman was done in r1440.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-11-10 20:57:09 +01:00
Sven Eckelmann
4eb57b4298 vis: Extract vis package from batmand
The batmand and vis sources are actually stored in two different
repositories. It therefore makes more sense to have these two packages also
split in two different OpenWrt packages. This also allows to get the vis
sources directly from the git repository.

The SVN version of vis r1439 was actually r1346. The git export of revision
r1346 is referenced by this commit.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-11-10 20:57:04 +01:00
Sven Eckelmann
c48460940d batmand: Switch upstream URL to HTTPS
The open-mesh.org server is not serving plain HTTP pages since a while.
Updating the default URL to https is therefore prefered.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-11-10 20:56:59 +01:00
Sven Eckelmann
fd0439743a batmand: Replace maintainer with Elektra
The mail address for Marek Lindner was not up to date. Marek was also not
maintaining this package and was forwarding requests to Elektra:

  "Elektra is the maintainer for batmand. I'd rather not interfere."

https://github.com/openwrt-routing/packages/pull/134#issuecomment-236346560

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2017-11-10 20:56:56 +01:00
Jo-Philipp Wich
a31039825c batmand: switch to tarball download, fix build with musl libc
Since the upstream SVN repository is not available anymore, update the
Makefile to fetch tarballs cached by the LEDE or OpenWrt projects instead.

Also add a missing -D_GNU_SOURCE to the target flags to fix compilation
with musl libc.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-11-10 20:56:52 +01:00
Henning Rogge
39b42f3e29 Update OONF to 0.14.1-1 2017-06-13 10:59:44 +02:00
Henning Rogge
42d763fb2f Add v0.14.0 OONF 2017-06-06 16:48:41 +02:00
Saverio Proto
79b4b3eff1 Merge pull request #285 from gabri94/for-15.05
Version bump of the poprouting package
2017-03-04 21:58:11 +01:00
Gabriel
f2b1aa2640 fixed +PKG_RELEASE 2017-03-04 21:51:30 +01:00
Gabriel
66215e36db Makefile for v0.3.1 2017-03-04 19:44:30 +01:00
gabri94
e00d8bb35b Symbolic Version number 2017-03-02 18:06:56 +01:00
gabri94
740fab1483 compile v0.3 2017-03-02 12:55:42 +01:00
gabri94
eea095ac63 New makefile for prince v0.3 2017-03-01 09:27:00 +01:00
Bastian Bittorf
c4d975fc18 Merge pull request #265 from gabri94/for-15.05
For 15.05
2017-01-27 10:26:14 +01:00
Gabriel
7737ef11ef Changed description 2017-01-26 22:21:44 +01:00
Gabriel
e4fadd105e added install 2017-01-26 22:21:44 +01:00
Gabriel
c46abbf197 fixup! fixup! addedd poprouting makefile 2017-01-26 22:21:44 +01:00
Gabriel
cfdc4583ea fixup! addedd poprouting makefile
Conflicts:
	poprouting/Makefile
2017-01-26 22:21:42 +01:00
Bastian Bittorf
1975a41c2c Merge pull request #239 from sarumpaet/for-15.05
Cherry-pick olsrd1 IPv6 fixes to for-15.05
2016-11-05 10:16:04 +01:00
Stefan Sperling
27762fdabe Replace == operator in test with = operator.
Requested by bittorf in https://github.com/openwrt-routing/packages/pull/155

(cherry picked from commit cde0b2f813)
2016-11-05 02:05:56 +01:00
Stefan Sperling
497950bf2c Fix '/etc/init.d/olsrd6 restart' breaks IPv4 SmartGateway.
Restarting olsrd for IPv6 clears SmartGateway firewall rules for both IPv4
and IPv6, and does not restore the IPv4 rules. As a result, IPv4 SmartGateway
functionality is broken after /etc/init.d/olsrd6 restart.

(cherry picked from commit f7ffb388b1)
2016-11-05 02:00:01 +01:00
Bastian Bittorf
17d50421de Merge pull request #235 from HRogge/for-15.05
Update to OONF version 0.13.0
2016-10-21 13:00:41 +02:00
Henning Rogge
270f11bfb2 Update to OONF version 0.13.0 2016-10-21 12:50:57 +02:00
Bastian Bittorf
26268e3fcc Merge pull request #229 from HRogge/for-15.05
Update to OONF 0.12.4
2016-09-09 20:16:54 +02:00
Henning Rogge
97cad3cdb3 Update to OONF 0.12.4 2016-09-04 14:22:01 +02:00
Bastian Bittorf
7a89a2bb06 Merge pull request #225 from HRogge/for-15.05
Update to OONF 0.12.3
2016-08-18 13:44:34 +02:00
Henning Rogge
8251c442a8 Update to OONF 0.12.3 2016-08-17 17:21:35 +02:00
Bastian Bittorf
82e0aece7c Merge pull request #218 from HRogge/for-15.05
Update to OONF 0.12.2 + coverity fix
2016-08-09 13:15:14 +02:00
Henning Rogge
5a0d85dc53 Update to OONF 0.12.2 + coverity fix 2016-08-01 11:58:51 +02:00
zorun
06844bbcb7 Merge pull request #214 from zorun/babeld_update_url_cc
babeld: Update source URL
2016-07-30 13:36:02 +02:00
Baptiste Jonglez
7aa480831c babeld: Update source URL
There is a HTTP redirection in place from the old URL to the new URL, but
better change it now than waiting for the redirection to disappear.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2016-07-30 13:31:11 +02:00
Axel Neumann
d9cadd9c7b bmx7: update source (fixing several DoS scenarios) 2016-07-20 11:17:37 +02:00
Axel Neumann
0dc9e3911e bmx7: update source (disable sysctl settings for net/ipv4/conf/{all|default}) 2016-07-19 16:01:49 +02:00
Axel Neumann
0e56d45e21 bmx7: update source (fixing discarded dhm packet signatures) 2016-07-12 15:00:23 +02:00
lindnermarek
216429d8fd Merge pull request #207 from ecsv/ecsv/batadv-cc-speedyjoin
CC: batman-adv: Fix speedy join in gateway client mode
2016-07-06 21:38:15 +08:00
Sven Eckelmann
0d86d08be9 batman-adv: Fix speedy join in gateway client mode
Speedy join only works when the received packet is either broadcast or an
4addr unicast packet. Thus packets converted from broadcast to unicast via
the gateway handling code have to be converted to 4addr packets to allow
the receiving gateway server to add the sender address as temporary entry
to the translation table.

Not doing it will make the batman-adv gateway server drop the DHCP response
in many situations because it doesn't yet have the TT entry for the
destination of the DHCP response.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-07-06 15:36:23 +02:00
Sven Eckelmann
14e98d86ac batman-adv: Add reference counting + nullptr fixes
* Avoid nullptr dereference in bla after vlan_insert_tag
 * Avoid nullptr dereference in dat after vlan_insert_tag
 * Avoid tt_req_node list put for unhashed entry
 * Fix orig_node_vlan leak on orig_node_release
 * Fix non-atomic bla_claim::backbone_gw access
 * Fix reference leak in batadv_find_router
 * Free last_bonding_candidate on release of orig_node

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2016-07-05 12:03:44 +02:00
Axel Neumann
654c00719a bmx7: update source 2016-07-01 11:05:27 +02:00
Markus Stenberg
50ac90a9cc miniupnpd: Fix UUID dependency not to check outside the tree, and use uuid always. 2016-06-28 15:18:52 +03:00
Markus Stenberg
d6658ba5fe Merge pull request #202 from axet/for-15.05
miniupnpd-2.0
2016-06-28 00:26:16 +03:00
Alexey Kuznetsov
18a43e9c1d Update Makefile 2016-06-27 20:07:55 +03:00
Alexey Kuznetsov
cf7ecaa1e4 miniupnpd-2.0 2016-06-27 19:52:57 +03:00
Bastian Bittorf
b5c3eed9ee Merge pull request #199 from HRogge/for-15.05
OONF v0.12.1
2016-06-20 11:57:13 +02:00
Henning Rogge
257136013c OONF release 0.12.1 2016-06-07 11:20:36 +02:00
lindnermarek
d26f350b01 Merge pull request #194 from ecsv/for-15.05/batman-adv
batman-adv: Add fixes from upcoming 2016.2 release
2016-06-07 14:25:35 +08:00
Sven Eckelmann
f1f7684c2c batman-adv: Add fixes from upcoming 2016.2 release
The upcoming batman-adv 2016.2 contains multiple new features, code
refactoring and similar things. These may not be fitting for Chaos Calmer
but the changes in the maintenance branch (bugfixes) should be integrated
to increase the stability.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-06-07 08:14:51 +02:00
Alexander Couzens
29c2d49c8e batman-adv: remove DEPENDS:=kmod-crypto-core
kmod-crypto-core was removed in openwrt/trunk svn 46820 and all
kconfig's are now built-in.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2016-06-06 18:56:37 +02:00
Axel Neumann
f99ea75b41 bmx7: update code version 2016-06-04 17:01:22 +02:00
Henning Rogge
688d19d3a8 Update to OONF 0.12.0 2016-05-31 09:02:24 +02:00
Henning Rogge
546bf039db Merge branch 'for-15.05' of github.com:HRogge/packages into for-15.05 2016-05-31 09:02:05 +02:00
Bastian Bittorf
cb1c017cf2 Merge pull request #188 from HRogge/for-15.05
For 15.05
2016-05-25 10:15:18 +02:00
Markus Stenberg
810780abb1 hnetd: Updated to RFC7787/7788 compliant version. 2016-05-17 00:13:29 +03:00
Markus Stenberg
0788f346e3 ohybridproxy: Bumped to latest (has bunch of bugfixes). 2016-05-17 00:13:09 +03:00
Henning Rogge
14bf7626cf Update OONF to v0.11.7 2016-05-13 15:05:06 +02:00
Henning Rogge
4aa0be2da8 Update OONF to 0.11.6 2016-05-13 10:50:19 +02:00
Henning Rogge
0290758f22 Update OONF packages to 0.11.5 2016-05-12 20:17:53 +02:00
Marek Lindner
a3cd8a1729 batman-adv: 2016.1 bugfixes & stability updates
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-07 20:43:29 +08:00
Axel Neumann
16ceff232d bmx7: bump version (report channel via topology plugin) 2016-05-06 10:35:47 +02:00
Axel Neumann
b5ad75c563 bmx7: bump version (report link snr via topology plugin) 2016-05-06 10:19:53 +02:00
Marek Lindner
76e83819b4 batman-adv: revert partial cfg80211 kernel dependency
The entire batman-adv code relies on the kernel backports introduced
by the mac80211 package.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-06 00:09:54 +08:00
Marek Lindner
e35df7827f batman-adv: autoload cfg80211 kernel dependency
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-05-05 21:46:51 +08:00
Henning Rogge
619af6de6c Add remotecontrol plugin to selectable Olsrd2 plugins 2016-05-05 14:21:31 +01:00
Henning Rogge
88996c497c Add optional packages to OONF olsrd2 2016-05-05 13:59:44 +01:00
Roger Pueyo Centelles
c57a7977fe [luci-app-bmx7] Add world icons resources 2016-05-04 15:44:03 +02:00
Roger Pueyo Centelles
0599a18235 [luci-app-bmx7] Add Nodes view page 2016-05-04 15:44:02 +02:00
Roger Pueyo Centelles
ef61e355eb [luci-app-bmx7] Add Nodes page menu entry 2016-05-04 15:44:00 +02:00
Roger Pueyo Centelles
74078557b7 [luci-app-bmx7] Update configuration and installation definitions in Makefile 2016-05-04 15:43:59 +02:00
Roger Pueyo Centelles
83a20d1c40 [luci-app-bmx7] Add bmx7-info script to obtain JSON-formatted input for the Status page 2016-05-04 15:43:57 +02:00
Roger Pueyo Centelles
0e3c16c887 [luci-app-bmx7] Add BMX7 logo resource 2016-05-04 15:43:56 +02:00
Roger Pueyo Centelles
ffe6daf597 [luci-app-bmx7] Add polling.js resource 2016-05-04 15:43:55 +02:00
Roger Pueyo Centelles
06789715c4 [luci-app-bmx7] Add Status view page 2016-05-04 15:43:53 +02:00
Roger Pueyo Centelles
7e59d9c95f [luci-app-bmx7] Add Status page menu entry 2016-05-04 15:43:51 +02:00
Roger Pueyo Centelles
6d5e6dd4b0 [luci-app-bmx7] Add empty controller and default configurations for BMX7 LuCI 2016-05-04 15:43:48 +02:00
Roger Pueyo Centelles
52cc9e35ed [luci-app-bmx7] Create luci-app-bmx7 package structure including Makefile and
COPYING license file
2016-05-04 15:43:35 +02:00
Axel Neumann
551c246976 bmx7: bump to latest code version 2016-05-01 17:03:21 +02:00
Marek Lindner
049cae3fe8 batman-adv: upgrade package to latest release 2016.1
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-04-25 17:47:14 +08:00
Marek Lindner
cd13a319ed batctl: upgrade package to latest release 2016.1
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
2016-04-25 17:45:00 +08:00
Bastian Bittorf
d28aca37ef Merge pull request #179 from HRogge/for-15.05
Update to OONF v0.11.4
2016-04-25 11:15:26 +02:00
Henning Rogge
349a14f634 Update to OONF v0.11.4 2016-04-25 08:23:08 +02:00
Bastian Bittorf
df98ea3d1e Merge pull request #175 from HRogge/for-15.05
Update to OONF 0.11.3
2016-04-23 17:28:03 +02:00
Henning Rogge
4376f76b98 Update to OONF 0.11.3 2016-04-19 12:31:55 +02:00
Sven Roederer
2a6f4cdaa5 [olsr, oonf] change to new repo
Conflicts:
	olsrd/Makefile

Resolution:
	leave olsrd Makefile untouched, since current URL is working

Signed-off-by: Gui Iribarren <gui@altermundi.net>
2016-04-18 16:04:04 +02:00
Bastian Bittorf
be1d27c0e6 Merge pull request #165 from HRogge/for-15.05
Update to version 0.11.2
2016-03-19 16:40:11 +01:00
Henning Rogge
24e92ddee8 Update to version 0.11.2 2016-03-17 14:16:38 +01:00
Bastian Bittorf
f5e992734a Merge pull request #159 from HRogge/for-15.05
Update to OONF 0.11.1
2016-03-13 16:24:22 +01:00
Henning Rogge
1ba5d1d743 Update to OONF 0.11.1 2016-03-12 00:47:19 +01:00
Bastian Bittorf
c506c492c9 Merge pull request #154 from HRogge/for-15.05
For 15.05
2016-03-04 15:56:01 +01:00
Henning Rogge
69087c2ebe Forgot to change to switch from os_socket to os_fd for OONF 2016-02-29 19:04:56 +01:00
Henning Rogge
9de1efba1e OONF version 0.11.0 2016-02-28 21:31:59 +01:00
Pau Escrich
4830444a7c [luci-app-bmx6] When drawing the network topology graph, try first wget-ssl
Signed-off-by: Pau Escrich <p4u@dabax.net>
2016-02-23 17:04:34 +01:00
Gabriel Kerneis
d7701f4ada babeld: release 1.7.1
Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2016-02-16 10:58:40 +01:00
Axel Neumann
19cf787674 bmx7: update source: fix bmx7_tun plugin Makefile and new --setTrustedNode options 2016-02-15 23:09:09 +01:00
Axel Neumann
60254635bb bmx7: fix source url 2016-02-11 07:17:01 +01:00
Axel Neumann
ec98977f7a bmx7: separate bmx7 namespace for binaries, libs, config, runtimedir, ... 2016-02-11 07:06:46 +01:00
Lars Gierth
57009dafe0 cjdns: update source, bump release
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-06 04:55:29 +01:00
Lars Gierth
0267f29f63 cjdns: fix dependency on git revision
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-06 04:55:29 +01:00
Axel Neumann
5eaad909c6 bmx7 security enhanced mesh routing 2016-01-18 13:59:52 +01:00
Daniel Golle
4104e7b92d cjdns: update source
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2016-01-17 15:45:54 +01:00
Bastian Bittorf
587411eebd Merge pull request #142 from mmunz/for-15.05
make ipv6only boolean in olsrd init, backport from master
2016-01-05 08:15:03 +01:00
Manuel Munz
a30af3990f make ipv6only boolean in olsrd init, backport from master 2016-01-04 21:45:46 +01:00
Lars Gierth
e870c3373e cjdns: update source, bump version
Conflicts:
	cjdns/Makefile
2015-10-09 16:57:03 +02:00
Saverio Proto
5876cd389f olsrd: bump to version 0.9.0.3 2015-09-21 10:40:34 +02:00
Bastian Bittorf
cf17e79ae5 Merge pull request #139 from HRogge/for-15.05
update to v0.9.2
2015-09-09 01:40:10 +02:00
Henning Rogge
7a882de7cc update to v0.9.2 2015-09-08 18:26:46 +02:00
Bastian Bittorf
f2a462fa65 Merge pull request #128 from HRogge/for-15.05
OONF Init script fix for the case that /var/etc does not exist
2015-08-13 14:53:48 +02:00
Henning Rogge
b8e9b6486b Move OONF temporary config to /var/run 2015-08-12 16:59:36 +02:00
Henning Rogge
79325157d0 Merge remote-tracking branch 'openwrt/for-15.05' into for-15.05 2015-08-10 14:13:43 +02:00
Henning Rogge
94fd3231da OONF Init script fix for the case that /var/etc does not exist 2015-08-10 13:53:25 +02:00
Axel Neumann
c2871131b4 [bmx6] update to latest bmx6-master branch (fix rule corruption on the fly) 2015-08-07 20:44:02 +02:00
Bastian Bittorf
217048f800 Merge pull request #122 from HRogge/for-15.05
Unified openwrt init files for OONF
2015-08-06 22:46:01 +02:00
Henning Rogge
57658dbe2a Unified openwrt init files for OONF 2015-08-06 21:43:33 +02:00
Bastian Bittorf
0e8fd185c2 Merge pull request #119 from HRogge/for-15.05
OONF v0.9.1 for chaos calmer
2015-08-05 16:21:24 +02:00
Henning Rogge
b13b00b0ec OONF v0.9.1 for chaos calmer 2015-08-05 13:19:59 +02:00
Steven Barth
0a514a34e7 miniupnpd: shorten OS name to silence SSDP warnings
Signed-off-by: Steven Barth <steven@midlink.org>
2015-07-15 08:29:56 +02:00
Steven Barth
14204998ea minimalist-pcpproxy: fix uci call in default-script
Signed-off-by: Steven Barth <steven@midlink.org>
2015-07-15 08:29:48 +02:00
Steven Barth
dea54bb9f3 hnetd: fix issues on 32-bit platforms
Signed-off-by: Steven Barth <steven@midlink.org>
2015-07-15 08:29:37 +02:00
Markus Stenberg
8636d0d894 hnetd: Bump. Some corner case fixes + dncp-07/hncp-07 compatibility (more or less). 2015-07-15 08:29:29 +02:00
Steven Barth
4e0fa4f572 nat46: fix netfilter references
Signed-off-by: Steven Barth <steven@midlink.org>
2015-07-02 20:54:27 +02:00
Bastian Bittorf
4d8398f4ec olsrd: for15.05: 0.9.0.1 -> 0.9.0.2 (bugfix-release) 2015-07-01 21:33:04 +02:00
Steven Barth
aeb176d818 nat46: fix leak of conntrack entries, fix checksum calculation
Signed-off-by: Steven Barth <steven@midlink.org>
2015-06-30 15:56:34 +02:00
Bastian Bittorf
f5eab926d7 olsrd: bump to version 0.9.0.1 (bugfixes)
We did a bug-fix release of olsrd v1.
It fixes a route-recalculation issue and at least one crash.

Everyone using olsrd v1 is strongly urged to upgrade, especially people
using Smart-Gateway.

The shortlog is appended.

0.9.0.1 -------------------------------------------------------------------

Ferry Huberts (3):
      neighbors: signal link changes when deleting a neighbor
      jsoninfo: do not output smart-gateway info when not enabled.
      txtinfo: do not output smart-gateway info when not enabled.

Henning Rogge (2):
      Update version after release of v0.9.0
      Release v0.9.0.1
2015-06-24 22:58:01 +02:00
Gabriel Kerneis
2f6ed8abd1 babeld: bump to 1.6.1
16 June 2015: babeld-1.6.1.
  * Fixed a buffer overflow in zone_equal.  This is probably not
    exploitable, but might cause incorrect routing tables in the presence
    of source-specific routing.
  * Added support for defaulting ipv6-subtrees automatically based on the
    kernel version.
  * Fixed compilation under musl.

Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2015-06-17 12:27:03 +02:00
Steven Barth
5d29a11161 hnetd: stability improvements
Signed-off-by: Steven Barth <steven@midlink.org>
2015-06-17 11:13:47 +02:00
Axel Neumann
ebcfa63254 bmx6: bump to latest (auto tunOutTimeout) version 2015-06-16 15:29:39 +02:00
Markus Stenberg
a8ec8f672e miniupnpd: Bump to 1.9.20150609. 2015-06-15 13:15:12 +02:00
Steven Barth
f789112125 hnetd: stability improvements
Signed-off-by: Steven Barth <steven@midlink.org>
2015-06-09 08:44:32 +02:00
Axel Neumann
168ee1c50b bmx6: bump to latest (--tunnel and --redistTable fixing) version 2015-06-05 16:42:03 +02:00
Steven Barth
2bca6fb55f babels: obsoleted by babeld
Signed-off-by: Steven Barth <steven@midlink.org>
2015-05-28 08:34:38 +02:00
Steven Barth
f7f1ccfdb7 hnetd: switch to babeld instead of babels
Signed-off-by: Steven Barth <steven@midlink.org>
2015-05-28 08:19:22 +02:00
Steven Barth
4b4b01efff hnetd: bump to latest
Signed-off-by: Steven Barth <steven@midlink.org>
2015-05-28 08:16:11 +02:00
Gabriel Kerneis
4489688125 babeld: allow changing alternative configuration file and directory
Signed-off-by: Gabriel Kerneis <kerneis@google.com>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-26 08:56:05 +02:00
Steven Barth
8978061d1c babeld: remove unnecessary librt linking & dependency
Signed-off-by: Steven Barth <steven@midlink.org>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-26 08:55:58 +02:00
Steven Barth
991dd1fc82 babeld: add support for dynamic config files
Signed-off-by: Steven Barth <steven@midlink.org>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-26 08:55:51 +02:00
Lars
3f5520edda Merge pull request #101 from dangowrt/update-cjdns-for-15.05
cjdns: update source, bump release
2015-05-21 23:41:31 +02:00
Daniel Golle
c067288758 cjdns: update source, bump release
Fixes seccomp on ARM or musl-based builds, notable upstream changes:
a97c189 fix Hex_test unit test
4bceb72 seccomp: allow readv and writev syscalls (used by musl)
64f4791 seccomp: define GET_SYSCALL_NUM accessor macro
0102181 seccomp: allow gettimeofday syscall (required on ARM)
18979ee Add a check to prevent a rare assertion failure

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-05-21 13:27:12 +02:00
Lars Gierth
b1c3bdfbf4 luci-app-cjdns: bump release
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars Gierth
febc9ff92b cjdns: bump release
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars Gierth
d7c9e1bc5e luci-app-cjdns: add seccomp checkbox
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars Gierth
fc1aec3116 cjdns: add seccomp config flag
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars Gierth
a6da56d4c3 luci-app-cjdns: add copyright notice to Makefile
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars Gierth
9a4461cd20 cjdns: add copyright notice to Makefile
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-05-13 01:47:38 +02:00
Lars
e1da56cd9d Merge pull request #98 from SeattleMeshnet/for-15.05
cjdns: update source, bump release
2015-05-12 21:37:50 +02:00
Daniel Golle
b439c8771a cjdns: update source, bump release
upstream changes:
3d879c0 typo in GET32()
f964d14 Fixed IpTunnel unaligned access, thanks Viric for pointing it out
a05ade4 attempt to fix a rare assertion failure
6f1fdd8 Fix a memory leak in InterfaceController.c

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-05-12 21:04:26 +02:00
Markus Stenberg
c0fcae0d4e hnetd: Update to the latest. 2015-05-12 09:27:40 +02:00
Steven Barth
650a820269 miniupnpd: remove libnfnetlink dependency
Signed-off-by: Steven Barth <steven@midlink.org>
2015-05-12 09:27:39 +02:00
Markus Stenberg
7deb0f0238 miniupnpd: Bumped to 1.9.20150430. Seems to work in my tests. 2015-05-12 09:27:18 +02:00
91 changed files with 3910 additions and 605 deletions

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=babeld PKG_NAME:=babeld
PKG_VERSION:=1.6.0 PKG_VERSION:=1.7.1
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/ PKG_SOURCE_URL:=https://www.irif.univ-paris-diderot.fr/~jch/software/files/
PKG_MD5SUM:=b0602a6124ddafb37225bd1a2d8abb13 PKG_MD5SUM:=2f71794d4e67f8a5352164ce33611549
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -25,7 +25,7 @@ define Package/babeld
TITLE:=A loop-free distance-vector routing protocol TITLE:=A loop-free distance-vector routing protocol
URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/ URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/
MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info> MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info>
DEPENDS:=+kmod-ipv6 +librt DEPENDS:=+kmod-ipv6
endef endef
define Package/babeld/description define Package/babeld/description
@ -45,6 +45,7 @@ endef
MAKE_FLAGS+= \ MAKE_FLAGS+= \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \
LDLIBS="" \
define Package/babeld/install define Package/babeld/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin

View file

@ -1,10 +1,10 @@
package babeld package babeld
# Configuration set in this file ends up in /var/etc/babeld.conf. # Babeld reads options from the following files (the last one takes precedence
# Babeld is told to use both /etc/babeld.conf and /var/etc/babeld.conf, so # if an option is defined in several places):
# you can use one or the other, or even both at the same time. If an # - the file defined by the option conf_file (default: /etc/babeld.conf),
# option is defined in both files, the version in /var/etc/babeld.conf # - *.conf files in the directory defined by conf_dir (default: /tmp/babel.d/),
# takes precedence. # - this UCI configuration file.
# See "man babeld" for all available options ("Global options"). # See "man babeld" for all available options ("Global options").
# Important: remember to use '_' instead of '-' in option names. # Important: remember to use '_' instead of '-' in option names.
@ -20,6 +20,10 @@ config general
## import-table statement, "option import_table 42" should work. ## import-table statement, "option import_table 42" should work.
# list 'import_table' '42' # list 'import_table' '42'
# list 'import_table' '100' # list 'import_table' '100'
## Alternative configuration file and directory.
## See comment at the top of this file for more details.
# option 'conf_file' '/etc/babeld.conf'
# option 'conf_dir' '/tmp/babel.d/'
config interface config interface
## Remove this line to enable babeld on this interface ## Remove this line to enable babeld on this interface

View file

@ -7,12 +7,13 @@ START=70
pidfile='/var/run/babeld.pid' pidfile='/var/run/babeld.pid'
CONFIGFILE='/var/etc/babeld.conf' CONFIGFILE='/var/etc/babeld.conf'
OTHERCONFIGFILE="/etc/babeld.conf" OTHERCONFIGFILE="/etc/babeld.conf"
OTHERCONFIGDIR="/tmp/babeld.d/"
EXTRA_COMMANDS="status" EXTRA_COMMANDS="status"
EXTRA_HELP=" status Dump Babel's table to the log file." EXTRA_HELP=" status Dump Babel's table to the log file."
# Options to ignore for the global section (old options that are translated # Options to ignore for the global section (old options that are translated
# for backward compatibility with old configuration files) # for backward compatibility with old configuration files)
ignored_options="carrier_sense assume_wireless no_split_horizon random_router_id multicast_address port hello_interval wired_hello_interval smoothing_half_time duplication_priority local_server conf_file" ignored_options="carrier_sense assume_wireless no_split_horizon random_router_id multicast_address port hello_interval wired_hello_interval smoothing_half_time duplication_priority local_server conf_file conf_dir"
# Append a line to the configuration file # Append a line to the configuration file
cfg_append() { cfg_append() {
@ -108,6 +109,13 @@ parse_old_global_options() {
[ "$_bool" -eq 1 ] && add_default_option "wired" "false" [ "$_bool" -eq 1 ] && add_default_option "wired" "false"
config_get_bool _bool "$section" 'no_split_horizon' 0 config_get_bool _bool "$section" 'no_split_horizon' 0
[ "$_bool" -eq 1 ] && add_default_option "split_horizon" "false" [ "$_bool" -eq 1 ] && add_default_option "split_horizon" "false"
# Configure alternative configuration file and directory
local conf_file
config_get conf_file "$section" "conf_file"
[ -n "$conf_file" ] && OTHERCONFIGFILE="$conf_file"
local conf_dir
config_get conf_dir "$section" "conf_dir"
[ -n "$conf_dir" ] && OTHERCONFIGDIR="$conf_dir"
} }
babel_filter() { babel_filter() {
@ -204,8 +212,14 @@ babel_config_cb() {
start() { start() {
mkdir -p /var/lib mkdir -p /var/lib
mkdir -p /var/etc mkdir -p /var/etc
mkdir -p $OTHERCONFIGDIR
# Start by emptying the generated config file # Start by emptying the generated config file
>"$CONFIGFILE" >"$CONFIGFILE"
# Import dynamic config files
for f in $OTHERCONFIGDIR/*.conf; do
[ -f "$f" ] && cat $f >> $CONFIGFILE
done
# First load the whole config file, without callbacks, so that we are # First load the whole config file, without callbacks, so that we are
# aware of all "ignore" options in the second pass. # aware of all "ignore" options in the second pass.
config_load babeld config_load babeld

View file

@ -1,69 +0,0 @@
#
# Copyright (C) 2007-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=babels
PKG_SOURCE_VERSION:=1ba29b3e069908d41fd6e263d0d09cd5a551a644
PKG_VERSION:=2015-04-14-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jech/babeld.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=MIT
include $(INCLUDE_DIR)/package.mk
define Package/babels
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
TITLE:=A loop-free distance-vector routing protocol (source-specific)
URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/
MAINTAINER:=Steven Barth <cyrus@openwrt.org>
DEPENDS:=+kmod-ipv6
endef
define Package/babels/description
Babel is a loop-avoiding distance-vector routing protocol roughly based
on DSDV and AODV, but with provisions for link cost estimation and
redistribution of routes from other routing protocols.
While it is optimised for wireless mesh networks, Babel will also work
efficiently on wired networks. It will generate between 1.2 and 2.4 times
the amount of routing traffic that RIPng would generate, while
never counting to infinity.
This is experimental source routing branch, and should be only used if you
know what you are doing.
endef
define Package/babels/conffiles
/etc/babeld.conf
/etc/config/babeld
endef
MAKE_FLAGS+= \
CFLAGS="$(TARGET_CFLAGS) -DIPV6_SUBTREES" \
LDLIBS="" \
define Package/babels/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/babeld.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld
endef
define Build/Compile
echo "#define BABEL_VERSION \"$(PKG_SOURCE_SUBDIR)\"" > $(PKG_BUILD_DIR)/version.h
$(call Build/Compile/Default)
endef
$(eval $(call BuildPackage,babels))

View file

@ -1,38 +0,0 @@
# babel config file
#
# This config file simply documents sample entries.
# "redistribute" means: redistribute routes from other routing protocols
# into babel. "local" means addresses assigned to local interfaces.
#
# You do not need to edit this file: you can use /etc/config/babeld
# instead (sections "interface" and "filter"). Both files can be used
# simultaneously (the rules of this file are executed first).
# the default rules are:
#
## redistribute local
## redistribute deny
#
# this says, redistribute local addresses but no other routes
# redistribute IPv4 default route into babel
## redistribute local ip 0.0.0.0/0 le 0 metric 128
# same but for IPv6
## redistribute local ip ::/0 le 0 metric 128
# don't redistribute all local addresses, only selected ones
# after the first line, the "deny" rules kicks in. After the "deny"
# no redistribute local rules are going to match
## redistribute local ip 192.160.4.0/24
## redistribute local deny
# Babel refuses to redistribute routes with a protocol number of "boot";
# this is standard practice, and means that you cannot easily
# redistribute the default route installed by dhcp. It is however
# possible to redistribute such route by explicitly specifying "proto 3"
# on the redistribute line.
## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128

View file

@ -1,72 +0,0 @@
package babeld
config general
# option 'multicast_address' 'ff02:0:0:0:0:0:1:6'
# option 'port' '6696'
# option 'state_file' '/var/lib/babel-state'
# option 'hello_interval' '4'
# option 'wired_hello_interval' '20'
# option 'diversity' '0,128'
# option 'smoothing_half_time' '4'
# option 'kernel_priority' '0'
# Do not use this option unless you know what you are doing, as it can
# cause persistent route flapping.
## option 'duplication_priority' '0'
# option 'carrier_sense' 'false'
# option 'assume_wireless' 'false'
# option 'no_split_horizon' 'false'
# option 'debug' '0'
# Listen for connections from a front-end, e.g. on port 33123.
## option 'local_server' '33123'
# option 'random_router_id' 'false'
# Keep unfeasible routes
## option 'keep_unfeasible' 'false'
# Use the given kernel routing table for routes inserted by babeld.
## option 'export_table' '0'
# Export routes from the given kernel routing tables.
## list 'import_table' '0'
## list 'import_table' '42'
# The configuration file is not necessary since you can do everything
# from this file.
# option 'conf_file' '/etc/babeld.conf'
# option 'log_file' '/var/log/babeld.log'
# You can use aliases (like lan, wlan) or real names (like eth0.0).
# If you use an alias, it must be already defined when babeld starts.
# Otherwise, the name is taken literally and the interface can be
# brought up later (useful for tunnels for instance).
config interface wlan
# Remove this line to enable babeld on this interface
option 'ignore' 'true'
# option 'wired' 'auto'
# option 'link_quality' 'auto'
# option 'split_horizon' 'auto'
# The default is 96 for wired interfaces, and 256 for wireless ones
## option 'rxcost' '256'
# The default is specified with the -h and -H command-line flags.
## option 'hello_interval' '4'
# This can be set to a fairly large value, unless significant
# packet loss is expected. The default is four times the hello
# interval.
## option 'update_interval' '16'
config interface lan
option 'ignore' 'true'
# A filter consists in a type ('in', 'out' or 'redistribute'), an action
# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq',
# etc.). See /etc/babeld.conf for more details.
# Here is a sample filter wich redistributes the default route if its
# protocol number is "boot", e.g. when it installed by dhcp. It is
# disabled by default.
config filter
option 'ignore' 'true'
# Type
option 'type' 'redistribute'
# Selectors: ip, eq, le, ge, neigh, id, proto, local, if
option 'ip' '0.0.0.0/0'
option 'le' '0'
option 'proto' '3'
# Action
option 'action' 'metric 128'

View file

@ -1,154 +0,0 @@
#!/bin/sh /etc/rc.common
START=70
pidfile='/var/run/babeld.pid'
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Dump Babel's table to the log file."
listen_ifname() {
local ifname=$(uci_get_state network "$1" ifname "$1")
local switch="$2"
append args "$switch $ifname"
append interfaces "$ifname"
}
append_ifname() {
local section="$1"
local option="$2"
local switch="$3"
local _name
config_get _name "$section" "$option"
[ -z "$_name" ] && return 0
local ifname=$(uci_get_state network "$_name" ifname "$_name")
append args "$switch $ifname"
}
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option" 0
[ "$_loctmp" -gt 0 ] && append args "$value"
}
append_switch() {
local value="$1"
local switch="$2"
append args "$switch $value"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
local _loctmp
config_get _loctmp "$section" "$option"
[ -z "$_loctmp" ] && return 0
append args "$switch $_loctmp"
}
babel_filter() {
local cfg="$1"
local _loctmp
local _ignored
config_get_bool _ignored "$cfg" 'ignore' 0
[ "$_ignored" -eq 1 ] && return 0
append args "-C '"
append_parm "$cfg" 'type' ''
append_bool "$cfg" 'local' 'local'
append_parm "$cfg" 'ip' 'ip'
append_parm "$cfg" 'eq' 'eq'
append_parm "$cfg" 'le' 'le'
append_parm "$cfg" 'ge' 'ge'
append_parm "$cfg" 'src_ip' 'src-ip'
append_parm "$cfg" 'src_eq' 'src-eq'
append_parm "$cfg" 'src_le' 'src-le'
append_parm "$cfg" 'src_ge' 'src-ge'
append_parm "$cfg" 'neigh' 'neigh'
append_parm "$cfg" 'id' 'id'
append_parm "$cfg" 'proto' 'proto'
append_ifname "$cfg" 'if' 'if'
append_parm "$cfg" 'action' ''
append args ' ' "'"
}
babel_addif() {
local cfg="$1"
local _ignored
config_get_bool _ignored "$cfg" 'ignore' 0
[ "$_ignored" -eq 1 ] && return 0
listen_ifname "$cfg" "-C 'interface"
append_parm "$cfg" 'wired' 'wired'
append_parm "$cfg" 'link_quality' 'link-quality'
append_parm "$cfg" 'split_horizon' 'split-horizon'
append_parm "$cfg" 'rxcost' 'rxcost'
append_parm "$cfg" 'hello_interval' 'hello-interval'
append_parm "$cfg" 'update_interval' 'update-interval'
append args ' ' "'"
}
babel_config() {
local cfg="$1"
append_bool "$cfg" 'carrier_sense' '-l'
append_bool "$cfg" 'assume_wireless' '-w'
append_bool "$cfg" 'no_split_horizon' '-s'
append_bool "$cfg" 'keep_unfeasible' '-u'
append_bool "$cfg" 'random_router_id' '-r'
append_parm "$cfg" 'multicast_address' '-m'
append_parm "$cfg" 'port' '-p'
append_parm "$cfg" 'state_file' '-S'
append_parm "$cfg" 'hello_interval' '-h'
append_parm "$cfg" 'wired_hello_interval' '-H'
append_parm "$cfg" 'diversity' '-z'
append_parm "$cfg" 'smoothing_half_time' '-M'
append_parm "$cfg" 'kernel_priority' '-k'
append_parm "$cfg" 'duplication_priority' '-A'
append_parm "$cfg" 'debug' '-d'
append_parm "$cfg" 'local_server' '-g'
append_parm "$cfg" 'export_table' '-t'
config_list_foreach "$cfg" 'import_table' append_switch '-T'
append_parm "$cfg" 'conf_file' '-c'
append_parm "$cfg" 'log_file' '-L'
}
start() {
mkdir -p /var/lib
config_load babeld
unset args
unset interfaces
config_foreach babel_config general
config_foreach babel_addif interface
config_foreach babel_filter filter
[ -z "$interfaces" ] && return 0
eval "/usr/sbin/babeld -D -I $pidfile $args $interfaces"
}
stop() {
[ -f "$pidfile" ] && kill $(cat $pidfile)
# avoid race-condition on restart: wait for
# babeld to die for real.
[ -f "$pidfile" ] && sleep 1
[ -f "$pidfile" ] && sleep 1
[ -f "$pidfile" ] && sleep 1
[ -f "$pidfile" ] && exit 42
}
status() {
[ -f "$pidfile" ] && kill -USR1 $(cat $pidfile)
}

View file

@ -1,103 +0,0 @@
From 3fdbb1f797ee9fe9260af92f5d7ea760684cd271 Mon Sep 17 00:00:00 2001
From: Steven Barth <steven@midlink.org>
Date: Tue, 18 Feb 2014 13:18:32 +0100
Subject: [PATCH] Allow routes with source ::/128 for SAS on Linux
Linux uses the source-address :: (unspecified) to lookup routes in the
routing table for connections that are not bound to a specific source
address (e.g. ping6 2001:db8::1). If all default routes are
source-restricted a command like above will result in a "Permission
denied" error and no packets are being sent. Adding a default route with
source ::/128 avoids this issue.
This patch excludes ::/128 from the "martian_prefix" check for source
prefixes and thus allows such auxiliary routes to be distributed.
Signed-off-by: Steven Barth <cyrus@openwrt.org>
---
kernel_netlink.c | 4 ++--
route.c | 4 ++--
util.c | 4 ++--
util.h | 2 +-
xroute.c | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
--- a/kernel_netlink.c
+++ b/kernel_netlink.c
@@ -1243,8 +1243,8 @@ filter_kernel_routes(struct nlmsghdr *nh
if(rc < 0)
return 0;
- if(martian_prefix(current_route->prefix, current_route->plen) ||
- martian_prefix(current_route->src_prefix, current_route->src_plen))
+ if(martian_prefix(current_route->prefix, current_route->plen, 0) ||
+ martian_prefix(current_route->src_prefix, current_route->src_plen, 1))
return 0;
/* Ignore default unreachable routes; no idea where they come from. */
@@ -1946,7 +1946,7 @@ filter_kernel_rules(struct nlmsghdr *nh,
kdebugf("filter_rules: from %s prio %d table %d\n",
format_prefix(src, src_plen), priority, table);
- if(martian_prefix(src, src_plen) || !has_priority)
+ if(martian_prefix(src, src_plen, 1) || !has_priority)
return 0;
i = priority - src_table_prio;
--- a/route.c
+++ b/route.c
@@ -809,12 +809,12 @@ update_route(const unsigned char *id,
if(memcmp(id, myid, 8) == 0)
return NULL;
- if(martian_prefix(prefix, plen)) {
+ if(martian_prefix(prefix, plen, 0)) {
fprintf(stderr, "Rejecting martian route to %s through %s.\n",
format_prefix(prefix, plen), format_address(nexthop));
return NULL;
}
- if(src_plen != 0 && martian_prefix(src_prefix, src_plen)) {
+ if(src_plen != 0 && martian_prefix(src_prefix, src_plen, 1)) {
fprintf(stderr, "Rejecting martian route to %s from %s through %s.\n",
format_prefix(prefix, plen),
format_prefix(src_prefix, src_plen), format_eui64(id));
--- a/util.c
+++ b/util.c
@@ -437,13 +437,13 @@ wait_for_fd(int direction, int fd, int m
}
int
-martian_prefix(const unsigned char *prefix, int plen)
+martian_prefix(const unsigned char *prefix, int plen, int is_source)
{
return
(plen >= 8 && prefix[0] == 0xFF) ||
(plen >= 10 && prefix[0] == 0xFE && (prefix[1] & 0xC0) == 0x80) ||
(plen >= 128 && memcmp(prefix, zeroes, 15) == 0 &&
- (prefix[15] == 0 || prefix[15] == 1)) ||
+ ((prefix[15] == 0 && !is_source) || prefix[15] == 1)) ||
(plen >= 96 && v4mapped(prefix) &&
((plen >= 104 && (prefix[12] == 127 || prefix[12] == 0)) ||
(plen >= 100 && (prefix[12] & 0xE0) == 0xE0)));
--- a/util.h
+++ b/util.h
@@ -106,7 +106,7 @@ int parse_net(const char *net, unsigned
int *af_r);
int parse_eui64(const char *eui, unsigned char *eui_r);
int wait_for_fd(int direction, int fd, int msecs);
-int martian_prefix(const unsigned char *prefix, int plen) ATTRIBUTE ((pure));
+int martian_prefix(const unsigned char *prefix, int plen, int is_source) ATTRIBUTE ((pure));
int linklocal(const unsigned char *address) ATTRIBUTE ((pure));
int v4mapped(const unsigned char *address) ATTRIBUTE ((pure));
void v4tov6(unsigned char *dst, const unsigned char *src);
--- a/xroute.c
+++ b/xroute.c
@@ -264,7 +264,7 @@ check_xroutes(int send_updates)
/* Add any new routes */
for(i = 0; i < numroutes; i++) {
- if(martian_prefix(routes[i].prefix, routes[i].plen))
+ if(martian_prefix(routes[i].prefix, routes[i].plen, 0))
continue;
metric = redistribute_filter(routes[i].prefix, routes[i].plen,
routes[i].src_prefix, routes[i].src_plen,

View file

@ -1,11 +0,0 @@
--- a/babeld.c
+++ b/babeld.c
@@ -60,7 +60,7 @@ int debug = 0;
int link_detect = 0;
int all_wireless = 0;
-int has_ipv6_subtrees = 0;
+int has_ipv6_subtrees = 1;
int default_wireless_hello_interval = -1;
int default_wired_hello_interval = -1;
int resend_delay = -1;

View file

@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batctl PKG_NAME:=batctl
PKG_VERSION:=2014.4.0 PKG_VERSION:=2016.1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MD5SUM:=f3a14565699313258ee6ba3de783eb0a PKG_MD5SUM:=b98a6e3b45927315cd6d4efba4c1a1ff
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
@ -22,7 +22,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/batctl define Package/batctl
URL:=http://www.open-mesh.org/ URL:=https://www.open-mesh.org/
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+kmod-batman-adv +libnl-tiny +libc DEPENDS:=+kmod-batman-adv +libnl-tiny +libc

View file

@ -24,3 +24,7 @@ config KMOD_BATMAN_ADV_NC
depends on PACKAGE_kmod-batman-adv depends on PACKAGE_kmod-batman-adv
default n default n
config KMOD_BATMAN_ADV_BATMAN_V
bool "enable batman v routing algorithm"
depends on PACKAGE_kmod-batman-adv
default n

View file

@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv PKG_NAME:=batman-adv
PKG_VERSION:=2014.4.0 PKG_VERSION:=2016.1
PKG_RELEASE:=1 PKG_RELEASE:=3
PKG_MD5SUM:=b1518e84ce530883d224c6ca4c673ce8 PKG_MD5SUM:=8c8e449009b4d29512d26ee308960bb5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
@ -24,13 +24,13 @@ include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
define KernelPackage/batman-adv define KernelPackage/batman-adv
URL:=http://www.open-mesh.org/ URL:=https://www.open-mesh.org/
MAINTAINER:=Marek Lindner <mareklindner@neomailbox.ch> MAINTAINER:=Marek Lindner <mareklindner@neomailbox.ch>
SUBMENU:=Network Support SUBMENU:=Network Support
DEPENDS:=+KMOD_BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-crypto-core +kmod-crypto-crc32c +kmod-lib-crc32c DEPENDS:=+KMOD_BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +kmod-cfg80211
TITLE:=B.A.T.M.A.N. Adv TITLE:=B.A.T.M.A.N. Adv
FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX) FILES:=$(PKG_BUILD_DIR)/net/batman-adv/batman-adv.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,50,batman-adv) AUTOLOAD:=$(call AutoLoad,50,cfg80211 batman-adv)
endef endef
define KernelPackage/batman-adv/description define KernelPackage/batman-adv/description
@ -47,29 +47,44 @@ define Package/kmod-batman-adv/conffiles
/etc/config/batman-adv /etc/config/batman-adv
endef endef
MAKE_BATMAN_ADV_ARGS += \ PKG_EXTRA_KCONFIG:= \
CROSS_COMPILE="$(TARGET_CROSS)" \ CONFIG_BATMAN_ADV=m \
KERNELPATH="$(LINUX_DIR)" \
ARCH="$(LINUX_KARCH)" \
PATH="$(TARGET_PATH)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
PWD="$(PKG_BUILD_DIR)" \
LINUX_VERSION="$(LINUX_VERSION)" \
CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \ CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \
CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \ CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \
CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \ CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \
CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),y,n) \ CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),y,n) \
CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \ CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \
REVISION="" all CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_KMOD_BATMAN_ADV_BATMAN_V),y,n) \
PKG_EXTRA_CFLAGS:= \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR)/net/batman-adv \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-include backport/backport.h \
-include $(PKG_BUILD_DIR)/compat-hacks.h
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
SUBDIRS="$(PKG_BUILD_DIR)/net/batman-adv" \
$(PKG_EXTRA_KCONFIG) \
EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules
endef
define Build/Prepare define Build/Prepare
$(call Build/Prepare/Default) $(call Build/Prepare/Default)
$(CP) ./files/compat-hacks.h $(PKG_BUILD_DIR)/
$(SED) '/#define _NET_BATMAN_ADV_MAIN_H_/a\#undef CONFIG_MODULE_STRIPPED' \ $(SED) '/#define _NET_BATMAN_ADV_MAIN_H_/a\#undef CONFIG_MODULE_STRIPPED' \
$(PKG_BUILD_DIR)/main.h $(PKG_BUILD_DIR)/net/batman-adv/main.h
endef
define Build/Compile
$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS)
endef endef
define Build/Clean define Build/Clean

View file

@ -0,0 +1,76 @@
/* Please avoid adding hacks here - instead add it to mac80211/backports.git */
#include <linux/version.h> /* LINUX_VERSION_CODE */
#include <linux/types.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
#define dev_get_iflink(_net_dev) ((_net_dev)->iflink)
#endif /* < KERNEL_VERSION(4, 1, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
#include <linux/netdevice.h>
#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) ({\
BUILD_BUG_ON(upper_priv != NULL); \
BUILD_BUG_ON(upper_info != NULL); \
netdev_set_master(dev, upper_dev); \
})
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
#include <linux/netdevice.h>
#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) ({\
BUILD_BUG_ON(upper_priv != NULL); \
BUILD_BUG_ON(upper_info != NULL); \
netdev_master_upper_dev_link(dev, upper_dev); \
})
#endif /* < KERNEL_VERSION(4, 5, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
#define IFF_NO_QUEUE 0; dev->tx_queue_len = 0
#endif /* < KERNEL_VERSION(4, 3, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
#include <linux/ethtool.h>
#define ethtool_link_ksettings batadv_ethtool_link_ksettings
struct batadv_ethtool_link_ksettings {
struct {
__u32 speed;
__u8 duplex;
} base;
};
#define __ethtool_get_link_ksettings(__dev, __link_settings) \
batadv_ethtool_get_link_ksettings(__dev, __link_settings)
static inline int
batadv_ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *link_ksettings)
{
struct ethtool_cmd cmd;
int ret;
memset(&cmd, 0, sizeof(cmd));
ret = __ethtool_get_settings(dev, &cmd);
if (ret != 0)
return ret;
link_ksettings->base.duplex = cmd.duplex;
link_ksettings->base.speed = ethtool_cmd_speed(&cmd);
return 0;
}
#endif /* < KERNEL_VERSION(4, 6, 0) */

View file

@ -6,14 +6,18 @@ init_proto "$@"
proto_batadv_init_config() { proto_batadv_init_config() {
proto_config_add_string "mesh" proto_config_add_string "mesh"
proto_config_add_string "routing_algo"
} }
proto_batadv_setup() { proto_batadv_setup() {
local config="$1" local config="$1"
local iface="$2" local iface="$2"
local mesh local mesh routing_algo
json_get_vars mesh json_get_vars mesh routing_algo
[ -n "$routing_algo" ] || routing_algo="BATMAN_IV"
echo "$routing_algo" > "/sys/module/batman_adv/parameters/routing_algo"
echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface" echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface"
proto_init_update "$iface" 1 proto_init_update "$iface" 1

View file

@ -0,0 +1,64 @@
From a636bf0b69010222ea58337d425ca9ff8ce52639 Mon Sep 17 00:00:00 2001
From: Antonio Quartulli <a@unstable.cc>
Date: Mon, 2 May 2016 18:27:38 +0800
Subject: [PATCH 1/6] batman-adv: make sure ELP/OGM orig MAC is updated on
address change
When the MAC address of the primary interface is changed,
update the originator address in the ELP and OGM skb buffers as
well in order to reflect the change.
Fixes: a4b88af77e28 ("batman-adv: ELP - adding basic infrastructure")
Reported-by: Marek Lindner <marek@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/bat_v.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 4026f19..4547fce 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -72,16 +72,34 @@ static void batadv_v_iface_disable(struct batadv_hard_iface *hard_iface)
batadv_v_elp_iface_disable(hard_iface);
}
-static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
-{
-}
-
static void batadv_v_primary_iface_set(struct batadv_hard_iface *hard_iface)
{
batadv_v_elp_primary_iface_set(hard_iface);
batadv_v_ogm_primary_iface_set(hard_iface);
}
+/**
+ * batadv_v_iface_update_mac - react to hard-interface MAC address change
+ * @hard_iface: the modified interface
+ *
+ * If the modified interface is the primary one, update the originator
+ * address in the ELP and OGM messages to reflect the new MAC address.
+ */
+static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
+{
+ struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
+ struct batadv_hard_iface *primary_if;
+
+ primary_if = batadv_primary_if_get_selected(bat_priv);
+ if (primary_if != hard_iface)
+ goto out;
+
+ batadv_v_primary_iface_set(hard_iface);
+out:
+ if (primary_if)
+ batadv_hardif_put(primary_if);
+}
+
static void
batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh)
{
--
2.8.0.rc3

View file

@ -0,0 +1,89 @@
From 8013ae257447c99d7ba037967458f91ceb4051ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
Date: Thu, 7 Jan 2016 08:11:12 +0100
Subject: [PATCH 2/6] batman-adv: Avoid duplicate neigh_node additions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Two parallel calls to batadv_neigh_node_new() might race for creating
and adding the same neig_node. Fix this by including the check for any
already existing, identical neigh_node within the spin-lock.
This fixes splats like the following:
[ 739.535069] ------------[ cut here ]------------
[ 739.535079] WARNING: CPU: 0 PID: 0 at /usr/src/batman-adv/git/batman-adv/net/batman-adv/bat_iv_ogm.c:1004 batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]()
[ 739.535092] too many matching neigh_nodes
[ 739.535094] Modules linked in: dm_mod tun ip6table_filter ip6table_mangle ip6table_nat nf_nat_ipv6 ip6_tables xt_nat iptable_nat nf_nat_ipv4 nf_nat xt_TCPMSS xt_mark iptable_mangle xt_tcpudp xt_conntrack iptable_filter ip_tables x_tables ip_gre ip_tunnel gre bridge stp llc thermal_sys kvm_intel kvm crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd evdev pcspkr ip6_gre ip6_tunnel tunnel6 batman_adv(O) libcrc32c nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack autofs4 ext4 crc16 mbcache jbd2 xen_netfront xen_blkfront crc32c_intel
[ 739.535177] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 4.2.0-0.bpo.1-amd64 #1 Debian 4.2.6-3~bpo8+2
[ 739.535186] 0000000000000000 ffffffffa013b050 ffffffff81554521 ffff88007d003c18
[ 739.535201] ffffffff8106fa01 0000000000000000 ffff8800047a087a ffff880079c3a000
[ 739.735602] ffff88007b82bf40 ffff88007bc2d1c0 ffffffff8106fa7a ffffffffa013aa8e
[ 739.735624] Call Trace:
[ 739.735639] <IRQ> [<ffffffff81554521>] ? dump_stack+0x40/0x50
[ 739.735677] [<ffffffff8106fa01>] ? warn_slowpath_common+0x81/0xb0
[ 739.735692] [<ffffffff8106fa7a>] ? warn_slowpath_fmt+0x4a/0x50
[ 739.735715] [<ffffffffa012448f>] ? batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]
[ 739.735740] [<ffffffffa0124813>] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
[ 739.735762] [<ffffffffa0124813>] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
[ 739.735783] [<ffffffff810b0841>] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
[ 739.735804] [<ffffffffa012cb39>] ? batadv_batman_skb_recv+0xc9/0x110 [batman_adv]
[ 739.735825] [<ffffffff81464891>] ? __netif_receive_skb_core+0x841/0x9a0
[ 739.735838] [<ffffffff810b0841>] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
[ 739.735853] [<ffffffff81465681>] ? process_backlog+0xa1/0x140
[ 739.735864] [<ffffffff81464f1a>] ? net_rx_action+0x20a/0x320
[ 739.735878] [<ffffffff81073aa7>] ? __do_softirq+0x107/0x270
[ 739.735891] [<ffffffff81073d82>] ? irq_exit+0x92/0xa0
[ 739.735905] [<ffffffff8137e0d1>] ? xen_evtchn_do_upcall+0x31/0x40
[ 739.735924] [<ffffffff8155b8fe>] ? xen_do_hypervisor_callback+0x1e/0x40
[ 739.735939] <EOI> [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[ 739.735965] [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
[ 739.735979] [<ffffffff8100a39c>] ? xen_safe_halt+0xc/0x20
[ 739.735991] [<ffffffff8101da6c>] ? default_idle+0x1c/0xa0
[ 739.736004] [<ffffffff810abf6b>] ? cpu_startup_entry+0x2eb/0x350
[ 739.736019] [<ffffffff81b2af5e>] ? start_kernel+0x480/0x48b
[ 739.736032] [<ffffffff81b2d116>] ? xen_start_kernel+0x507/0x511
[ 739.736048] ---[ end trace c106bb901244bc8c ]---
Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/originator.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index c355a82..28241a4 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -630,6 +630,8 @@ batadv_neigh_node_new(struct batadv_orig_node *orig_node,
struct batadv_neigh_node *neigh_node;
struct batadv_hardif_neigh_node *hardif_neigh = NULL;
+ spin_lock_bh(&orig_node->neigh_list_lock);
+
neigh_node = batadv_neigh_node_get(orig_node, hard_iface, neigh_addr);
if (neigh_node)
goto out;
@@ -666,15 +668,15 @@ batadv_neigh_node_new(struct batadv_orig_node *orig_node,
kref_init(&neigh_node->refcount);
kref_get(&neigh_node->refcount);
- spin_lock_bh(&orig_node->neigh_list_lock);
hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list);
- spin_unlock_bh(&orig_node->neigh_list_lock);
batadv_dbg(BATADV_DBG_BATMAN, orig_node->bat_priv,
"Creating new neighbor %pM for orig_node %pM on interface %s\n",
neigh_addr, orig_node->orig, hard_iface->net_dev->name);
out:
+ spin_unlock_bh(&orig_node->neigh_list_lock);
+
if (hardif_neigh)
batadv_hardif_neigh_put(hardif_neigh);
return neigh_node;
--
2.8.0.rc3

View file

@ -0,0 +1,38 @@
From 036aa7b7181ee96ae6971eb31dd97b6ace7c0a80 Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 6 May 2016 11:43:38 +0200
Subject: [PATCH 3/6] batman-adv: Avoid nullptr derefence in
batadv_v_neigh_is_sob
batadv_neigh_ifinfo_get can return NULL when it cannot find (even when only
temporarily) anymore the neigh_ifinfo in the list neigh->ifinfo_list. This
has to be checked to avoid kernel Oopses when the ifinfo is dereferenced.
This a situation which isn't expected but is already handled by functions
like batadv_v_neigh_cmp. The same kind of warning is therefore used before
the function returns without dereferencing the pointers.
Fixes: b05bbab5e1fc ("batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/bat_v.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 4547fce..7e1467a 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -295,6 +295,9 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
+ if (WARN_ON(!ifinfo1 || !ifinfo2))
+ return false;
+
threshold = ifinfo1->bat_v.throughput / 4;
threshold = ifinfo1->bat_v.throughput - threshold;
--
2.8.0.rc3

View file

@ -0,0 +1,81 @@
From 650d41de4be2fe9e9d1842c1abdd357dedbaa7ba Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 6 May 2016 11:43:39 +0200
Subject: [PATCH 4/6] batman-adv: Fix refcnt leak in batadv_v_neigh_*
The functions batadv_neigh_ifinfo_get increase the reference counter of the
batadv_neigh_ifinfo. These have to be reduced again when the reference is
not used anymore to correctly free the objects.
Fixes: b05bbab5e1fc ("batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/bat_v.c | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 7e1467a..2bcb29b 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -274,14 +274,23 @@ static int batadv_v_neigh_cmp(struct batadv_neigh_node *neigh1,
struct batadv_hard_iface *if_outgoing2)
{
struct batadv_neigh_ifinfo *ifinfo1, *ifinfo2;
+ int ret = 0;
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
+ if (WARN_ON(!ifinfo1))
+ goto err_ifinfo1;
+
ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
+ if (WARN_ON(!ifinfo2))
+ goto err_ifinfo2;
- if (WARN_ON(!ifinfo1 || !ifinfo2))
- return 0;
+ ret = ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
- return ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
+ batadv_neigh_ifinfo_put(ifinfo2);
+err_ifinfo2:
+ batadv_neigh_ifinfo_put(ifinfo1);
+err_ifinfo1:
+ return ret;
}
static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
@@ -291,17 +300,26 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
{
struct batadv_neigh_ifinfo *ifinfo1, *ifinfo2;
u32 threshold;
+ bool ret = false;
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
- ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
+ if (WARN_ON(!ifinfo1))
+ goto err_ifinfo1;
- if (WARN_ON(!ifinfo1 || !ifinfo2))
- return false;
+ ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
+ if (WARN_ON(!ifinfo2))
+ goto err_ifinfo2;
threshold = ifinfo1->bat_v.throughput / 4;
threshold = ifinfo1->bat_v.throughput - threshold;
- return ifinfo2->bat_v.throughput > threshold;
+ ret = ifinfo2->bat_v.throughput > threshold;
+
+ batadv_neigh_ifinfo_put(ifinfo2);
+err_ifinfo2:
+ batadv_neigh_ifinfo_put(ifinfo1);
+err_ifinfo1:
+ return ret;
}
static struct batadv_algo_ops batadv_batman_v __read_mostly = {
--
2.8.0.rc3

View file

@ -0,0 +1,40 @@
From fc3e79d9ef2a1006f94e441d9613749cbbe7176a Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 6 May 2016 22:27:09 +0200
Subject: [PATCH 5/6] batman-adv: Fix double neigh_node_put in
batadv_v_ogm_route_update
The router is put down twice when it was non-NULL and either orig_ifinfo is
NULL afterwards or batman-adv receives a packet with the same sequence
number. This will end up in a use-after-free when the batadv_neigh_node is
removed because the reference counter ended up too early at 0.
Fixes: 667996ebeab4 ("batman-adv: OGMv2 - implement originators logic")
Reported-by: Gui Iribarren <gui@altermundi.net>
Tested-by: Antonio Quartulli <a@unstable.cc>
Tested-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/bat_v_ogm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index d9bcbe6..91df28a 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -529,8 +529,10 @@ static void batadv_v_ogm_route_update(struct batadv_priv *bat_priv,
goto out;
}
- if (router)
+ if (router) {
batadv_neigh_node_put(router);
+ router = NULL;
+ }
/* Update routes, and check if the OGM is from the best next hop */
batadv_v_ogm_orig_update(bat_priv, orig_node, neigh_node, ogm2,
--
2.8.0.rc3

View file

@ -0,0 +1,110 @@
From f58a0b03873fd3aa9568c11af198f997ed2208cc Mon Sep 17 00:00:00 2001
From: Marek Lindner <mareklindner@neomailbox.ch>
Date: Sat, 7 May 2016 19:54:17 +0800
Subject: [PATCH 6/6] batman-adv: initialize ELP orig address on secondary
interfaces
This fix prevents nodes to wrongly create a 00:00:00:00:00:00 originator
which can potentially interfere with the rest of the neighbor statistics.
Fixes: a4b88af77e28 ("batman-adv: ELP - adding basic infrastructure")
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/bat_v.c | 10 ++++++++++
net/batman-adv/bat_v_elp.c | 31 ++++++++++++++++++++++---------
net/batman-adv/bat_v_elp.h | 2 ++
3 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 2bcb29b..0caca2f 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -39,6 +39,16 @@
static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface)
{
+ struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
+ struct batadv_hard_iface *primary_if;
+
+ primary_if = batadv_primary_if_get_selected(bat_priv);
+
+ if (primary_if) {
+ batadv_v_elp_iface_activate(primary_if, hard_iface);
+ batadv_hardif_put(primary_if);
+ }
+
/* B.A.T.M.A.N. V does not use any queuing mechanism, therefore it can
* set the interface as ACTIVE right away, without any risk of race
* condition
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 3844e7e..df42eb1 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -377,6 +377,27 @@ void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface)
}
/**
+ * batadv_v_elp_iface_activate - update the ELP buffer belonging to the given
+ * hard-interface
+ * @primary_iface: the new primary interface
+ * @hard_iface: interface holding the to-be-updated buffer
+ */
+void batadv_v_elp_iface_activate(struct batadv_hard_iface *primary_iface,
+ struct batadv_hard_iface *hard_iface)
+{
+ struct batadv_elp_packet *elp_packet;
+ struct sk_buff *skb;
+
+ if (!hard_iface->bat_v.elp_skb)
+ return;
+
+ skb = hard_iface->bat_v.elp_skb;
+ elp_packet = (struct batadv_elp_packet *)skb->data;
+ ether_addr_copy(elp_packet->orig,
+ primary_iface->net_dev->dev_addr);
+}
+
+/**
* batadv_v_elp_primary_iface_set - change internal data to reflect the new
* primary interface
* @primary_iface: the new primary interface
@@ -384,8 +405,6 @@ void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface)
void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)
{
struct batadv_hard_iface *hard_iface;
- struct batadv_elp_packet *elp_packet;
- struct sk_buff *skb;
/* update orig field of every elp iface belonging to this mesh */
rcu_read_lock();
@@ -393,13 +412,7 @@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)
if (primary_iface->soft_iface != hard_iface->soft_iface)
continue;
- if (!hard_iface->bat_v.elp_skb)
- continue;
-
- skb = hard_iface->bat_v.elp_skb;
- elp_packet = (struct batadv_elp_packet *)skb->data;
- ether_addr_copy(elp_packet->orig,
- primary_iface->net_dev->dev_addr);
+ batadv_v_elp_iface_activate(primary_iface, hard_iface);
}
rcu_read_unlock();
}
diff --git a/net/batman-adv/bat_v_elp.h b/net/batman-adv/bat_v_elp.h
index e95f1bc..cc130b2 100644
--- a/net/batman-adv/bat_v_elp.h
+++ b/net/batman-adv/bat_v_elp.h
@@ -25,6 +25,8 @@ struct work_struct;
int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface);
void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface);
+void batadv_v_elp_iface_activate(struct batadv_hard_iface *primary_iface,
+ struct batadv_hard_iface *hard_iface);
void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface);
int batadv_v_elp_packet_recv(struct sk_buff *skb,
struct batadv_hard_iface *if_incoming);
--
2.8.0.rc3

View file

@ -0,0 +1,28 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 7 May 2016 09:50:44 +0200
Subject: [PATCH] batman-adv: Add missing include for batadv_v_neigh_is_sob
batadv_v_neigh_is_sob started to use false which is defined in
linux/stddef.h.
Fixes: 036aa7b7181e ("batman-adv: Avoid nullptr derefence in batadv_v_neigh_is_sob")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/9685688ae7dd85804aec2f6ce760611551fe9635
---
net/batman-adv/bat_v.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 0caca2f..1f960c9 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -27,6 +27,7 @@
#include <linux/rculist.h>
#include <linux/rcupdate.h>
#include <linux/seq_file.h>
+#include <linux/stddef.h>
#include <linux/types.h>
#include <linux/workqueue.h>

View file

@ -0,0 +1,46 @@
From: Florian Westphal <fw@strlen.de>
Date: Tue, 10 May 2016 23:17:59 +0200
Subject: [PATCH] batman-adv: fix skb deref after free
batadv_send_skb_to_orig() calls dev_queue_xmit() so we can't use skb->len.
Fixes: d28785996ad8 ("batman-adv: network coding - buffer unicast packets before forward")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/6863d3b59fd1f1bef3c4b86707a0b1c5d21e0a07
---
net/batman-adv/routing.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index b781bf7..0c0c30e 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -601,6 +601,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
struct batadv_unicast_packet *unicast_packet;
struct ethhdr *ethhdr = eth_hdr(skb);
int res, hdr_len, ret = NET_RX_DROP;
+ unsigned int len;
unicast_packet = (struct batadv_unicast_packet *)skb->data;
@@ -641,6 +642,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
if (hdr_len > 0)
batadv_skb_set_priority(skb, hdr_len);
+ len = skb->len;
res = batadv_send_skb_to_orig(skb, orig_node, recv_if);
/* translate transmit result into receive result */
@@ -648,7 +650,7 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
/* skb was transmitted and consumed */
batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
- skb->len + ETH_HLEN);
+ len + ETH_HLEN);
ret = NET_RX_SUCCESS;
} else if (res == NET_XMIT_POLICED) {

View file

@ -0,0 +1,40 @@
From: Simon Wunderlich <sw@simonwunderlich.de>
Date: Thu, 12 May 2016 18:52:03 +0200
Subject: [PATCH] batman-adv: replace WARN with rate limited output on non-existing VLAN
If a VLAN tagged frame is received and the corresponding VLAN is not
configured on the soft interface, it will splat a WARN on every packet
received. This is a quite annoying behaviour for some scenarios, e.g. if
bat0 is bridged with eth0, and there are arbitrary VLAN tagged frames
from Ethernet coming in without having any VLAN configuration on bat0.
The code should probably create vlan objects on the fly and
transparently transport these VLAN-tagged Ethernet frames, but until
this is done, at least the WARN splat should be replaced by a rate
limited output.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/04792115d24408a72bf8fccd5c4059478fc15eae
---
net/batman-adv/translation-table.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 9b4551a..48adb91 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -650,8 +650,10 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
/* increase the refcounter of the related vlan */
vlan = batadv_softif_vlan_get(bat_priv, vid);
- if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d",
- addr, BATADV_PRINT_VID(vid))) {
+ if (!vlan) {
+ net_ratelimited_function(batadv_info, soft_iface,
+ "adding TT local entry %pM to non-existent VLAN %d\n",
+ addr, BATADV_PRINT_VID(vid));
kfree(tt_local);
tt_local = NULL;
goto out;

View file

@ -0,0 +1,58 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 28 May 2016 10:32:48 +0200
Subject: [PATCH] batman-adv: Fix build against recent Debian Stretch kernels
The kernels for Debian stretch require some special CFLAGS settings which
are only correctly defined when NOSTDINC_FLAGS is defined inside the
execution of the Makefile via kbuild. But batman-adv sets it currently
outside to insert compatibility include headers and compat-sources.
This can be avoided by making the top Makefile kbuild compatible and
redefining the NOSTDINC_FLAGS when kbuild include this Makefile. The actual
build of the batman-adv module is then done by adding the subdirectory to
obj-y.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Origin: https://git.open-mesh.org/batman-adv.git/commit/f8fd441e1e30f3a274c9bf44cc33372d4065cbb6
---
Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 5d2c058..2568fb2 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ RM ?= rm -f
REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
-export NOSTDINC_FLAGS := \
+NOSTDINC_FLAGS += \
-I$(PWD)/compat-include/ \
-include $(PWD)/compat.h \
$(CFLAGS)
@@ -52,8 +52,12 @@ ifneq ($(REVISION),)
NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
endif
+obj-y += net/batman-adv/
+
BUILD_FLAGS := \
- M=$(PWD)/net/batman-adv \
+ M=$(PWD) \
+ PWD=$(PWD) \
+ REVISION=$(REVISION) \
CONFIG_BATMAN_ADV=m \
CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \
CONFIG_BATMAN_ADV_BLA=$(CONFIG_BATMAN_ADV_BLA) \
@@ -61,7 +65,7 @@ BUILD_FLAGS := \
CONFIG_BATMAN_ADV_NC=$(CONFIG_BATMAN_ADV_NC) \
CONFIG_BATMAN_ADV_MCAST=$(CONFIG_BATMAN_ADV_MCAST) \
CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \
- INSTALL_MOD_DIR=updates/net/batman-adv/
+ INSTALL_MOD_DIR=updates/
all: config
$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules

View file

@ -0,0 +1,45 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 28 May 2016 14:38:26 +0200
Subject: [PATCH] batman-adv: Clean up untagged vlan when destroying via rtnl-link
The untagged vlan object is only destroyed when the interface is removed
via the legacy sysfs interface. But it also has to be destroyed when the
standard rtnl-link interface is used.
Fixes: 952cebb57518 ("batman-adv: add per VLAN interface attribute framework")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Antonio Quartulli <a@unstable.cc>
Origin: https://git.open-mesh.org/batman-adv.git/commit/e721749d57ff57d6df4017d62797626eab9902f1
---
net/batman-adv/soft-interface.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 8a136b6..3710620 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1017,7 +1017,9 @@ void batadv_softif_destroy_sysfs(struct net_device *soft_iface)
static void batadv_softif_destroy_netlink(struct net_device *soft_iface,
struct list_head *head)
{
+ struct batadv_priv *bat_priv = netdev_priv(soft_iface);
struct batadv_hard_iface *hard_iface;
+ struct batadv_softif_vlan *vlan;
list_for_each_entry(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->soft_iface == soft_iface)
@@ -1025,6 +1027,13 @@ static void batadv_softif_destroy_netlink(struct net_device *soft_iface,
BATADV_IF_CLEANUP_KEEP);
}
+ /* destroy the "untagged" VLAN */
+ vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS);
+ if (vlan) {
+ batadv_softif_destroy_vlan(bat_priv, vlan);
+ batadv_softif_vlan_put(vlan);
+ }
+
batadv_sysfs_del_meshif(soft_iface);
unregister_netdevice_queue(soft_iface, head);
}

View file

@ -0,0 +1,31 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sun, 29 May 2016 21:25:52 +0200
Subject: [PATCH] batman-adv: Fix ICMP RR ethernet access after skb_linearize
The skb_linearize may reallocate the skb. This makes the calculated pointer
for ethhdr invalid. But it the pointer is used later to fill in the RR
field of the batadv_icmp_packet_rr packet.
Instead re-evaluate eth_hdr after the skb_linearize+skb_cow to fix the
pointer and avoid the invalid read.
Fixes: bb69cb678d37 ("batman-adv: generalize batman-adv icmp packet handling")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/f6c80c29ef4e8b45b715976107b7ae06fc0be3a0
---
net/batman-adv/routing.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 0c0c30e..27e07dd 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -374,6 +374,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
if (skb_cow(skb, ETH_HLEN) < 0)
goto out;
+ ethhdr = eth_hdr(skb);
icmph = (struct batadv_icmp_header *)skb->data;
icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmph;
if (icmp_packet_rr->rr_cur >= BATADV_RR_LEN)

View file

@ -0,0 +1,32 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 3 Jun 2016 00:00:44 +0100
Subject: [PATCH] batman-adv: Fix double-put of vlan object
Commit a33d970d0b54 "batman-adv: Fix reference counting of vlan object
for tt_local_entry") makes each batadv_tt_local_entry hold a single
reference to a batadv_softif_vlan. In case a new entry cannot be
added to the hash table, the error path puts the reference, but the
reference will also now be dropped by batadv_tt_local_entry_release().
Fixes: a33d970d0b54 ("batman-adv: Fix reference counting of vlan object ...")
Cc: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/22bb8b894900064d3fb09032a47577e89fc30d7c
---
net/batman-adv/translation-table.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 48adb91..5ed782b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -693,7 +693,6 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
if (unlikely(hash_added != 0)) {
/* remove the reference for the hash */
batadv_tt_local_entry_put(tt_local);
- batadv_softif_vlan_put(vlan);
goto out;
}

View file

@ -0,0 +1,172 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 4 Jun 2016 08:52:12 +0200
Subject: [PATCH] batman-adv: Fix use-after-free/double-free of tt_req_node
The tt_req_node is added and removed from a list inside a spinlock. But the
locking is sometimes removed even when the object is still referenced and
will be used later via this reference. For example batadv_send_tt_request
can create a new tt_req_node (including add to a list) and later
re-acquires the lock to remove it from the list and to free it. But at this
time another context could have already removed this tt_req_node from the
list and freed it.
CPU#0
batadv_batman_skb_recv from net_device 0
-> batadv_iv_ogm_receive
-> batadv_iv_ogm_process
-> batadv_iv_ogm_process_per_outif
-> batadv_tvlv_ogm_receive
-> batadv_tvlv_ogm_receive
-> batadv_tvlv_containers_process
-> batadv_tvlv_call_handler
-> batadv_tt_tvlv_ogm_handler_v1
-> batadv_tt_update_orig
-> batadv_send_tt_request
-> batadv_tt_req_node_new
spin_lock(...)
allocates new tt_req_node and adds it to list
spin_unlock(...)
return tt_req_node
CPU#1
batadv_batman_skb_recv from net_device 1
-> batadv_recv_unicast_tvlv
-> batadv_tvlv_containers_process
-> batadv_tvlv_call_handler
-> batadv_tt_tvlv_unicast_handler_v1
-> batadv_handle_tt_response
spin_lock(...)
tt_req_node gets removed from list and is freed
spin_unlock(...)
CPU#0
<- returned to batadv_send_tt_request
spin_lock(...)
tt_req_node gets removed from list and is freed
MEMORY CORRUPTION/SEGFAULT/...
spin_unlock(...)
This can only be solved via reference counting to allow multiple contexts
to handle the list manipulation while making sure that only the last
context holding a reference will free the object.
Fixes: cea194d90b11 ("batman-adv: improved client announcement mechanism")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Tested-by: Amadeus Alfa <amadeus@chemnitz.freifunk.net>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/c3fef3d9ec6e8b882f321ec20f6f2cb2ee906503
---
net/batman-adv/translation-table.c | 37 +++++++++++++++++++++++++++++++++----
net/batman-adv/types.h | 2 ++
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 5ed782b..23fb7ea 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2271,6 +2271,29 @@ static u32 batadv_tt_local_crc(struct batadv_priv *bat_priv,
return crc;
}
+/**
+ * batadv_tt_req_node_release - free tt_req node entry
+ * @ref: kref pointer of the tt req_node entry
+ */
+static void batadv_tt_req_node_release(struct kref *ref)
+{
+ struct batadv_tt_req_node *tt_req_node;
+
+ tt_req_node = container_of(ref, struct batadv_tt_req_node, refcount);
+
+ kfree(tt_req_node);
+}
+
+/**
+ * batadv_tt_req_node_put - decrement the tt_req_node refcounter and
+ * possibly release it
+ * @tt_req_node: tt_req_node to be free'd
+ */
+static void batadv_tt_req_node_put(struct batadv_tt_req_node *tt_req_node)
+{
+ kref_put(&tt_req_node->refcount, batadv_tt_req_node_release);
+}
+
static void batadv_tt_req_list_free(struct batadv_priv *bat_priv)
{
struct batadv_tt_req_node *node;
@@ -2280,7 +2303,7 @@ static void batadv_tt_req_list_free(struct batadv_priv *bat_priv)
hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
hlist_del_init(&node->list);
- kfree(node);
+ batadv_tt_req_node_put(node);
}
spin_unlock_bh(&bat_priv->tt.req_list_lock);
@@ -2317,7 +2340,7 @@ static void batadv_tt_req_purge(struct batadv_priv *bat_priv)
if (batadv_has_timed_out(node->issued_at,
BATADV_TT_REQUEST_TIMEOUT)) {
hlist_del_init(&node->list);
- kfree(node);
+ batadv_tt_req_node_put(node);
}
}
spin_unlock_bh(&bat_priv->tt.req_list_lock);
@@ -2349,9 +2372,11 @@ batadv_tt_req_node_new(struct batadv_priv *bat_priv,
if (!tt_req_node)
goto unlock;
+ kref_init(&tt_req_node->refcount);
ether_addr_copy(tt_req_node->addr, orig_node->orig);
tt_req_node->issued_at = jiffies;
+ kref_get(&tt_req_node->refcount);
hlist_add_head(&tt_req_node->list, &bat_priv->tt.req_list);
unlock:
spin_unlock_bh(&bat_priv->tt.req_list_lock);
@@ -2618,9 +2643,13 @@ out:
spin_lock_bh(&bat_priv->tt.req_list_lock);
/* hlist_del_init() verifies tt_req_node still is in the list */
hlist_del_init(&tt_req_node->list);
+ batadv_tt_req_node_put(tt_req_node);
spin_unlock_bh(&bat_priv->tt.req_list_lock);
- kfree(tt_req_node);
}
+
+ if (tt_req_node)
+ batadv_tt_req_node_put(tt_req_node);
+
kfree(tvlv_tt_data);
return ret;
}
@@ -3056,7 +3085,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv,
if (!batadv_compare_eth(node->addr, resp_src))
continue;
hlist_del_init(&node->list);
- kfree(node);
+ batadv_tt_req_node_put(node);
}
spin_unlock_bh(&bat_priv->tt.req_list_lock);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 1e47fbe..d75beef 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1129,11 +1129,13 @@ struct batadv_tt_change_node {
* struct batadv_tt_req_node - data to keep track of the tt requests in flight
* @addr: mac address address of the originator this request was sent to
* @issued_at: timestamp used for purging stale tt requests
+ * @refcount: number of contexts the object is used by
* @list: list node for batadv_priv_tt::req_list
*/
struct batadv_tt_req_node {
u8 addr[ETH_ALEN];
unsigned long issued_at;
+ struct kref refcount;
struct hlist_node list;
};

View file

@ -0,0 +1,35 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 2 Jul 2016 09:52:13 +0200
Subject: [PATCH] batman-adv: Avoid nullptr dereference in bla after vlan_insert_tag
vlan_insert_tag can return NULL on errors. The bridge loop avoidance code
therefore has to check the return value of vlan_insert_tag for NULL before
it can safely operate on this pointer.
Fixes: a9ce0dc43e2c ("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/e4cffba4d3353ea15287abbfbdd65208aa62c156
---
net/batman-adv/bridge_loop_avoidance.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 0a6c8b8..fe8b62f 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -409,9 +409,12 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
break;
}
- if (vid & BATADV_VLAN_HAS_TAG)
+ if (vid & BATADV_VLAN_HAS_TAG) {
skb = vlan_insert_tag(skb, htons(ETH_P_8021Q),
vid & VLAN_VID_MASK);
+ if (!skb)
+ goto out;
+ }
skb_reset_mac_header(skb);
skb->protocol = eth_type_trans(skb, soft_iface);

View file

@ -0,0 +1,49 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 2 Jul 2016 09:52:14 +0200
Subject: [PATCH] batman-adv: Avoid nullptr dereference in dat after vlan_insert_tag
vlan_insert_tag can return NULL on errors. The distributed arp table code
therefore has to check the return value of vlan_insert_tag for NULL before
it can safely operate on this pointer.
Fixes: 53c6c262a581 ("batman-adv: tag locally generated ARP reply if needed")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/898382d11fa1f737cd4f7033db1088c601fd11ed
---
net/batman-adv/distributed-arp-table.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 3e6b262..5a89be0 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1009,9 +1009,12 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
if (!skb_new)
goto out;
- if (vid & BATADV_VLAN_HAS_TAG)
+ if (vid & BATADV_VLAN_HAS_TAG) {
skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q),
vid & VLAN_VID_MASK);
+ if (!skb_new)
+ goto out;
+ }
skb_reset_mac_header(skb_new);
skb_new->protocol = eth_type_trans(skb_new,
@@ -1089,9 +1092,12 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
*/
skb_reset_mac_header(skb_new);
- if (vid & BATADV_VLAN_HAS_TAG)
+ if (vid & BATADV_VLAN_HAS_TAG) {
skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q),
vid & VLAN_VID_MASK);
+ if (!skb_new)
+ goto out;
+ }
/* To preserve backwards compatibility, the node has choose the outgoing
* format based on the incoming request packet type. The assumption is

View file

@ -0,0 +1,41 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 24 Jun 2016 21:43:32 +0200
Subject: [PATCH] batman-adv: Avoid tt_req_node list put for unhashed entry
It can happen that a tt_req_node list entry was already removed from
tt.req_list when batadv_send_tt_request reaches the end of the function.
The reference counter was already reduced by 1 for the list entry and thus
the reference counter is not allowed to be reduced again. Otherwise, the
entry is freed too early and the next batadv_tt_req_node_put in this
function will operate on freed memory.
Fixes: cea194d90b11 ("batman-adv: improved client announcement mechanism")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/03ecc9f957b837c755f09251c5f684996521e487
---
net/batman-adv/translation-table.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 23fb7ea..f7d44c6 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2639,11 +2639,13 @@ static int batadv_send_tt_request(struct batadv_priv *bat_priv,
out:
if (primary_if)
batadv_hardif_put(primary_if);
+
if (ret && tt_req_node) {
spin_lock_bh(&bat_priv->tt.req_list_lock);
- /* hlist_del_init() verifies tt_req_node still is in the list */
- hlist_del_init(&tt_req_node->list);
- batadv_tt_req_node_put(tt_req_node);
+ if (!hlist_unhashed(&tt_req_node->list)) {
+ hlist_del_init(&tt_req_node->list);
+ batadv_tt_req_node_put(tt_req_node);
+ }
spin_unlock_bh(&bat_priv->tt.req_list_lock);
}

View file

@ -0,0 +1,43 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 30 Jun 2016 20:10:46 +0200
Subject: [PATCH] batman-adv: Fix orig_node_vlan leak on orig_node_release
batadv_orig_node_new uses batadv_orig_node_vlan_new to allocate a new
batadv_orig_node_vlan and add it to batadv_orig_node::vlan_list. References
to this list have also to be cleaned when the batadv_orig_node is removed.
Fixes: 21a57f6e7a3b ("batman-adv: make the TT CRC logic VLAN specific")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/719afd254e812c7ff8688ce79bebb7324ec438d6
---
net/batman-adv/originator.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 28241a4..3a3948a 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -781,6 +781,7 @@ static void batadv_orig_node_release(struct kref *ref)
struct batadv_neigh_node *neigh_node;
struct batadv_orig_node *orig_node;
struct batadv_orig_ifinfo *orig_ifinfo;
+ struct batadv_orig_node_vlan *vlan;
orig_node = container_of(ref, struct batadv_orig_node, refcount);
@@ -800,6 +801,13 @@ static void batadv_orig_node_release(struct kref *ref)
}
spin_unlock_bh(&orig_node->neigh_list_lock);
+ spin_lock_bh(&orig_node->vlan_list_lock);
+ hlist_for_each_entry_safe(vlan, node_tmp, &orig_node->vlan_list, list) {
+ hlist_del_rcu(&vlan->list);
+ batadv_orig_node_vlan_put(vlan);
+ }
+ spin_unlock_bh(&orig_node->vlan_list_lock);
+
/* Free nc_nodes */
batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);

View file

@ -0,0 +1,291 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 1 Jul 2016 15:49:43 +0200
Subject: [PATCH] batman-adv: Fix non-atomic bla_claim::backbone_gw access
The pointer batadv_bla_claim::backbone_gw can be changed at any time.
Therefore, access to it must be protected to ensure that two function
accessing the same backbone_gw are actually accessing the same. This is
especially important when the crc_lock is used or when the backbone_gw of a
claim is exchanged.
Not doing so leads to invalid memory access and/or reference leaks.
Fixes: a9ce0dc43e2c ("batman-adv: add basic bridge loop avoidance code")
Fixes: b307e72d119f ("batman-adv: lock crc access in bridge loop avoidance")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: backport, https://git.open-mesh.org/batman-adv.git/commit/e401297e3a393896e9b07bef8d6e2df203b60d43
---
net/batman-adv/bridge_loop_avoidance.c | 111 ++++++++++++++++++++++++++-------
net/batman-adv/types.h | 2 +
2 files changed, 90 insertions(+), 23 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index fe8b62f..30fd72e 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -176,10 +176,21 @@ static void batadv_backbone_gw_put(struct batadv_bla_backbone_gw *backbone_gw)
static void batadv_claim_release(struct kref *ref)
{
struct batadv_bla_claim *claim;
+ struct batadv_bla_backbone_gw *old_backbone_gw;
claim = container_of(ref, struct batadv_bla_claim, refcount);
- batadv_backbone_gw_put(claim->backbone_gw);
+ spin_lock_bh(&claim->backbone_lock);
+ old_backbone_gw = claim->backbone_gw;
+ claim->backbone_gw = NULL;
+ spin_unlock_bh(&claim->backbone_lock);
+
+ spin_lock_bh(&old_backbone_gw->crc_lock);
+ old_backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
+ spin_unlock_bh(&old_backbone_gw->crc_lock);
+
+ batadv_backbone_gw_put(old_backbone_gw);
+
kfree_rcu(claim, rcu);
}
@@ -637,8 +648,10 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
const u8 *mac, const unsigned short vid,
struct batadv_bla_backbone_gw *backbone_gw)
{
+ struct batadv_bla_backbone_gw *old_backbone_gw;
struct batadv_bla_claim *claim;
struct batadv_bla_claim search_claim;
+ bool remove_crc = false;
int hash_added;
ether_addr_copy(search_claim.addr, mac);
@@ -652,8 +665,10 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
return;
ether_addr_copy(claim->addr, mac);
+ spin_lock_init(&claim->backbone_lock);
claim->vid = vid;
claim->lasttime = jiffies;
+ kref_get(&backbone_gw->refcount);
claim->backbone_gw = backbone_gw;
kref_init(&claim->refcount);
@@ -681,15 +696,26 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
"bla_add_claim(): changing ownership for %pM, vid %d\n",
mac, BATADV_PRINT_VID(vid));
- spin_lock_bh(&claim->backbone_gw->crc_lock);
- claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
- spin_unlock_bh(&claim->backbone_gw->crc_lock);
- batadv_backbone_gw_put(claim->backbone_gw);
+ remove_crc = true;
}
- /* set (new) backbone gw */
+
+ /* replace backbone_gw atomically and adjust reference counters */
+ spin_lock_bh(&claim->backbone_lock);
+ old_backbone_gw = claim->backbone_gw;
kref_get(&backbone_gw->refcount);
claim->backbone_gw = backbone_gw;
+ spin_unlock_bh(&claim->backbone_lock);
+ if (remove_crc) {
+ /* remove claim address from old backbone_gw */
+ spin_lock_bh(&old_backbone_gw->crc_lock);
+ old_backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
+ spin_unlock_bh(&old_backbone_gw->crc_lock);
+ }
+
+ batadv_backbone_gw_put(old_backbone_gw);
+
+ /* add claim address to new backbone_gw */
spin_lock_bh(&backbone_gw->crc_lock);
backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
spin_unlock_bh(&backbone_gw->crc_lock);
@@ -700,6 +726,26 @@ claim_free_ref:
}
/**
+ * batadv_bla_claim_get_backbone_gw - Get valid reference for backbone_gw of
+ * claim
+ * @claim: claim whose backbone_gw should be returned
+ *
+ * Return: valid reference to claim::backbone_gw
+ */
+static struct batadv_bla_backbone_gw *
+batadv_bla_claim_get_backbone_gw(struct batadv_bla_claim *claim)
+{
+ struct batadv_bla_backbone_gw *backbone_gw;
+
+ spin_lock_bh(&claim->backbone_lock);
+ backbone_gw = claim->backbone_gw;
+ kref_get(&backbone_gw->refcount);
+ spin_unlock_bh(&claim->backbone_lock);
+
+ return backbone_gw;
+}
+
+/**
* batadv_bla_del_claim - delete a claim from the claim hash
* @bat_priv: the bat priv with all the soft interface information
* @mac: mac address of the claim to be removed
@@ -723,10 +769,6 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
batadv_choose_claim, claim);
batadv_claim_put(claim); /* reference from the hash is gone */
- spin_lock_bh(&claim->backbone_gw->crc_lock);
- claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
- spin_unlock_bh(&claim->backbone_gw->crc_lock);
-
/* don't need the reference from hash_find() anymore */
batadv_claim_put(claim);
}
@@ -1175,6 +1217,7 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
struct batadv_hard_iface *primary_if,
int now)
{
+ struct batadv_bla_backbone_gw *backbone_gw;
struct batadv_bla_claim *claim;
struct hlist_head *head;
struct batadv_hashtable *hash;
@@ -1189,14 +1232,17 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
rcu_read_lock();
hlist_for_each_entry_rcu(claim, head, hash_entry) {
+ backbone_gw = batadv_bla_claim_get_backbone_gw(claim);
if (now)
goto purge_now;
- if (!batadv_compare_eth(claim->backbone_gw->orig,
+
+ if (!batadv_compare_eth(backbone_gw->orig,
primary_if->net_dev->dev_addr))
- continue;
+ goto skip;
+
if (!batadv_has_timed_out(claim->lasttime,
BATADV_BLA_CLAIM_TIMEOUT))
- continue;
+ goto skip;
batadv_dbg(BATADV_DBG_BLA, bat_priv,
"bla_purge_claims(): %pM, vid %d, time out\n",
@@ -1204,8 +1250,10 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
purge_now:
batadv_handle_unclaim(bat_priv, primary_if,
- claim->backbone_gw->orig,
+ backbone_gw->orig,
claim->addr, claim->vid);
+skip:
+ batadv_backbone_gw_put(backbone_gw);
}
rcu_read_unlock();
}
@@ -1623,9 +1671,11 @@ void batadv_bla_free(struct batadv_priv *bat_priv)
int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
unsigned short vid, bool is_bcast)
{
+ struct batadv_bla_backbone_gw *backbone_gw;
struct ethhdr *ethhdr;
struct batadv_bla_claim search_claim, *claim = NULL;
struct batadv_hard_iface *primary_if;
+ bool own_claim;
int ret;
ethhdr = eth_hdr(skb);
@@ -1657,8 +1707,12 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
}
/* if it is our own claim ... */
- if (batadv_compare_eth(claim->backbone_gw->orig,
- primary_if->net_dev->dev_addr)) {
+ backbone_gw = batadv_bla_claim_get_backbone_gw(claim);
+ own_claim = batadv_compare_eth(backbone_gw->orig,
+ primary_if->net_dev->dev_addr);
+ batadv_backbone_gw_put(backbone_gw);
+
+ if (own_claim) {
/* ... allow it in any case */
claim->lasttime = jiffies;
goto allow;
@@ -1722,7 +1776,9 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
{
struct ethhdr *ethhdr;
struct batadv_bla_claim search_claim, *claim = NULL;
+ struct batadv_bla_backbone_gw *backbone_gw;
struct batadv_hard_iface *primary_if;
+ bool client_roamed;
int ret = 0;
primary_if = batadv_primary_if_get_selected(bat_priv);
@@ -1752,8 +1808,12 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
goto allow;
/* check if we are responsible. */
- if (batadv_compare_eth(claim->backbone_gw->orig,
- primary_if->net_dev->dev_addr)) {
+ backbone_gw = batadv_bla_claim_get_backbone_gw(claim);
+ client_roamed = batadv_compare_eth(backbone_gw->orig,
+ primary_if->net_dev->dev_addr);
+ batadv_backbone_gw_put(backbone_gw);
+
+ if (client_roamed) {
/* if yes, the client has roamed and we have
* to unclaim it.
*/
@@ -1801,6 +1861,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
struct net_device *net_dev = (struct net_device *)seq->private;
struct batadv_priv *bat_priv = netdev_priv(net_dev);
struct batadv_hashtable *hash = bat_priv->bla.claim_hash;
+ struct batadv_bla_backbone_gw *backbone_gw;
struct batadv_bla_claim *claim;
struct batadv_hard_iface *primary_if;
struct hlist_head *head;
@@ -1825,17 +1886,21 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
rcu_read_lock();
hlist_for_each_entry_rcu(claim, head, hash_entry) {
- is_own = batadv_compare_eth(claim->backbone_gw->orig,
+ backbone_gw = batadv_bla_claim_get_backbone_gw(claim);
+
+ is_own = batadv_compare_eth(backbone_gw->orig,
primary_addr);
- spin_lock_bh(&claim->backbone_gw->crc_lock);
- backbone_crc = claim->backbone_gw->crc;
- spin_unlock_bh(&claim->backbone_gw->crc_lock);
+ spin_lock_bh(&backbone_gw->crc_lock);
+ backbone_crc = backbone_gw->crc;
+ spin_unlock_bh(&backbone_gw->crc_lock);
seq_printf(seq, " * %pM on %5d by %pM [%c] (%#.4x)\n",
claim->addr, BATADV_PRINT_VID(claim->vid),
- claim->backbone_gw->orig,
+ backbone_gw->orig,
(is_own ? 'x' : ' '),
backbone_crc);
+
+ batadv_backbone_gw_put(backbone_gw);
}
rcu_read_unlock();
}
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index d75beef..41a85b5 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1034,6 +1034,7 @@ struct batadv_bla_backbone_gw {
* @addr: mac address of claimed non-mesh client
* @vid: vlan id this client was detected on
* @backbone_gw: pointer to backbone gw claiming this client
+ * @backbone_lock: lock protecting backbone_gw pointer
* @lasttime: last time we heard of claim (locals only)
* @hash_entry: hlist node for batadv_priv_bla::claim_hash
* @refcount: number of contexts the object is used
@@ -1043,6 +1044,7 @@ struct batadv_bla_claim {
u8 addr[ETH_ALEN];
unsigned short vid;
struct batadv_bla_backbone_gw *backbone_gw;
+ spinlock_t backbone_lock; /* protects backbone_gw */
unsigned long lasttime;
struct hlist_node hash_entry;
struct rcu_head rcu;

View file

@ -0,0 +1,120 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 30 Jun 2016 20:11:34 +0200
Subject: [PATCH] batman-adv: Fix reference leak in batadv_find_router
The replacement of last_bonding_candidate in batadv_orig_node has to be an
atomic operation. Otherwise it is possible that the reference counter of a
batadv_orig_ifinfo is reduced which was no longer the
last_bonding_candidate when the new candidate is added. This can either
lead to an invalid memory access or to reference leaks which make it
impossible to an interface which was added to batman-adv.
Fixes: 797edd9e87ac ("batman-adv: add bonding again")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/6ecc711374afd93ee0c2216b38ae52d3ce680c3f
---
net/batman-adv/routing.c | 52 ++++++++++++++++++++++++++++++++++++------------
net/batman-adv/types.h | 4 +++-
2 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 27e07dd..694dc74 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -456,6 +456,29 @@ static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
}
/**
+ * batadv_last_bonding_replace - Replace last_bonding_candidate of orig_node
+ * @orig_node: originator node whose bonding candidates should be replaced
+ * @new_candidate: new bonding candidate or NULL
+ */
+static void
+batadv_last_bonding_replace(struct batadv_orig_node *orig_node,
+ struct batadv_orig_ifinfo *new_candidate)
+{
+ struct batadv_orig_ifinfo *old_candidate;
+
+ spin_lock_bh(&orig_node->neigh_list_lock);
+ old_candidate = orig_node->last_bonding_candidate;
+
+ if (new_candidate)
+ kref_get(&new_candidate->refcount);
+ orig_node->last_bonding_candidate = new_candidate;
+ spin_unlock_bh(&orig_node->neigh_list_lock);
+
+ if (old_candidate)
+ batadv_orig_ifinfo_put(old_candidate);
+}
+
+/**
* batadv_find_router - find a suitable router for this originator
* @bat_priv: the bat priv with all the soft interface information
* @orig_node: the destination node
@@ -562,10 +585,6 @@ next:
}
rcu_read_unlock();
- /* last_bonding_candidate is reset below, remove the old reference. */
- if (orig_node->last_bonding_candidate)
- batadv_orig_ifinfo_put(orig_node->last_bonding_candidate);
-
/* After finding candidates, handle the three cases:
* 1) there is a next candidate, use that
* 2) there is no next candidate, use the first of the list
@@ -574,21 +593,28 @@ next:
if (next_candidate) {
batadv_neigh_node_put(router);
- /* remove references to first candidate, we don't need it. */
- if (first_candidate) {
- batadv_neigh_node_put(first_candidate_router);
- batadv_orig_ifinfo_put(first_candidate);
- }
+ kref_get(&next_candidate_router->refcount);
router = next_candidate_router;
- orig_node->last_bonding_candidate = next_candidate;
+ batadv_last_bonding_replace(orig_node, next_candidate);
} else if (first_candidate) {
batadv_neigh_node_put(router);
- /* refcounting has already been done in the loop above. */
+ kref_get(&first_candidate_router->refcount);
router = first_candidate_router;
- orig_node->last_bonding_candidate = first_candidate;
+ batadv_last_bonding_replace(orig_node, first_candidate);
} else {
- orig_node->last_bonding_candidate = NULL;
+ batadv_last_bonding_replace(orig_node, NULL);
+ }
+
+ /* cleanup of candidates */
+ if (first_candidate) {
+ batadv_neigh_node_put(first_candidate_router);
+ batadv_orig_ifinfo_put(first_candidate);
+ }
+
+ if (next_candidate) {
+ batadv_neigh_node_put(next_candidate_router);
+ batadv_orig_ifinfo_put(next_candidate);
}
return router;
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 41a85b5..c143649 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -330,7 +330,9 @@ struct batadv_orig_node {
DECLARE_BITMAP(bcast_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
u32 last_bcast_seqno;
struct hlist_head neigh_list;
- /* neigh_list_lock protects: neigh_list and router */
+ /* neigh_list_lock protects: neigh_list, ifinfo_list,
+ * last_bonding_candidate and router
+ */
spinlock_t neigh_list_lock;
struct hlist_node hash_entry;
struct batadv_priv *bat_priv;

View file

@ -0,0 +1,45 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 30 Jun 2016 21:41:13 +0200
Subject: [PATCH] batman-adv: Free last_bonding_candidate on release of orig_node
The orig_ifinfo reference counter for last_bonding_candidate in
batadv_orig_node has to be reduced when an originator node is released.
Otherwise the orig_ifinfo is leaked and the reference counter the netdevice
is not reduced correctly.
Fixes: 797edd9e87ac ("batman-adv: add bonding again")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/20df5c53865a90095099f0af80536b8abfea303b
---
net/batman-adv/originator.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 3a3948a..7594afd 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -782,6 +782,7 @@ static void batadv_orig_node_release(struct kref *ref)
struct batadv_orig_node *orig_node;
struct batadv_orig_ifinfo *orig_ifinfo;
struct batadv_orig_node_vlan *vlan;
+ struct batadv_orig_ifinfo *last_candidate;
orig_node = container_of(ref, struct batadv_orig_node, refcount);
@@ -799,8 +800,14 @@ static void batadv_orig_node_release(struct kref *ref)
hlist_del_rcu(&orig_ifinfo->list);
batadv_orig_ifinfo_put(orig_ifinfo);
}
+
+ last_candidate = orig_node->last_bonding_candidate;
+ orig_node->last_bonding_candidate = NULL;
spin_unlock_bh(&orig_node->neigh_list_lock);
+ if (last_candidate)
+ batadv_orig_ifinfo_put(last_candidate);
+
spin_lock_bh(&orig_node->vlan_list_lock);
hlist_for_each_entry_safe(vlan, node_tmp, &orig_node->vlan_list, list) {
hlist_del_rcu(&vlan->list);

View file

@ -0,0 +1,35 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Sun, 12 Jun 2016 10:43:19 +0200
Subject: [PATCH] batman-adv: Fix speedy join in gateway client mode
Speedy join only works when the received packet is either broadcast or an
4addr unicast packet. Thus packets converted from broadcast to unicast via
the gateway handling code have to be converted to 4addr packets to allow
the receiving gateway server to add the sender address as temporary entry
to the translation table.
Not doing it will make the batman-adv gateway server drop the DHCP response
in many situations because it doesn't yet have the TT entry for the
destination of the DHCP response.
Fixes: 9cbc67d9da47 ("batman-adv: change interface_rx to get orig node")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/send.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 7641785..e5be212 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -423,8 +423,8 @@ int batadv_send_skb_via_gw(struct batadv_priv *bat_priv, struct sk_buff *skb,
struct batadv_orig_node *orig_node;
orig_node = batadv_gw_get_selected_orig(bat_priv);
- return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0,
- orig_node, vid);
+ return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST_4ADDR,
+ BATADV_P_DATA, orig_node, vid);
}
void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface)

View file

@ -9,26 +9,28 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=batmand PKG_NAME:=batmand
PKG_REV:=1439
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=2
PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\"
PKG_SOURCE_PROTO:=svn PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_URL:=git://git.open-mesh.org/batmand.git
PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION) PKG_REV:=b67a7087b51d7a5e90d27ac39116d1f57257c86e
PKG_SOURCE_URL:=http://downloads.open-mesh.org/svn/batman/trunk/ PKG_VERSION:=1440
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz PKG_RELEASE:=0
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE
PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/linux/modules
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/batmand/Default define Package/batmand/Default
URL:=http://www.open-mesh.org/ URL:=https://www.open-mesh.org/
MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de> MAINTAINER:=Corinna "Elektra" Aichele <onelektra@gmx.net>
endef endef
define Package/batmand define Package/batmand
@ -44,19 +46,6 @@ define Package/batmand/description
B.A.T.M.A.N. layer 3 routing daemon B.A.T.M.A.N. layer 3 routing daemon
endef endef
define Package/vis
$(call Package/batmand/Default)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
DEPENDS:=+libpthread
TITLE:=visualization server for B.A.T.M.A.N. layer 3
endef
define Package/vis/description
visualization server for B.A.T.M.A.N. layer 3
endef
define KernelPackage/batgat define KernelPackage/batgat
$(call Package/batmand/Default) $(call Package/batmand/Default)
SUBMENU:=Network Support SUBMENU:=Network Support
@ -82,18 +71,6 @@ MAKE_BATMAND_ARGS += \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \ STRIP="/bin/true" \
batmand install batmand install
MAKE_VIS_ARGS += \
EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
CCFLAGS="$(TARGET_CFLAGS)" \
OFLAGS="$(TARGET_CFLAGS)" \
REVISION="$(PKG_REV)" \
CC="$(TARGET_CC)" \
NODEBUG=1 \
UNAME="Linux" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \
vis install
MAKE_BATGAT_ARGS += \ MAKE_BATGAT_ARGS += \
CROSS_COMPILE="$(TARGET_CROSS)" \ CROSS_COMPILE="$(TARGET_CROSS)" \
@ -108,11 +85,7 @@ define Build/Configure
endef endef
ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),) ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS) BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS)
endif
ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),)
BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS)
endif endif
ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),) ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
@ -121,7 +94,6 @@ endif
define Build/Compile define Build/Compile
$(BUILD_BATMAND) $(BUILD_BATMAND)
$(BUILD_VIS)
cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
$(BUILD_BATGAT) $(BUILD_BATGAT)
endef endef
@ -137,17 +109,5 @@ define Package/batmand/conffiles
/etc/config/batmand /etc/config/batmand
endef endef
define Package/vis/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
endef
define Package/vis/conffiles
/etc/config/vis
endef
$(eval $(call BuildPackage,batmand)) $(eval $(call BuildPackage,batmand))
$(eval $(call BuildPackage,vis))
$(eval $(call KernelPackage,batgat)) $(eval $(call KernelPackage,batgat))

View file

@ -2,8 +2,8 @@
batman/linux/modules/gateway.c | 19 +++++++++++++++++++ batman/linux/modules/gateway.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+) 1 file changed, 19 insertions(+)
--- batmand-r1439.orig/batman/linux/modules/gateway.c --- batmand-r1439.orig/linux/modules/gateway.c
+++ batmand-r1439/batman/linux/modules/gateway.c +++ batmand-r1439/linux/modules/gateway.c
@@ -29,6 +29,7 @@ static struct class *batman_class; @@ -29,6 +29,7 @@ static struct class *batman_class;
static int batgat_open(struct inode *inode, struct file *filp); static int batgat_open(struct inode *inode, struct file *filp);
static int batgat_release(struct inode *inode, struct file *file); static int batgat_release(struct inode *inode, struct file *file);

View file

@ -31,8 +31,8 @@ PKG_SOURCE_PROTO:=git
#PKG_SOURCE_URL:=git://bmx6.net/bmx6.git #PKG_SOURCE_URL:=git://bmx6.net/bmx6.git
PKG_SOURCE_URL:=git://github.com/axn/bmx6.git PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
PKG_REV:=6a6195e46bf15ed58d75bdec14c2941aca31fc3f PKG_REV:=2a87b770d3f9c254e3927dc159e2f425f2e0e83a
PKG_VERSION:=r2014112401 PKG_VERSION:=r2015080701
PKG_RELEASE:=4 PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
@ -49,7 +49,7 @@ TARGET_CFLAGS += $(FPIC)
MAKE_ARGS += \ MAKE_ARGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \ EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \ EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
REVISION_VERSION="$(PKG_REV)" \ GIT_REV="$(PKG_REV)" \
CC="$(TARGET_CC)" \ CC="$(TARGET_CC)" \
INSTALL_DIR="$(PKG_INSTALL_DIR)" \ INSTALL_DIR="$(PKG_INSTALL_DIR)" \
STRIP="/bin/false" \ STRIP="/bin/false" \

191
bmx7/Makefile Normal file
View file

@ -0,0 +1,191 @@
# Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contibutors:
# Axel Neumann, Simó Albert i Beltran, Pau Escrich
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bmx7
PKG_SOURCE_PROTO:=git
#PKG_SOURCE_URL:=git://bmx6.net/bmx6.git
PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
#PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6.git
PKG_REV:=379110ae442f80755b5788c527e722f9551b14eb
PKG_VERSION:=r2016072001
PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += $(FPIC)
MAKE_ARGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DCRYPTLIB=POLARSSL_1_3_4 -DCORE_LIMIT=20000 -DTRAFFIC_DUMP -DNO_TRACE_FUNCTION_CALLS -DBMX7_LIB_IWINFO" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -liwinfo" \
GIT_REV="$(PKG_REV)" \
CC="$(TARGET_CC)" \
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
build_all
define Package/bmx7/Default
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
TITLE:=BMX7 layer 3 routing daemon
URL:=http://bmx6.net/
MAINTAINER:=Axel Neumann <neumann@cgws.de>
DEPENDS:=+zlib +libpolarssl +libiwinfo
endef
define Package/bmx7/description
BMX7 routing daemon supporting securely-entrusted IPv6 (and IPv4in6) routing
endef
define Package/bmx7
$(call Package/bmx7/Default)
MENU:=1
endef
define Package/bmx7-uci-config
$(call Package/bmx7/Default)
DEPENDS:=bmx7 +libuci
TITLE:=configuration plugin based on uci (recommended!)
endef
define Package/bmx7-iwinfo
$(call Package/bmx7/Default)
DEPENDS:=bmx7 +libiwinfo
TITLE:=link characteristics plugin based on libiwinfo (recommended!)
endef
define Package/bmx7-topology
$(call Package/bmx7/Default)
DEPENDS:=bmx7
TITLE:=topology plugin
endef
define Package/bmx7-json
$(call Package/bmx7/Default)
DEPENDS:=bmx7 +libjson-c
TITLE:=json plugin based on json-c
endef
define Package/bmx7-sms
$(call Package/bmx7/Default)
DEPENDS:=bmx7
TITLE:=sms plugin
endef
define Package/bmx7-tun
$(call Package/bmx7/Default)
DEPENDS:=bmx7 +kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun
TITLE:=ipip-based tunnel plugin (recommended!)
endef
define Package/bmx7-table
$(call Package/bmx7/Default)
DEPENDS:=bmx7 +bmx7-tun
TITLE:=plugin to announce routes from tables via tunnels
endef
define Build/Configure
mkdir -p $(PKG_INSTALL_DIR)
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
endef
define Package/bmx7/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx7 $(1)/usr/sbin/bmx7
endef
define Package/bmx7/postinst
#!/bin/sh
# # check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
if [ -f /etc/sysupgrade.conf ] && ! grep bmx7 /etc/sysupgrade.conf; then
echo /etc/bmx7 >> /etc/sysupgrade.conf
fi
fi
endef
define Package/bmx7-uci-config/conffiles
/etc/config/bmx7
endef
define Package/bmx7-uci-config/install
$(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_uci_config/bmx7_config.so $(1)/usr/lib/bmx7_config.so
$(INSTALL_BIN) ./files/etc/init.d/bmx7 $(1)/etc/init.d/bmx7
$(INSTALL_DATA) ./files/etc/config/bmx7 $(1)/etc/config/bmx7
endef
define Package/bmx7-iwinfo/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_iwinfo/bmx7_iwinfo.so $(1)/usr/lib/bmx7_iwinfo.so
endef
define Package/bmx7-topology/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_topology/bmx7_topology.so $(1)/usr/lib/bmx7_topology.so
endef
define Package/bmx7-json/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_json/bmx7_json.so $(1)/usr/lib/bmx7_json.so
endef
define Package/bmx7-sms/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_sms/bmx7_sms.so $(1)/usr/lib/bmx7_sms.so
endef
define Package/bmx7-tun/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_tun/bmx7_tun.so $(1)/usr/lib/bmx7_tun.so
endef
define Package/bmx7-table/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_table/bmx7_table.so $(1)/usr/lib/bmx7_table.so
endef
$(eval $(call BuildPackage,bmx7))
$(eval $(call BuildPackage,bmx7-uci-config))
$(eval $(call BuildPackage,bmx7-iwinfo))
$(eval $(call BuildPackage,bmx7-topology))
$(eval $(call BuildPackage,bmx7-json))
$(eval $(call BuildPackage,bmx7-sms))
$(eval $(call BuildPackage,bmx7-table))
$(eval $(call BuildPackage,bmx7-tun))

View file

@ -0,0 +1,57 @@
# for more information:
# http://bmx6.net/projects/bmx6/wiki
# options execute: bmx7 --help
config 'bmx7' 'general'
# option 'runtimeDir' '/var/run/bmx7'
# option 'trustedNodesDir' '/etc/bmx7/trustedNodes'
#config 'plugin'
# option 'plugin' 'bmx7_config.so'
#config 'plugin'
# option 'plugin' 'bmx7_json.so'
#config 'plugin'
# option 'plugin' 'bmx7_sms.so'
#config 'plugin'
# option 'plugin' 'bmx7_iwinfo.so'
config 'dev' 'mesh_1'
option 'dev' 'br-lan'
config 'dev' 'mesh_2'
option 'dev' 'wlan0'
#config 'plugin'
# option 'plugin' 'bmx7_tun.so'
#config 'plugin'
# option 'plugin' 'bmx7_table.so'
#config 'tunDev' default
# option 'tunDev' 'default'
# option 'tun6Address' '2012:0:0:6666::1/64'
# option 'tun4Address' '10.66.66.1/24'
#config 'tunOut'
# option 'tunOut' 'ip6'
# option 'network' '2012::/16'
# option 'exportDistance' '0'
#config 'tunOut'
# option 'tunOut' 'ip4'
# option 'network' '10.0.0.0/9'
# option 'minPrefixLen' '27'

41
bmx7/files/etc/init.d/bmx7 Executable file
View file

@ -0,0 +1,41 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
START=91
BIN=/usr/sbin/bmx7
CONF=/etc/config/bmx7
PID=/var/run/bmx7/pid
start() {
cd /root/
while pgrep -f mac80211.sh ; do sleep 1; done
ulimit -c 20000
$BIN -f $CONF -d0 > /dev/null &
}
stop() {
start-stop-daemon -p $PID -K
}
restart() {
stop; sleep 3; start
}

View file

@ -0,0 +1,13 @@
Index: bmx7-r2014112401/lib/bmx7_json/json.c
===================================================================
--- bmx7-r2014112401.orig/lib/bmx7_json/json.c
+++ bmx7-r2014112401/lib/bmx7_json/json.c
@@ -27,7 +27,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <stdint.h>
-#include <json/json.h>
+#include <json-c/json.h>
//#include <dirent.h>
//#include <sys/inotify.h>

View file

@ -1,12 +1,28 @@
#
# Copyright (C) 2014,2015 Hyperboria.net
#
# You may redistribute this program and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=cjdns PKG_NAME:=cjdns
PKG_VERSION:=0.16 PKG_VERSION:=0.17
PKG_RELEASE:=11 PKG_RELEASE:=2
PKG_SOURCE_URL:=https://github.com/hyperboria/cjdns.git PKG_SOURCE_URL:=https://github.com/hyperboria/cjdns.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a5a1b16f5a4f2815ce3c0e234a24108cae0f9ad3 PKG_SOURCE_VERSION:=40e87d9419c19063e772e39c7c59a8a8771c5ee8
PKG_LICENSE:=GPL-3.0 PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
@ -36,7 +52,7 @@ endef
define Build/Configure define Build/Configure
endef endef
PKG_DO_VARS:= PKG_DO_VARS:=CJDNS_RELEASE_VERSION=$(PKG_SOURCE_VERSION)
ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y) ifneq ($(CONFIG_KERNEL_SECCOMP_FILTER),y)
PKG_DO_VARS+= Seccomp_NO=1 PKG_DO_VARS+= Seccomp_NO=1

View file

@ -10,7 +10,14 @@ common.uci = UCI
-- @return table with configuration defaults -- @return table with configuration defaults
function UCI.defaults() function UCI.defaults()
return { return {
security = { { exemptAngel = 1, setuser = "nobody" } }, security = {
{ setuser = "nobody", keepNetAdmin = 1 },
{ chroot = "/var/run/" },
{ nofiles = 0 },
{ noforks = 1 },
{ seccomp = 0 },
{ setupComplete = 1 }
},
router = { router = {
ipTunnel = { outgoingConnections = {}, allowedConnections = {} }, ipTunnel = { outgoingConnections = {}, allowedConnections = {} },
interface = { type = "TUNInterface" } interface = { type = "TUNInterface" }
@ -45,6 +52,12 @@ function UCI.get()
obj.router.interface.tunDevice = config.tun_device obj.router.interface.tunDevice = config.tun_device
end end
for i,section in pairs(obj.security) do
if type(section.seccomp) == "number" then
obj.security[i].seccomp = tonumber(config.seccomp)
end
end
cursor:foreach("cjdns", "iptunnel_outgoing", function(outgoing) cursor:foreach("cjdns", "iptunnel_outgoing", function(outgoing)
table.insert(obj.router.ipTunnel.outgoingConnections, outgoing.public_key) table.insert(obj.router.ipTunnel.outgoingConnections, outgoing.public_key)
end) end)
@ -127,7 +140,7 @@ function UCI.set(obj)
private_key = obj.privateKey, private_key = obj.privateKey,
admin_password = obj.admin.password, admin_password = obj.admin.password,
admin_address = admin_address, admin_address = admin_address,
admin_port = admin_port, admin_port = admin_port
}) })
if obj.router.interface.tunDevice then if obj.router.interface.tunDevice then
@ -136,6 +149,18 @@ function UCI.set(obj)
}) })
end end
if obj.security then
for i,section in pairs(obj.security) do
for key,value in pairs(section) do
if key == "seccomp" then
UCI.cursor_section(cursor, "cjdns", "cjdns", "cjdns", {
seccomp = tonumber(value)
})
end
end
end
end
if obj.router.ipTunnel.outgoingConnections then if obj.router.ipTunnel.outgoingConnections then
for i,public_key in pairs(obj.router.ipTunnel.outgoingConnections) do for i,public_key in pairs(obj.router.ipTunnel.outgoingConnections) do
UCI.cursor_section(cursor, "cjdns", "iptunnel_outgoing", nil, { UCI.cursor_section(cursor, "cjdns", "iptunnel_outgoing", nil, {

View file

@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=hnetd PKG_NAME:=hnetd
PKG_SOURCE_VERSION:=6a5348ca13ae257c02431df499e78b695049324f PKG_SOURCE_VERSION:=9ab71adbf0a7ad2a0964e48641b19b016b37df16
PKG_VERSION:=2015-04-17-$(PKG_SOURCE_VERSION) PKG_VERSION:=2016-05-17-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
@ -52,7 +52,7 @@ define Package/hnet-full
URL:=https://github.com/sbyx/hnetd URL:=https://github.com/sbyx/hnetd
DEPENDS:=+hnetd-nossl +luci-app-hnet DEPENDS:=+hnetd-nossl +luci-app-hnet
# Routing # Routing
DEPENDS+=+babels DEPENDS+=+babeld
# Service discovery # Service discovery
DEPENDS+=+ohybridproxy DEPENDS+=+ohybridproxy
# Distributed PCP support # Distributed PCP support
@ -66,7 +66,7 @@ define Package/hnet-full-secure
URL:=https://github.com/sbyx/hnetd URL:=https://github.com/sbyx/hnetd
DEPENDS:=+hnetd-openssl +luci-app-hnet DEPENDS:=+hnetd-openssl +luci-app-hnet
# Routing # Routing
DEPENDS+=+babels DEPENDS+=+babeld
# Service discovery # Service discovery
DEPENDS+=+ohybridproxy DEPENDS+=+ohybridproxy
# Distributed PCP support # Distributed PCP support

View file

@ -13,7 +13,7 @@ config pa pa
# option ip4prefix 10.0.0.0/8 # option ip4prefix 10.0.0.0/8
# option ulaprefix fd12:3456:789A::/48 # option ulaprefix fd12:3456:789A::/48
# option ulamode off # option ulamode off
# option persistent_store /etc/hnet-pa.store option persistent_store /etc/hnet-pa.store
config sd sd config sd sd
# option router_name openwrt # option router_name openwrt

View file

@ -112,12 +112,16 @@ function wget(url, timeout)
if pid == 0 then if pid == 0 then
rfd:close() rfd:close()
nixio.dup(wfd, nixio.stdout) nixio.dup(wfd, nixio.stdout)
-- candidates for wget, try first ones with SSL support
local candidates = { "/usr/bin/wget", "/bin/wget" } local candidates = {{"/usr/bin/wget-ssl",1},{"/usr/bin/wget",0},{"/bin/wget",0}}
local _, bin local _, bin
for _, bin in ipairs(candidates) do for _, bin in ipairs(candidates) do
if nixiofs.access(bin, "x") then if nixiofs.access(bin[1], "x") then
nixio.exec(bin, "-q", "-O", "-", url) if bin[2] == 0 then
nixio.exec(bin[1], "-q", "-O", "-", url)
else
nixio.exec(bin[1], "--no-check-certificate", "-q", "-O", "-", url)
end
end end
end end
return return

339
luci-app-bmx7/COPYING Normal file
View file

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

63
luci-app-bmx7/Makefile Normal file
View file

@ -0,0 +1,63 @@
# Copyright © 2011 Pau Escrich <pau@dabax.net>
# Contributors Roger Pueyo Centelles <roger.pueyo@guifi.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-bmx7
PKG_RELEASE:=0.0-alpha
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk
define Package/luci-app-bmx7
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:= LuCI support for BMX7
DEPENDS:=+luci-lib-json +luci-mod-admin-full +luci-lib-httpclient +bmx7
MAINTAINER:= Roger Pueyo Centelles <roger.pueyo@guifi.net>
endef
define Package/luci-app-bmx7/description
LuCI application for web-based configuration and visualization of the BMX7 routing daemon
endef
define Package/luci-app-bmx7/conffiles
/etc/config/luci-bmx7
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-app-bmx7/install
$(CP) ./files/* $(1)/
chmod 755 $(1)/www/cgi-bin/bmx7-info
endef
$(eval $(call BuildPackage,luci-app-bmx7))

View file

@ -0,0 +1,7 @@
config 'bmx7' 'luci'
option ignore '0'
option place 'admin network BMX7'
#option place 'qmp Mesh'
option position '3'
#option json 'http://127.0.0.1/cgi-bin/bmx7-info?'
option json 'exec:/www/cgi-bin/bmx7-info -s'

View file

@ -0,0 +1,77 @@
--[[
Copyright (C) 2011 Pau Escrich <pau@dabax.net>
Contributors Jo-Philipp Wich <xm@subsignal.org>
Roger Pueyo Centelles <roger.pueyo@guifi.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
--]]
module("luci.controller.bmx7", package.seeall)
function index()
local place = {}
local ucim = require "luci.model.uci"
local uci = ucim.cursor()
-- checking if ignore is on
if uci:get("luci-bmx7","luci","ignore") == "1" then
return nil
end
-- getting value from uci database
local uci_place = uci:get("luci-bmx7","luci","place")
-- default values
if uci_place == nil then
place = {"bmx7"}
else
local util = require "luci.util"
place = util.split(uci_place," ")
end
-- getting position of menu
local uci_position = uci:get("luci-bmx7","luci","position")
---------------------------
-- Placing the pages in the menu
---------------------------
-- Status (default)
entry(place,call("action_status_j"),place[#place],tonumber(uci_position))
table.insert(place,"Status")
entry(place,call("action_status_j"),"Status",0)
table.remove(place)
-- Nodes list
table.insert(place,"Nodes")
entry(place,call("action_nodes_j"),"Nodes",1)
table.remove(place)
end
function action_status_j()
luci.template.render("bmx7/status_j", {})
end
function action_nodes_j()
local http = require "luci.http"
local link_non_js = "/cgi-bin/luci" .. http.getenv("PATH_INFO") .. '/nodes_nojs'
luci.template.render("bmx7/nodes_j", {link_non_js=link_non_js})
end

View file

@ -0,0 +1,175 @@
<%#
Copyright © 2011 Pau Escrich <pau@dabax.net>
Contributors Lluis Esquerda <eskerda@gmail.com>
Roger Pueyo Centelles <roger.pueyo@guifi.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
-%>
<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<style>
div.hideme{
display: none;
}
div.info{
background: #FFF;
border: solid 0px;
height: 90px;
display: block;
overflow: auto;
}
div.inforow{
text-align:left;
display:inline-block;
margin:10px;
vertical-align:top;
float: left;
white-space:nowrap;
}
div.inforow.newline{
clear: both;
}
u {
text-decoration: underline;
}
#extra-info ul { list-style: none outside none; margin-left: 0em; }
</style>
<div class="cbi-map">
<h2>Mesh nodes</h2>
<div class="cbi-map-descr"></div>
<div id="extra-info" class="info">
<br />
<center>
Tip: click the <img src="<%=resource%>/bmx7/world.png" /> icon to see individual node information.
</center>
</div>
<fieldset class="cbi-section">
<legend><%:Originators%></legend>
<table class="cbi-section-table" id="descriptions_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"></th>
<th class="cbi-section-table-cell"><%:Name%></th>
<th class="cbi-section-table-cell"><%:Short ID%></th>
<th class="cbi-section-table-cell"><%:S/s/T/t%></th>
<th class="cbi-section-table-cell"><%:Primary IPv6 address%></th>
<th class="cbi-section-table-cell"><%:Via neighbour%></th>
<th class="cbi-section-table-cell"><%:Metric%></th>
<th class="cbi-section-table-cell"><%:Last desc.%></th>
<th class="cbi-section-table-cell"><%:Last ref.%></th>
<th class="cbi-section-table-cell"><%: %></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="11"><br /><center><em><%:Collecting data...%></em></center></td>
</tr>
</table>
</fieldset>
</div>
<script type="text/javascript">//<![CDATA[
var displayExtraInfo = function ( id ) {
console.log('aaa'+id)
document.getElementById('extra-info').innerHTML = document.getElementById(id).innerHTML;
}
new TablePooler(5,"/cgi-bin/bmx7-info", {'$originators':''}, "descriptions_table", function(st){
var infoicon = "<%=resource%>/bmx7/world_small.png";
var originators = st.originators;
var res = Array();
originators.forEach(function(originator,i){
var name = originator.name;
var shortId = originator.shortId;
var nodeId = originator.nodeId;
var extensions = originator.name;
var SsTt = originator.S+'/'+originator.s+'/'+originator.T+'/'+originator.t;
var nodeKey = originator.nodeKey;
var descSize = originator.descSize;
var primaryIp = originator.primaryIp;
var nbName = originator.nbName;
var dev = originator.dev;
var nbLocalIp = originator.nbLocalIp;
var metric = originator.metric;
var lastDesc = originator.lastDesc;
var lastRef = originator.lastRef;
var extrainfo = '<a onclick="displayExtraInfo(\'ip-' + i + '\')"><img src="' + infoicon + '" / ></a>';
var extrainfo_link = '<a onclick="displayExtraInfo(\'ip-' + i + '\')">' + '<img src="' + infoicon + '" />' + '</a>';
extrainfo = '<div id="ip-'+ i +'" class="hideme">'
+ "<div class='inforow'>"
+ "<h4><u>" + name + '</u></h4>\n'
+ 'Node ID: ' + nodeId + "</div>"
+ "<div class='inforow'>"
+ "<h5>Primary IPv6 address</h5>\n"
+ primaryIp + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Support & Trust</h5>\n"
+ SsTt + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Node key</h5>\n"
+ nodeKey + "</div>\n"
+ "<div class='inforow newline'>"
+ "<h5>Via neighbour</h5>\n"
+ nbName + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Via device</h5>\n"
+ dev + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Via remote link-local IPv6 address</h5>\n"
+ nbLocalIp + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Route metric</h5>\n"
+ metric + "</div>\n"
+ "<div class='inforow'>"
+ "<h5>Desc. size</h5>\n"
+ descSize + "</div>\n"
+ "\n</div>";
res.push([extrainfo_link, name, shortId, SsTt, primaryIp,
nbName, metric, lastDesc, lastRef, extrainfo]);
});
return res;
});
//]]></script>
<%+footer%>

View file

@ -0,0 +1,182 @@
<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript" src="<%=resource%>/bmx7/js/polling.js"></script>
<style>
div.hideme{
display: none;
}
div.info{
background: #FFF;
border: solid 1px;
height: 80px;
display: block;
overflow: auto;
}
div.inforow{
text-align:left;
display:inline-block;
width:20%;
margin:5px;
vertical-align:top;
}
#extra-info ul { list-style: none outside none; margin-left: 0em; }
</style>
<div class="cbi-map">
<center>
<img src="<%=resource%>/bmx7/bmx7logo.png" />
<br />
<br />
A mesh routing protocol for Linux devices.<br />
Visit <a href="http://bmx6.net">bmx6.net</a> for more information.<br />
<br />
</center>
<div class="cbi-map-descr"></div>
<fieldset class="cbi-section">
<legend><%:Node configuration%></legend>
<table class="cbi-section-table" id="config_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Short ID%></th>
<th class="cbi-section-table-cell"><%:Node name%></th>
<th class="cbi-section-table-cell"><%:Primary IPv6 address%></th>
<th class="cbi-section-table-cell"><%:Node key%></th>
<th class="cbi-section-table-cell"><%:BMX7 revision%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="5"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:Node status%></legend>
<table class="cbi-section-table" id="status_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Nodes seen%></th>
<th class="cbi-section-table-cell"><%:Neighbours%></th>
<th class="cbi-section-table-cell"><%:Tunnelled IPv6 address%></th>
<th class="cbi-section-table-cell"><%:Tunnelled IPv4 address%></th>
<th class="cbi-section-table-cell"><%:Uptime%></th>
<th class="cbi-section-table-cell"><%:CPU usage%></th>
<th class="cbi-section-table-cell"><%:Memory usage%></th>
<th class="cbi-section-table-cell"><%:Tx queue%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="8"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:Interfaces%></legend>
<table class="cbi-section-table" id="ifaces_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Interface%></th>
<th class="cbi-section-table-cell"><%:State%></th>
<th class="cbi-section-table-cell"><%:Type%></th>
<th class="cbi-section-table-cell"><%:Max. rate%></th>
<th class="cbi-section-table-cell"><%:Link-local IPv6 address%></th>
<th class="cbi-section-table-cell"><%:Rx BpP%></th>
<th class="cbi-section-table-cell"><%:Tx BpP%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="7"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:Links%></legend>
<table class="cbi-section-table" id="links_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Short ID%></th>
<th class="cbi-section-table-cell"><%:Name%></th>
<th class="cbi-section-table-cell"><%:Link key%></th>
<th class="cbi-section-table-cell"><%:Remote link-local IPv6 address%></th>
<th class="cbi-section-table-cell"><%:Device%></th>
<th class="cbi-section-table-cell"><%:Rx rate%></th>
<th class="cbi-section-table-cell"><%:Tx rate%></th>
<th class="cbi-section-table-cell"><%:Routes%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="8"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
</div>
<script type="text/javascript">//<![CDATA[
new TablePooler(1,"/cgi-bin/bmx7-info", {'$info':''}, "config_table", function(st){
var res = Array();
var sta = st.info[0].status;
var ifaces = st.info[1].interfaces;
res.push([sta.shortId, sta.name, sta.primaryIp, sta.nodeKey, sta.revision]);
res.push(['','','','',''])
res.push(['','','','',''])
return res;
});
new TablePooler(1,"/cgi-bin/bmx7-info", {'$info':''}, "status_table", function(st){
var res = Array();
var sta = st.info[0].status;
var mem = st.info[3].memory;
var txQ = sta.txQ.split('/');
console.log(txQ)
var ptxQ = '<p style="color:rgb('+parseInt(255*txQ[0]/txQ[1])+','+parseInt(128*(txQ[1]-txQ[0])/txQ[1])+',0)")>'+sta.txQ+'</p>';
console.log(ptxQ)
res.push([sta.nodes, sta.nbs, sta.tun6Address, sta.tun4Address, sta.uptime, sta.cpu, mem.bmx7, ptxQ]);
res.push(['','','','','','','',''])
res.push(['','','','','','','',''])
return res;
});
new TablePooler(1,"/cgi-bin/bmx7-info", {'$info':''}, "ifaces_table", function(st){
var res = Array();
var sta = st.info[0].status;
var ifaces = st.info[1].interfaces;
ifaces.forEach(function(iface){
res.push([iface.dev, iface.state, iface.type, iface.rateMax, iface.localIp, iface.rxBpP, iface.txBpP]);
});
res.push(['','','','','','',''])
if (ifaces.length % 2 == 0)
res.push('')
res.push(['','','','','','',''])
return res;
});
new TablePooler(1,"/cgi-bin/bmx7-info", {'links':''}, "links_table", function(st){
var res = Array();
links = st.links;
links.forEach(function(link){
res.push([link.shortId, link.name, link.linkKey, link.nbLocalIp, link.dev, link.rxRate, link.txRate, link.routes]);
});
res.push(['','','','','','','',''])
if (links.length % 2 == 0)
res.push([])
res.push(['','','','','','','',''])
return res;
});
//]]></script>
<%+footer%>

View file

@ -0,0 +1,136 @@
#!/bin/sh
# Copyright © 2011 Pau Escrich
# Contributors Jo-Philipp Wich <xm@subsignal.org>
# Roger Pueyo Centelles <roger.pueyo@guifi.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# This script gives information about bmx7
# Can be executed from a linux shell: ./bmx7-info -s links
# Or from web interfae (with cgi enabled): http://host/cgi-bin/bmx7-info?links
# If you ask for a directory you wil get the directory contents in JSON forman
BMX7_DIR="$(uci get bmx7.general.runtimeDir 2>/dev/null)" || BMX7_DIR="/var/run/bmx7/json"
#Checking if shell mode or cgi-bin mode
if [ "$1" == "-s" ]; then
QUERY="$2"
else
QUERY="${QUERY_STRING%%=*}"
echo "Content-type: application/json"
echo ""
fi
check_path() {
[ -d "$1" ] && path=$(cd $1; pwd)
[ -f "$1" ] && path=$(cd $1/..; pwd)
[ $(echo "$path" | grep -c "^$BMX7_DIR") -ne 1 ] && exit 1
}
print_mem() {
echo -n '{ "memory": { "bmx7": "'
cat /proc/$(cat /var/run/bmx7/pid)/status |grep -i VmSize | tr -s " " | cut -d " " -f 2,3 | tr -d "\n"
echo '"}}'
}
print_query() {
# If the query is a directory
[ -d "$BMX7_DIR/$1" ] &&
{
# If /all has not been specified
[ -z "$QALL" ] &&
{
total=$(ls $BMX7_DIR/$1 | wc -w)
i=1
echo -n "{ \"$1\": [ "
for f in $(ls $BMX7_DIR/$1); do
echo -n "{ \"name\": \"$f\" }"
[ $i -lt $total ] && echo -n ','
i=$(( $i + 1 ))
done
echo -n " ] }"
# If /all has been specified, printing all the files together
} || {
comma=""
echo -n "[ "
for entry in "$BMX7_DIR/$1/"*; do
[ -f "$entry" ] &&
{
${comma:+echo "$comma"}
tr -d '\n' < "$entry"
comma=","
}
done
echo -n " ]"
}
}
# If the query is a file, just printing the file
[ -f "$BMX7_DIR/$1" ] && cat "$BMX7_DIR/$1";
}
if [ "${QUERY##*/}" == "all" ]; then
QUERY="${QUERY%/all}"
QALL=1
fi
if [ "$QUERY" == '$info' ]; then
echo '{ "info": [ '
print_query status
echo -n ","
print_query interfaces
echo -n ","
print_query links
echo -n ","
print_mem
echo "] }"
fi
if [ "$QUERY" == '$neighbours' ]; then
QALL=1
echo '{ "neighbours": [ '
echo '{ "originators": '
print_query originators
echo '}, '
echo '{ "descriptions": '
print_query descriptions
echo "} ] }"
exit 0
else if [ "$QUERY" == '$tunnels' ]; then
bmx7 -c --jshow tunnels /r=0
exit 0
else if [ "$QUERY" == '$originators' ]; then
bmx7 -c --jshow originators /r=0
exit 0
else
check_path "$BMX7_DIR/$QUERY"
print_query $QUERY
exit 0
fi
fi
fi
fi
ls -1F "$BMX7_DIR"
exit 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -0,0 +1,80 @@
/*
Copyright © 2011 Pau Escrich <pau@dabax.net>
Contributors Lluis Esquerda <eskerda@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
*/
/*
Table pooler is a function to easy call XHR poller.
new TablePooler(5,"/cgi-bin/bmx7-info", {'status':''}, "status_table", function(st){
var table = Array()
table.push(st.first,st.second)
return table
}
The parameters are:
polling_time: time between pollings
json_url: the json url to fetch the data
json_call: the json call
output_table_id: the table where javascript will put the data
callback_function: the function that will be executed each polling_time
The callback_function must return an array of arrays (matrix).
In the code st is the data obtained from the json call
*/
function TablePooler (time, jsonurl, getparams, table_id, callback) {
this.table = document.getElementById(table_id);
this.callback = callback;
this.jsonurl = jsonurl;
this.getparams = getparams;
this.time = time;
/* clear all rows */
this.clear = function(){
while( this.table.rows.length > 1 ) this.table.deleteRow(1);
}
this.start = function(){
XHR.poll(this.time, this.jsonurl, this.getparams, function(x, st){
var data = this.callback(st);
var content, tr, td;
this.clear();
for (var i = 0; i < data.length; i++){
tr = this.table.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
for (var j = 0; j < data[i].length; j++){
td = tr.insertCell(-1);
if (data[i][j].length == 2) {
td.colSpan = data[i][j][1];
content = data[i][j][0];
}
else content = data[i][j];
td.innerHTML = content;
}
}
}.bind(this));
}
this.start();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

View file

@ -1,8 +1,24 @@
#
# Copyright (C) 2014,2015 Hyperboria.net
#
# You may redistribute this program and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-cjdns PKG_NAME:=luci-app-cjdns
PKG_VERSION:=1.3 PKG_VERSION:=1.3
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_LICENSE:=GPL-3.0 PKG_LICENSE:=GPL-3.0

View file

@ -33,6 +33,10 @@ apt.datatype = "port"
apw = s:taboption("admin", Value, "admin_password", translate("Password")) apw = s:taboption("admin", Value, "admin_password", translate("Password"))
apw.datatype = "string" apw.datatype = "string"
-- Security
s:tab("security", translate("Security"), translate("Functionality related to hardening the cjdroute process."))
s:taboption("security", Flag, "seccomp", translate("SecComp sandboxing"))
-- UDP Interfaces -- UDP Interfaces
udp_interfaces = m:section(TypedSection, "udp_interface", translate("UDP Interfaces"), udp_interfaces = m:section(TypedSection, "udp_interface", translate("UDP Interfaces"),
translate("These interfaces allow peering via public IP networks, such as the Internet, or many community-operated wireless networks. IPv6 addresses should be entered with square brackets, like so: <code>[2001::1]</code>.")) translate("These interfaces allow peering via public IP networks, such as the Internet, or many community-operated wireless networks. IPv6 addresses should be entered with square brackets, like so: <code>[2001::1]</code>."))

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
if [ `uci get -q upnpd.config._pcproxy_configured` = "1" ] if [ `uci -q get upnpd.config._pcproxy_configured` = "1" ]
then then
exit exit
fi fi

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=miniupnpd PKG_NAME:=miniupnpd
PKG_VERSION:=1.9.20150307 PKG_VERSION:=2.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_URL:=http://miniupnp.free.fr/files PKG_SOURCE_URL:=http://miniupnp.free.fr/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=f91dc5647b1d2c13a82082a481a53e3d PKG_MD5SUM:=1c07a215dd9b362e75a9efc05e2fb3b4
PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi> PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/miniupnpd define Package/miniupnpd
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libnfnetlink DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid
TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
SUBMENU:=Firewall SUBMENU:=Firewall
URL:=http://miniupnp.free.fr/ URL:=http://miniupnp.free.fr/
@ -46,13 +46,14 @@ endef
define Build/Prepare define Build/Prepare
$(call Build/Prepare/Default) $(call Build/Prepare/Default)
echo "OpenWrt/$(OPENWRTVERSION)" | tr \(\)\ _ >$(PKG_BUILD_DIR)/os.openwrt echo "OpenWrt" | tr \(\)\ _ >$(PKG_BUILD_DIR)/os.openwrt
endef endef
MAKE_FLAGS += \ MAKE_FLAGS += \
TEST=0 \ TARGET_OPENWRT=1 TEST=0 \
LIBS="" \ LIBS="" \
CC="$(TARGET_CC) -DIPTABLES_143 -lnfnetlink -lip4tc $(if $(CONFIG_IPV6),-lip6tc)" \ CC="$(TARGET_CC) -DIPTABLES_143 \
-lip4tc $(if $(CONFIG_IPV6),-lip6tc) -luuid" \
CONFIG_OPTIONS="$(if $(CONFIG_IPV6),--ipv6) --leasefile" \ CONFIG_OPTIONS="$(if $(CONFIG_IPV6),--ipv6) --leasefile" \
-f Makefile.linux \ -f Makefile.linux \
miniupnpd miniupnpd

View file

@ -1,12 +0,0 @@
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -147,7 +147,8 @@ LDLIBS += $(shell $(PKG_CONFIG) --static
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack)
endif # ($(TEST),1)
-LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
+# n/a - we don't enable https server for IGD v2 anyway
+#LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o

View file

@ -0,0 +1,25 @@
We do not need to autodetect SSL/UUID; SSL we do not support, UUID we always do.
diff --git a/miniupnpd/Makefile.linux b/miniupnpd/Makefile.linux
index 2d28126..01daeea 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -153,14 +153,18 @@ LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libmnl)
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack)
endif # ($(TEST),1)
+ifeq ($(TARGET_OPENWRT),)
+# n/a - we don't enable https server for IGD v2 anyway in OpenWrt
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
+# n/a - we hardcodedly support libuuid
TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1)
ifeq ($(TEST),1)
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid)
else
$(info please install uuid-dev package / libuuid)
endif # ($(TEST),1)
+endif
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o

View file

@ -0,0 +1,20 @@
As it turns out, the 'magic' libuuid/bsd uuid check just checks
outside buildtree altogether for the uuid_generate. So we just
hardcode it.
--- a/genconfig.sh
+++ b/genconfig.sh
@@ -367,12 +367,7 @@ case $FW in
esac
# UUID API
-if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then
- echo "#define BSD_UUID" >> ${CONFIGFILE}
-fi
-if grep uuid_generate /usr/include/uuid/uuid.h > /dev/null 2>&1 ; then
- echo "#define LIB_UUID" >> ${CONFIGFILE}
-fi
+echo "#define LIB_UUID" >> ${CONFIGFILE}
# set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above
if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then

View file

@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=nat46 PKG_NAME:=nat46
PKG_VERSION:=4 PKG_VERSION:=6
PKG_RELEASE:=$(PKG_SOURCE_VERSION) PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ccbba8595d7ccbc2ccb1e7d81b420e9587f07fe5 PKG_SOURCE_VERSION:=8ff2ae59ec9840a7b8b45f976c51cae80abe0226
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org> PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -11,11 +11,11 @@ PKG_NAME:=ndppd
PKG_VERSION:=0.2.3 PKG_VERSION:=0.2.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_VERSION).tar.gz
# Latest release # Latest release
PKG_SOURCE_URL:=http://www.priv.nu/projects/ndppd/files/ PKG_SOURCE_URL:=https://github.com/DanielAdolfsson/ndppd/archive
PKG_MD5SUM:=d6f3243bb7fc04c8085371c9acddc50e PKG_MD5SUM:=1391c063db64b47541e58da12e5ae60d
PKG_LICENSE:=GPL-3.0+ PKG_LICENSE:=GPL-3.0+
# Development snapshot # Development snapshot

View file

@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=ohybridproxy PKG_NAME:=ohybridproxy
PKG_SOURCE_VERSION:=f2ba152799c481471ddc0213b3f98b1c143d97a3 PKG_SOURCE_VERSION:=8a28ae92c97099e771c9ede5641e3782ae809c27
PKG_VERSION:=2015-01-12-$(PKG_SOURCE_VERSION) PKG_VERSION:=2016-05-17-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=olsrd PKG_NAME:=olsrd
PKG_VERSION:=0.6.8 PKG_VERSION:=0.9.0.3
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.9
PKG_MD5SUM:=feabdd611391dcb30af5795e834cc258 PKG_MD5SUM:=fa5cf15c29c7ebd9b8425267676c7865
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause

View file

@ -8,7 +8,7 @@ SERVICE_WRITE_PID=1
OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes' OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2' OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2'
OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2' OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2 ipv6only:bool'
OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool LinkQualityMult:list2' OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool LinkQualityMult:list2'
OLSRD_INTERFACE_DEFAULTS_SCHEMA='AutoDetectChanges:bool' OLSRD_INTERFACE_DEFAULTS_SCHEMA='AutoDetectChanges:bool'
@ -397,7 +397,7 @@ olsrd_write_olsrd() {
[ "$OLSRD_COUNT" -gt 0 ] && return 0 [ "$OLSRD_COUNT" -gt 0 ] && return 0
config_get ipversion "$cfg" IpVersion config_get ipversion "$cfg" IpVersion
if [ "$UCI_CONF_NAME" == "olsrd6" ]; then if [ "$UCI_CONF_NAME" = "olsrd6" ]; then
OLSRD_OLSRD_SCHEMA="$OLSRD_OLSRD_SCHEMA IpVersion=6" OLSRD_OLSRD_SCHEMA="$OLSRD_OLSRD_SCHEMA IpVersion=6"
if [ "$ipversion" = "6and4" ]; then if [ "$ipversion" = "6and4" ]; then
error "IpVersion 6and4 not supported in olsrd6" error "IpVersion 6and4 not supported in olsrd6"
@ -703,21 +703,29 @@ olsrd_setup_smartgw_rules() {
IP6T=$(which ip6tables) IP6T=$(which ip6tables)
# Delete smartgw firewall rules first # Delete smartgw firewall rules first
for IPT in $IP4T $IP6T; do if [ "$UCI_CONF_NAME" = "olsrd6" ]; then
while $IPT -D forwarding_rule -o tnl_+ -j ACCEPT 2> /dev/null; do :;done while $IP6T -D forwarding_rule -o tnl_+ -j ACCEPT 2> /dev/null; do :;done
for IFACE in $wanifnames; do for IFACE in $wanifnames; do
while $IPT -D forwarding_rule -i tunl0 -o $IFACE -j ACCEPT 2> /dev/null; do :; done while $IP6T -D forwarding_rule -i tunl0 -o $IFACE -j ACCEPT 2> /dev/null; do :; done
done done
for IFACE in $ifsglobal; do for IFACE in $ifsglobal; do
while $IPT -D input_rule -i $IFACE -p 4 -j ACCEPT 2> /dev/null; do :; done while $IP6T -D input_rule -i $IFACE -p 4 -j ACCEPT 2> /dev/null; do :; done
done done
done else
while $IP4T -t nat -D postrouting_rule -o tnl_+ -j MASQUERADE 2> /dev/null; do :;done while $IP4T -D forwarding_rule -o tnl_+ -j ACCEPT 2> /dev/null; do :;done
for IFACE in $wanifnames; do
while $IP4T -D forwarding_rule -i tunl0 -o $IFACE -j ACCEPT 2> /dev/null; do :; done
done
for IFACE in $ifsglobal; do
while $IP4T -D input_rule -i $IFACE -p 4 -j ACCEPT 2> /dev/null; do :; done
done
while $IP4T -t nat -D postrouting_rule -o tnl_+ -j MASQUERADE 2> /dev/null; do :;done
fi
if [ "$smartgateway" == "yes" ]; then if [ "$smartgateway" = "yes" ]; then
log "$funcname() Notice: Inserting firewall rules for SmartGateway" log "$funcname() Notice: Inserting firewall rules for SmartGateway"
if [ ! "$smartgatewayuplink" == "none" ]; then if [ ! "$smartgatewayuplink" = "none" ]; then
if [ "$smartgatewayuplink" == "ipv4" ]; then if [ "$smartgatewayuplink" = "ipv4" ]; then
# Allow everything to be forwarded to tnl_+ and use NAT for it # Allow everything to be forwarded to tnl_+ and use NAT for it
$IP4T -I forwarding_rule -o tnl_+ -j ACCEPT $IP4T -I forwarding_rule -o tnl_+ -j ACCEPT
$IP4T -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE $IP4T -t nat -I postrouting_rule -o tnl_+ -j MASQUERADE
@ -731,7 +739,7 @@ olsrd_setup_smartgw_rules() {
for IFACE in $ifsglobal; do for IFACE in $ifsglobal; do
$IP4T -I input_rule -i $IFACE -p 4 -j ACCEPT $IP4T -I input_rule -i $IFACE -p 4 -j ACCEPT
done done
elif [ "$smartgatewayuplink" == "ipv6" ]; then elif [ "$smartgatewayuplink" = "ipv6" ]; then
$IP6T -I forwarding_rule -o tnl_+ -j ACCEPT $IP6T -I forwarding_rule -o tnl_+ -j ACCEPT
if [ "$nowan"="0" ]; then if [ "$nowan"="0" ]; then
for IFACE in $wanifnames; do for IFACE in $wanifnames; do

67
oonf-dlep-proxy/Makefile Normal file
View file

@ -0,0 +1,67 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=oonf-dlep-proxy
PKG_VERSION:=0.14.1-1
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
PKG_RELEASE:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_proxy" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
SUBMENU:=OLSR.org network framework
URL:=http://www.olsr.org/
endef
define Package/oonf-dlep-proxy
$(call Package/oonf-git/template)
TITLE:= Build DLEP Radio+Router Agent
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
VERSION:=$(PKG_VERSION)
endef
Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
Build/Install=
define Build/Install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_proxy;
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
define Package/oonf-dlep-proxy/install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_proxy
$(INSTALL_BIN) -D ./files/dlep_proxy.init $(1)/etc/init.d/dlep_proxy
$(INSTALL_BIN) -D ./files/dlep_proxy.hotplug $(1)/etc/hotplug.d/iface/50-dlep_proxy
$(INSTALL_DATA) -D ./files/dlep_proxy.uci $(1)/etc/config/dlep_proxy
endef
define Package/oonf-dlep-proxy/conffiles
/etc/config/dlep_proxy
endef
$(eval $(call BuildPackage,oonf-dlep-proxy))

View file

@ -0,0 +1,5 @@
#!/bin/sh
DAEMON='dlep_proxy'
. /lib/functions/oonf_hotplug.sh

View file

@ -0,0 +1,6 @@
#!/bin/sh /etc/rc.common
START=82
DAEMON='dlep_proxy'
. /lib/functions/oonf_init.sh

View file

@ -0,0 +1,24 @@
config global
option 'failfast' 'no'
option 'pidfile' '/var/run/dlep_proxy.pid'
option 'lockfile' '/var/lock/dlep_proxy'
config log
option 'syslog' 'true'
option 'stderr' 'true'
# option 'file' '/var/log/dlep_proxy.log'
# option 'info' 'all'
# option 'debug' 'all'
config telnet
# option 'port' '2009'
#config dlep_radio
# list 'name' 'eth0'
# option 'datapath_if' 'eth1'
# option 'not_proxied' 'false'
# option 'proxied' 'true'
#config dlep-router
# list 'name' 'eth0'
# option 'datapath_if' 'eth0'

67
oonf-dlep-radio/Makefile Normal file
View file

@ -0,0 +1,67 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=oonf-dlep-radio
PKG_VERSION:=0.14.1-1
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
PKG_RELEASE:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_radio" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
SUBMENU:=OLSR.org network framework
URL:=http://www.olsr.org/
endef
define Package/oonf-dlep-radio
$(call Package/oonf-git/template)
TITLE:= Build DLEP Radio Agent
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
VERSION:=$(PKG_VERSION)
endef
Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
Build/Install=
define Build/Install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_radio;
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
define Package/oonf-dlep-radio/install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_radio
$(INSTALL_BIN) -D ./files/dlep_radio.init $(1)/etc/init.d/dlep_radio
$(INSTALL_BIN) -D ./files/dlep_radio.hotplug $(1)/etc/hotplug.d/iface/50-dlep_radio
$(INSTALL_DATA) -D ./files/dlep_radio.uci $(1)/etc/config/dlep_radio
endef
define Package/oonf-dlep-radio/conffiles
/etc/config/dlep_radio
endef
$(eval $(call BuildPackage,oonf-dlep-radio))

View file

@ -0,0 +1,5 @@
#!/bin/sh
DAEMON='dlep_radio'
. /lib/functions/oonf_hotplug.sh

View file

@ -0,0 +1,6 @@
#!/bin/sh /etc/rc.common
START=82
DAEMON='dlep_radio'
. /lib/functions/oonf_init.sh

View file

@ -0,0 +1,24 @@
config global
option 'failfast' 'no'
option 'pidfile' '/var/run/dlep_radio.pid'
option 'lockfile' '/var/lock/dlep_radio'
config log
option 'syslog' 'true'
option 'stderr' 'true'
# option 'file' '/var/log/dlep_radio.log'
# option 'info' 'all'
# option 'debug' 'all'
config telnet
# option 'port' '2009'
config dlep_radio
list 'name' 'wlan0'
option 'datapath_if' 'br-lan'
option 'not_proxied' 'false'
option 'proxied' 'true'
config nl80211_listener
option 'if' 'wlan0'
option 'interval' '1.0'

View file

@ -0,0 +1,36 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=oonf-init-scripts
PKG_VERSION:=0.9.1-r3
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/oonf-init-scripts
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
SUBMENU:=OLSR.org network framework
URL:=http://www.olsr.org/
TITLE:= Common OONF startup scripts
VERSION:=$(PKG_VERSION)
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/oonf-init-scripts/install
$(INSTALL_BIN) -D ./files/oonf_init.sh $(1)/lib/functions/oonf_init.sh
$(INSTALL_BIN) -D ./files/oonf_hotplug.sh $(1)/lib/functions/oonf_hotplug.sh
endef
$(eval $(call BuildPackage,oonf-init-scripts))

View file

@ -0,0 +1,10 @@
#!/bin/sh
case "${ACTION}" in
ifup)
. /etc/rc.common /etc/init.d/${DAEMON} enabled && {
logger -t '${DAEMON}[hotplug]' -p daemon.info 'reloading configuration'
. /etc/rc.common /etc/init.d/${DAEMON} reload
}
;;
esac

View file

@ -0,0 +1,120 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
oonf_log()
{
logger -s -t ${DAEMON} -p daemon.info "${1}"
}
oonf_get_layer3_device()
{
local interface="${1}" # e.g. 'mywifi'
local status dev proto
local query="{ \"interface\" : \"${interface}\" }"
status="$( ubus -S call network.interface status "${query}" )" && {
json_load "${status}"
json_get_var 'dev' l3_device
json_get_var 'proto' proto
case "${proto}" in
pppoe)
# TODO: otherwise it segfaults
oonf_log "refusing to add '$interface', because of proto '${proto}'"
;;
*)
echo "${dev}" # e.g. 'wlan0-1'
;;
esac
}
}
oonf_add_devices_to_configuration()
{
local i=0
local device_name= section= interface= single_interface=
# make a copy of configuration and
# add a 'name' (physical name) for all
# 'interface-names' (e.g. mywifi)
#
# olsrd2.@interface[2]=interface
# olsrd2.@interface[2].ifname='wan lan wlanadhoc wlanadhocRADIO1'
# /var is in ramdisc/tmpfs
uci export ${DAEMON} >"/var/run/${DAEMON}_dev"
while section="$( uci -q -c /etc/config get "${DAEMON}.@[${i}]" )"; do {
echo "section: ${section}"
interface="$( uci -q -c /etc/config get "${DAEMON}.@[${i}].ifname" )" || {
i=$(( i + 1 ))
continue
}
case "$( uci -q get "${DAEMON}.@[${i}].ignore" )" in
1|on|true|enabled|yes)
oonf_log "removing/ignore section '$section'"
uci -q -c /var/run delete "${DAEMON}_dev.@[${j}]"
i=$(( i + 1 ))
continue
;;
esac
for single_interface in ${interface}; do {
device_name="$( oonf_get_layer3_device "${single_interface}" )"
echo "Interface: ${single_interface} = ${device_name}"
if [ ! -z "${device_name}" ]
then
# add option 'name' for 'ifname' (e.g. 'mywifi')
uci -q -c /var/run add_list "${DAEMON}_dev.@[${i}].name=${device_name}"
fi
} done
i=$(( $i + 1 ))
} done
uci -q -c /var/run commit "${DAEMON}_dev"
oonf_log "wrote '/var/run/${DAEMON}_dev'"
}
oonf_reread_config()
{
local pid
local pidfile="/var/run/${DAEMON}.pid"
if [ -e "${pidfile}" ]; then
read pid <"${pidfile}"
elif pidfile="$( uci -q get "${DAEMON}.@global[0].pidfile" )"; then
read pid <"${pidfile}"
fi
# if empty, ask kernel
pid="${pid:-$( pidof ${DAEMON} )}"
[ -n "${pid}" ] && kill -SIGHUP ${pid}
}
start()
{
oonf_add_devices_to_configuration
# produce coredumps
ulimit -c unlimited
service_start /usr/sbin/${DAEMON} --set global.fork=true --load uci:///var/run/${DAEMON}_dev
}
stop()
{
service_stop /usr/sbin/${DAEMON}
}
reload()
{
oonf_add_devices_to_configuration
oonf_reread_config
}

47
oonf-olsrd2/Config.in Normal file
View file

@ -0,0 +1,47 @@
# OONF Olsrd2 configuration
menu "Optional Plugins"
depends on PACKAGE_oonf-olsrd2
config OONF_NHDP_AUTOLL4
bool "Auto_LL4 plugin enabled"
help
The auto_ll4 plugin automatically generates linklocal IPv4 addresses on interfaces that do not contain IPv4 addresses.
default n
config OONF_OLSRV2_LAN_IMPORT
bool "Lan_import plugin enabled"
help
The lan_import plugin can read routing tables and automatically export them as locally attached networks in olsrd2.
default n
config OONF_OLSRV2_ROUTE_MODIFIER
bool "route_modifier plugin enabled"
help
The route_modifier plugin allows you to overwrite aspects of routes (like table/protocol) for certain destinations.
default n
config OONF_GENERIC_DLEP_ROUTER
bool "dlep_router plugin enabled"
help
The dlep_router plugin can receive linklayer metadata over the DLEP protocol.
default n
config OONF_GENERIC_REMOTECONTROL
bool "remotecontrol plugin enabled"
help
The remotecontrol plugin allows you to control configuration and logging over the telnet plugin. Be careful not to open this functionality over the network without securing it.
default n
config OONF_GENERIC_HTTP
bool "http plugin enabled"
help
The HTTP plugin allows HTTP access to all telnet commands.
default n
config OONF_OLSRV2_MPR
bool "MPR plugin enabled"
help
The MPR plugin reduce the routing graph to limit the overhead of the OLSRv2 protocol
default n
endmenu

87
oonf-olsrd2/Makefile Normal file
View file

@ -0,0 +1,87 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=oonf-olsrd2
PKG_VERSION:=0.14.1-1
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
PKG_RELEASE:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
SPACE:=
SPACE+=
CMAKE_OPTIONAL_PLUGINS:= $(subst $(SPACE),;,$(strip \
$(if $(filter y,$(CONFIG_OONF_NHDP_AUTOLL4)),auto_ll4,) \
$(if $(filter y,$(CONFIG_OONF_OLSRV2_LAN_IMPORT)),lan_import,) \
$(if $(filter y,$(CONFIG_OONF_OLSRV2_ROUTE_MODIFIER)),route_modifier,) \
$(if $(filter y,$(CONFIG_OONF_GENERIC_DLEP_ROUTER)),dlep_router,) \
$(if $(filter y,$(CONFIG_OONF_GENERIC_REMOTECONTROL)),remotecontrol,) \
$(if $(filter y,$(CONFIG_OONF_OLSRV2_MPR)),mpr,) \
$(if $(filter y,$(CONFIG_OONF_GENERIC_HTTP)),http,) \
))
BUILD_TYPE:= $(if $(filter y,$(CONFIG_DEBUG)),Debug,Release)
CMAKE_OPTIONS=-D CMAKE_BUILD_TYPE:String=$(BUILD_TYPE) \
-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;clock;duplicate_set;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;systeminfo;cfg_uciloader;cfg_compact;nhdpinfo;olsrv2info;netjsoninfo;${CMAKE_OPTIONAL_PLUGINS}" \
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
-D OONF_VERSION:String=$(PKG_VERSION) \
-D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
define Package/oonf-git/template
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
SUBMENU:=OLSR.org network framework
URL:=http://www.olsr.org/
MENU:=1
endef
define Package/oonf-olsrd2
$(call Package/oonf-git/template)
TITLE:= Build Olsrd V2 Routing Agent
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
VERSION:=$(PKG_VERSION)
endef
define Package/oonf-olsrd2/config
source "$(SOURCE)/Config.in"
endef
Build/Compile=$(call Build/Compile/Default,olsrd2_static)
Build/Install=
define Build/Install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/olsrd2;
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
define Package/oonf-olsrd2/install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/olsrd2
$(INSTALL_BIN) -D ./files/olsrd2.init $(1)/etc/init.d/olsrd2
$(INSTALL_BIN) -D ./files/olsrd2.hotplug $(1)/etc/hotplug.d/iface/50-olsrd2
$(INSTALL_DATA) -D ./files/olsrd2.uci $(1)/etc/config/olsrd2
endef
define Package/oonf-olsrd2/conffiles
/etc/config/olsrd2
endef
$(eval $(call BuildPackage,oonf-olsrd2))

View file

@ -0,0 +1,5 @@
#!/bin/sh
DAEMON='olsrd2'
. /lib/functions/oonf_hotplug.sh

6
oonf-olsrd2/files/olsrd2.init Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh /etc/rc.common
START=82
DAEMON='olsrd2'
. /lib/functions/oonf_init.sh

View file

@ -0,0 +1,40 @@
config global
option 'failfast' 'no'
option 'pidfile' '/var/run/olsrd2.pid'
option 'lockfile' '/var/lock/olsrd2'
config log
option 'syslog' 'true'
option 'stderr' 'true'
# option 'file' '/var/log/olsrd2.log'
# option 'info' 'all'
# option 'debug' 'all'
config telnet
# option 'port' '2009'
config olsrv2
# list 'lan' '::/0'
# list 'lan' '0.0.0.0/0'
config interface
option 'ifname' 'loopback'
config interface
list 'ifname' 'WIFI'
list 'ifname' 'wlanadhoc'
list 'ifname' 'wlanadhocRADIO1'
config interface
list 'ifname' 'wan'
option 'ignore' '1'
# option 'rx_bitrate' '100M'
# option 'tx_bitrate' '100M'
# option 'signal' '-20'
config interface
list 'ifname' 'lan'
option 'ignore' '1'
# option 'rx_bitrate' '1G'
# option 'tx_bitrate' '1G'
# option 'signal' '-10'

45
poprouting/Makefile Normal file
View file

@ -0,0 +1,45 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=prince
PKG_VERSION:=v0.3.1
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_USE_MIPS16:=0
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=prince-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/gabri94/poprouting.git
PKG_SOURCE_VERSION:=v0.3.1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/prince
SECTION :=net
CATEGORY :=Network
SUBMENU :=Routing and Redirection
Mantainer :=Gabriele Gemmi <gabriel@autistici.org>
TITLE :=PopRouting daemon
URL :=https://github.com/gabri94/poprouting
MENU :=0
DEPENDS := +libjson-c +libpthread
endef
define Package/prince/description
Prince is an open source implementation of the PopRouting Algorithm.
It has been developed as a Google Summer of Code Project in collaboration with Freifunk and the University of Trento.
It work by fetching topology data from a Link State routing demon(OONF, OLSR, OSPF, etc),
calculating the betweenness centrality using the topology, then using these data
the timer's value are optimized. Finally the timers are pushed back to the routing demon.
Currently it only supports OLSRd2 (aka OONF).
endef
define Package/prince/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/output/prince $(1)/usr/sbin/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/output/libprince_oonf_c.so $(1)/usr/lib/
endef
$(eval $(call BuildPackage,prince))

73
vis/Makefile Normal file
View file

@ -0,0 +1,73 @@
#
# Copyright (C) 2008-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=vis
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://git.open-mesh.org/vis.git
PKG_REV:=e141311c6a4fc824efbad536c137ed279905d825
PKG_VERSION:=1440
PKG_RELEASE:=0
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE
include $(INCLUDE_DIR)/package.mk
define Package/vis
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
DEPENDS:=+libpthread
TITLE:=visualization server for B.A.T.M.A.N. layer 3
URL:=https://www.open-mesh.org/
MAINTAINER:=Corinna "Elektra" Aichele <onelektra@gmx.net>
endef
define Package/vis/description
visualization server for B.A.T.M.A.N. layer 3
endef
MAKE_VIS_ARGS += \
EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
CCFLAGS="$(TARGET_CFLAGS)" \
OFLAGS="$(TARGET_CFLAGS)" \
REVISION="$(PKG_REV)" \
CC="$(TARGET_CC)" \
NODEBUG=1 \
UNAME="Linux" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \
vis install
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_VIS_ARGS)
endef
define Package/vis/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
endef
define Package/vis/conffiles
/etc/config/vis
endef
$(eval $(call BuildPackage,vis))