]> git.ipfire.org Git - thirdparty/asterisk.git/commit
utils.c: Fix ast_set_default_eid for multiple platforms 17/4117/2
authorGeorge Joseph <gjoseph@digium.com>
Sun, 16 Oct 2016 22:25:35 +0000 (16:25 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Sun, 16 Oct 2016 23:35:33 +0000 (18:35 -0500)
commit13aa241b9c18c80ed33ae9a70218856bd8a644e8
tree55dd19e081bbc19c0e880c6672511ef7c395492c
parent1cfc5119f737223bd870f33db3b41f02f8ecff55
utils.c:  Fix ast_set_default_eid for multiple platforms

ast_set_default_eid was searching for ethX, emX, enoX, ensX and even
pciD#U interface names.  While this was a good attempt, it wasn't
inclusive enough to capture interfaces like enp6s0 or ens6d1, etc.

Rather than relying on interface names, we now simply find the first
interface returned by the OS that has a hardware address and that
address isn't all 0x00 or all 0xff.  The code IS different for BSD,
Solaris and Linux based on what method is available for enumerating
interfaces.

Tested on:
FreeBSD9
CentOS6
Ubuntu14
Fedora24

I was unable to test on Solaris at this time but the code for Solaris
is used elsewhere at Digium.

Change-Id: Iaa6db87ca78a9a375e47d70e043ae08c1448cb72
main/utils.c