Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Anton <>
Subject: Wireguard-go on Android 11+
Date: Wed, 12 Apr 2023 16:39:00 +0400	[thread overview]
Message-ID: <> (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:

best regards,

                 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \

* 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).