Skip to content

Commit

Permalink
core: test if AF_PACKET is defined at compile time
Browse files Browse the repository at this point in the history
- mac os x (and perhaps *BSDs) doesn't have it
  • Loading branch information
miconda committed Apr 1, 2016
1 parent 597bef3 commit 8543993
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion socket_info.c
Expand Up @@ -1205,16 +1205,18 @@ int add_interfaces(char* if_name, int family, unsigned short port,

for (ifa = ifap; ifa; ifa = ifa->ifa_next)
{
#ifdef AF_PACKET
/* skip AF_PACKET addr family since it is of no use later on */
if (ifa->ifa_addr->sa_family == AF_PACKET)
continue;
#endif
if (if_name && strcmp(if_name, ifa->ifa_name))
continue;
if (family && family != ifa->ifa_addr->sa_family)
continue;
sockaddr2ip_addr(&addr, (struct sockaddr*)ifa->ifa_addr);
tmp=ip_addr2a(&addr);
if (ifa->ifa_flags & IFF_LOOPBACK)
if (ifa->ifa_flags & IFF_LOOPBACK)
flags = SI_IS_LO;
else
flags = SI_NONE;
Expand Down

1 comment on commit 8543993

@schoberw
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recompiled with your additions and works fine on my debian wheezy. Thanks!

root@build:~# ./kamailio  -f /etc/kamailio/kamailio.cfg -l eth0:5060 -P /var/run/kamailio/kamailio.pid -m 4 -M 8 -u kamailio -g kamailio
loading modules under config path: /usr/lib/x86_64-linux-gnu/kamailio/modules/
Listening on
             udp: *PUBLICIP*:5060
             tcp: *PUBLICIP*:5060
Aliases:
             tcp: build.test.at:5060
             udp: build.test.at:5060
             *: build.test.at:*

root@build:~# ./kamailio -V
version: kamailio 4.4.0 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 10:26:51 Apr  1 2016 with gcc 4.7.2

Please sign in to comment.