From: Anton <jnashicq@googlemail.com>
To: wireguard@lists.zx2c4.com
Subject: Wireguard-go on Android 11+
Date: Wed, 12 Apr 2023 16:39:00 +0400 [thread overview]
Message-ID: <CAG_zMNJto2a5Et3-8MDLuDUon1W=Y4_em8vtP3vzg6Okb+uJ+A@mail.gmail.com> (raw)
Hi all,
I'm porting a Golang-based program [1] to Android11+ (API level 30)
and I've faced a problem,as the getifaddrs function is not available
for apps and other restrictions.
From Android developer documentation [2]:
>
> In addition, non-privileged apps can't access the device's MAC address; only network interfaces with an IP address are visible. This impacts the getifaddrs() and NetworkInterface.getHardwareAddress() methods, as well as sending RTM_GETLINK Netlink messages.
> The following is a list of the ways that apps are affected by this change:
> NetworkInterface.getHardwareAddress() returns null for every interface.
> Apps cannot use the bind() function on NETLINK_ROUTE sockets.
> The ip command does not return information about interfaces.
> Apps cannot send RTM_GETLINK messages.
>
I came up with a workaround [3], and now my app works OK.
External references:
https://github.com/mysteriumnetwork/node
https://developer.android.com/training/articles/user-data-ids#mac-11-plus
https://github.com/mysteriumnetwork/wireguard-go/pull/5/files
--
best regards,
Anton
reply other threads:[~2023-04-22 11:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG_zMNJto2a5Et3-8MDLuDUon1W=Y4_em8vtP3vzg6Okb+uJ+A@mail.gmail.com' \
--to=jnashicq@googlemail.com \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).