[Home]

Summary:ASTERISK-11121: [patch] pbx_dundi is not setting EID neither on FreeBSD or OSX (null mac address checking)
Reporter:Caio Begotti (caio1982)Labels:
Date Opened:2007-12-27 20:19:33.000-0600Date Closed:2008-01-11 16:50:51.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/pbx_dundi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) dundi_osx_eid6.diff.txt
( 1) dundi_osx_eid6-1.4.diff
Description:While playing around trunk on my OSX box I noticed that EID wasn't being correctly set by pbx_dundi. It kept telling me to do that manually, it could not discover my MAC address. Later I noticed it was actually always registering my loopback device (lo0) as the EID device but with an 00:00:00:00:00:00 address. Even then detecting the correct MAC address it kept telling it was my lo0 device being used, which was wrong...

The following patch solves all this and have been tested both on FreeBSD 6.2 and OSX 10.4. It now properly uses the first really available interface with its real MAC address. It can be a virtual device as well, like VMware's.

****** ADDITIONAL INFORMATION ******

I'm not sure since when it's been happening, but I've found that Rizzo removed those BSD includes some time ago during his usual cleanup, after revision 89348. Although that, I believe the 'if getifaddrs' portion of code has been broken on BSDish system even before that.
Comments:By: Caio Begotti (caio1982) 2007-12-28 07:02:09.000-0600

For the record, that will not affect Linux users since it uses SIOCGIFHWADDR for this.

By: Michiel van Baak (mvanbaak) 2008-01-02 17:24:27.000-0600

on OpenBSD 4.2 this patch does 2 things:
1. Make asterisk compile again
2. Show correct EID when running 'dundi show entityid'

+1 from me

By: Russell Bryant (russell) 2008-01-11 15:57:12.000-0600

Can you provide a 1.4 version of the patch, too?

By: Michiel van Baak (mvanbaak) 2008-01-11 16:12:13.000-0600

sure, let me work on it now

By: Caio Begotti (caio1982) 2008-01-11 16:28:56.000-0600

Ops, here it is Russell. Didn't want to wait, Michiel.

By: Michiel van Baak (mvanbaak) 2008-01-11 16:29:21.000-0600

The 1.4 patch is WAY smaller because it has all the correct header files there already. Trunk misses them because of the 'header inclusion cleanup' done earlier

By: Michiel van Baak (mvanbaak) 2008-01-11 16:29:54.000-0600

lol, teach me to refresh a bug before posting something to it ;)

By: Caio Begotti (caio1982) 2008-01-11 16:32:42.000-0600

Hahah mvanbaak, sorry :)

I guess ifap->ifa_name to p->ifa_name is important too.

By: Michiel van Baak (mvanbaak) 2008-01-11 16:40:28.000-0600

ah yes, that's the debug line.
I'll remove my patch.

By: Digium Subversion (svnbot) 2008-01-11 16:44:15.000-0600

Repository: asterisk
Revision: 98390

U   branches/1.4/pbx/pbx_dundi.c

------------------------------------------------------------------------
r98390 | russell | 2008-01-11 16:44:13 -0600 (Fri, 11 Jan 2008) | 9 lines

Fix up setting the EID on BSD based systems.

(closes issue ASTERISK-11121)
Reported by: caio1982
Patches:
     dundi_osx_eid6.diff.txt uploaded by caio1982 (license 22)
     dundi_osx_eid6-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, mvanbaak

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=98390

By: Digium Subversion (svnbot) 2008-01-11 16:50:51.000-0600

Repository: asterisk
Revision: 98400

_U  trunk/
U   trunk/pbx/pbx_dundi.c

------------------------------------------------------------------------
r98400 | russell | 2008-01-11 16:50:50 -0600 (Fri, 11 Jan 2008) | 17 lines

Merged revisions 98390 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98390 | russell | 2008-01-11 16:46:21 -0600 (Fri, 11 Jan 2008) | 9 lines

Fix up setting the EID on BSD based systems.

(closes issue ASTERISK-11121)
Reported by: caio1982
Patches:
     dundi_osx_eid6.diff.txt uploaded by caio1982 (license 22)
     dundi_osx_eid6-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, mvanbaak

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=98400