]> git.ipfire.org Git - thirdparty/asterisk.git/commit
utils.c: Fix ast_set_default_eid for multiple platforms 18/4118/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:39 +0000 (18:35 -0500)
commit6651c66e68ac05927bc30347fec9b27d53cf98c0
tree3d2614fe431c6c00862826619c7eb803f9e6ad42
parent5df575e16a11a906cd76b21205173da743305777
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