]> git.ipfire.org Git - thirdparty/asterisk.git/commit
utils.c: Fix ast_set_default_eid for multiple platforms 16/4116/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:33:10 +0000 (17:33 -0600)
commit74d9385273e914e3349cab63b7e478a0956bcf8a
tree596d7b2dae5ad44dd294f9e93c5ace343c2ab52c
parentd1d446b23795baa73969f725a1231dff6e0b0538
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