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

empty service in networkmanager defaultRouteChanged signal #143

Open
swex opened this issue Dec 15, 2014 · 5 comments
Open

empty service in networkmanager defaultRouteChanged signal #143

swex opened this issue Dec 15, 2014 · 5 comments

Comments

@swex
Copy link
Contributor

swex commented Dec 15, 2014

I use libconnman-qt with actual revisions of connman and ofono. When I've got cellular service as default route I've got signal with empty service from networkmanager.
I think it caused by https://github.com/nemomobile/libconnman-qt/blob/master/libconnman-qt/networkmanager.cpp#L337
this code does not meet expected flags (0003) in my case /proc/net/route looks like:
ppp0 8AA6B40A 00000000 0005 0 0 0 FFFFFFFF 0 0 0
ppp0 010057D5 00000000 0005 0 0 0 FFFFFFFF 0 0 0
ppp0 010157D5 00000000 0005 0 0 0 FFFFFFFF 0 0 0
ppp0 00000000 00000000 0001 0 0 0 00000000 0 0 0
I think in case of only one destionation is 00000000 it must consider as default route only with RTF_UP flag
flag & 0x1 // RTF_UP 0x0001

@tigeli
Copy link
Contributor

tigeli commented Dec 16, 2014

Yes, valid issue with ppp-links where you can have default route with interface defined.

It would be probably valid to have line 337 changed to:
if (lineList.at(1) == "00000000" && (lineList.at(3) == "0003" || lineList.at(3) == "0001")) {

and line 354:

if (ipv6lineList.at(0) == "00000000000000000000000000000000" && (ipv6lineList.at(8).endsWith("3") || ipv6lineList.at(8).endsWith("1")))

@lpotter
Copy link
Contributor

lpotter commented Dec 16, 2014

Except that breaks the exact reason why this function was enhanced, because it was reporting defaultRoute for services that weren't properly the default route yet.

I would say it is not the default route without that flag set.

@tigeli
Copy link
Contributor

tigeli commented Dec 16, 2014

@lpotter Yeah, I don't have any old devices which I could have ppp running on so can't really test..
However it is valid to have an default route without gateway being set (on point-to-point links), and then it will not have that flag set.

@swex
Copy link
Contributor Author

swex commented Dec 16, 2014

Maybe let such route will be consider default only with ppp prefix in first field or if its the only 00000000 destination route?

@lpotter
Copy link
Contributor

lpotter commented Dec 17, 2014

I could agree to if it's the only route && ppp in prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants