-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Device: Handle network info data gathering ourselves #10139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
I figured why stop there, and added ping support ;D. On the upside, I went the extra mile with unprivileged ICMP socket support (like iputils' ping). That may help on unrooted platforms, assuming the sysctl knob doesn't block its use ;p. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
Also, because I asked myself this yesterday: This is in Device instead of NetworkMgr mainly because it predates NetworkMgr ^^, and this may be platform-specific (e.g., overloaded by specific Device implementation; while Generic does not setup custom NetworkMgr methods by default, which would make this slightly less straightforward). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
Parse /proc/net/route ourselves to avoid dependency on specific networking tools
It's a single byte stored in an uint32_t, and apparently the high bytes like to be set to 0xFF instead of zero ;).
(Same variable name as in iwconfig)
Unions are fun.
Also went and dug up the actual kernel commit to pinpoint the minimum version required
Like iputils
It *is* enabled in some distros, though (e.g., Ubuntu Touch).
Should prevent mismatched typography rules, at least (e.g., hair space before colons in French).
Also, fix my T( usage ;p
Might have blown the layout on high pings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r8, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
Not that I bother, but on the emulator (not running as root), it crashes:
|
Oh, duh'; the usual "did my testing before implementing the final stupid idea" ;p. Fix is trivial, will do so later tonight ;). |
Don't blow up if we fall back to exec'ing ping Fix koreader#10139 (comment)
Don't blow up if we fall back to exec'ing ping Fix #10139 (comment)
table.insert(results, T(_("SSID: \"%1\""), ffi.string(essid))) | ||
end | ||
else | ||
table.insert(results, _("SSID: off/any")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly does any
mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair question, I'm assuming that means a hidden SSID (that's the same string as iwconfig, FWIW).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't realize it was just copying the logic more or less verbatim. (first search result with the source, probably a bit outdated)
i.e., we now query routes, interfaces, wireless extensions & ping ourselves, dropping the dependency on specific CLI tools altogether.
Depends on koreader/koreader-base#1584
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)