Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batman-adv: Fix best gw refcnt after netlink dump #1411

Merged

Conversation

ecsv
Copy link
Contributor

@ecsv ecsv commented Jun 2, 2018

This fixes a problem similar to the one described in #1258.

This patch will not apply on 2017.1.x. An adjusted version can be found in https://github.com/FreifunkVogtland/gluon/tree/batadv/gw_refcnt_fix-2017.1.x


A reference for the best gateway is taken when the list of gateways in the mesh is sent via netlink. This is necessary to check whether the currently dumped entry is the currently selected gateway or not. This information is then transferred as flag BATADV_ATTR_FLAG_BEST.

After the comparison of the current entry is done, batadv_*_gw_dump_entry() has to decrease the reference counter again. Otherwise the reference will be held and thus prevents a proper shutdown of
the batman-adv interfaces (and some of the interfaces enslaved in it).

@rotanid rotanid added the 0. type: bug This is a bug label Jun 2, 2018
A reference to the best gateway is taken when the list of gateways in the
mesh is sent via netlink. This is necessary to check whether the currently
dumped entry is the currently selected gateway or not. This information is
then transferred as flag BATADV_ATTR_FLAG_BEST.

After the comparison of the current entry is done,
batadv_*_gw_dump_entry() has to decrease the reference counter again.
Otherwise the reference will be held and thus prevents a proper shutdown of
the batman-adv interfaces (and some of the interfaces enslaved in it).

Fixes: 899235a4a637 ("Merge pull request freifunk-gluon#241 from ecsv/batman-adv-2016.4-maint-2016-10-29")
Reported-by: Andreas Ziegler <dev@andreas-ziegler.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
@rotanid
Copy link
Member

rotanid commented Jun 3, 2018

i tested this by using your branches:
https://github.com/FreifunkVogtland/gluon/tree/batadv/gw_refcnt_fix
https://github.com/FreifunkVogtland/gluon/tree/batadv/gw_refcnt_fix-2017.1.x
i couldn't reproduce my issue described in #1258 anymore with these branches, while another device with unpatched v2017.1.x running the test at the same time still shows the issues
thanks for your fix, ACK from my side

@neocturne
Copy link
Member

Thanks for finding and fixing this!

@neocturne neocturne merged commit e1a741b into freifunk-gluon:master Jun 3, 2018
@rubo77
Copy link
Contributor

rubo77 commented Jun 3, 2018

Was this bug also present in 2016?

@rotanid
Copy link
Member

rotanid commented Jun 3, 2018

@rubo77 no.

@ecsv ecsv deleted the batadv/gw_refcnt_fix branch June 7, 2018 06:57
SvenRoederer added a commit to SvenRoederer/freifunk-gluon_core that referenced this pull request Sep 29, 2019
d2dc32a luci-app-statistics: set logfile as first item in collectd.conf
a9bddc4 timezone data: update to 2017c
07e7ff0 Fixes freifunk-gluon#1413.
b74ef26 Merge pull request freifunk-gluon#1411 from Cye3s/lede-17.01
4a0877b luci_base: Update zh_TW base.po, translate fix
1aae4e9 luci_base: Update zh_CN base.po, translate fix
0ed8086 Merge pull request freifunk-gluon#1403 from StevenHessing/lede-17.01-noddos
d685c23 luci-app-noddos: backport from master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: bug This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants