<p dir="ltr">Hello Elliott,</p>
<p dir="ltr">I am writing my own native app (C) on Android where i need to get the MAC addr of my device.</p>
<p dir="ltr">Thats why i wanted to have the IOCTL.</p>
<p dir="ltr">Regards,<br>
Ashwini</p>
<div class="gmail_quote">On 28 Jun 2016 21:17, "enh" <<a href="mailto:enh@google.com">enh@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Jun 28, 2016 at 1:45 AM, Ashwini Sharma<br>
<<a href="mailto:ak.ashwini1981@gmail.com">ak.ashwini1981@gmail.com</a>> wrote:<br>
> Hello enh,<br>
><br>
> Android's original ifconfig was only showing the ip address for interface<br>
> and flags.<br>
><br>
> Otherwise ifconfig on other platforms gives out lot of other details. Does<br>
> it do so on Android?<br>
<br>
since we switched to toybox ifconfig, it behaves the same as toybox<br>
ifconfig everywhere else:<br>
<br>
$ adb shell ifconfig<br>
dummy0 Link encap:Ethernet HWaddr ae:7c:06:df:aa:06<br>
inet6 addr: fe80::ac7c:6ff:fedf:aa06/64 Scope: Link<br>
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1<br>
RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0<br>
RX bytes:0 TX bytes:210<br>
<br>
lo Link encap:Local Loopback<br>
inet addr:127.0.0.1 Mask:255.0.0.0<br>
inet6 addr: ::1/128 Scope: Host<br>
UP LOOPBACK RUNNING MTU:65536 Metric:1<br>
RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0<br>
RX bytes:0 TX bytes:0<br>
<br>
<br>
> I interested in how to get the MAC address at the ndk level. As earlier i<br>
> saw that SIOCGIFHWADDR is not supported.<br>
<br>
if you're in the untrustde_app SELinux domain, you won't be able to<br>
make that ioctl on Android. in other places it'll show up as<br>
all-zeros.<br>
<br>
> Is there a way to get the mac address.<br>
><br>
> Thanks,<br>
> Ashwini<br>
><br>
> On 27 Jun 2016 20:58, "enh" <<a href="mailto:enh@google.com">enh@google.com</a>> wrote:<br>
><br>
> ---<br>
> toys/android/start.c | 4 +++-<br>
> 1 file changed, 3 insertions(+), 1 deletion(-)<br>
><br>
> _______________________________________________<br>
> Toybox mailing list<br>
> <a href="mailto:Toybox@lists.landley.net">Toybox@lists.landley.net</a><br>
> <a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" rel="noreferrer" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
><br>
<br>
<br>
<br>
--<br>
Elliott Hughes - <a href="http://who/enh" rel="noreferrer" target="_blank">http://who/enh</a> - <a href="http://jessies.org/~enh/" rel="noreferrer" target="_blank">http://jessies.org/~enh/</a><br>
Android native code/tools questions? Mail me/drop by/add me as a reviewer.<br>
</blockquote></div>