2013年5月7日 星期二

Samba issue with getaddrinfo

Issue:
Samba has the under log. Can’t get ip address from interface, for example eth0.
This may cause some unexpect wrong issue. like printer in samba can’t work add driver in WinXP. (But Win7 is workable)
   1: [xxxxxxxxxx] ../lib/util/util_net.c:70(interpret_string_addr_internal) interpret_string_addr_internal: getaddrinfo failed for name eth0 [Unknown host]
   2: [xxxxxxxxxx] lib/interface.c:390(interpret_interface) interpret_interface: Can't find address for eth0
   3: [xxxxxxxxxx] lib/interface.c:543(load_interfaces) WARNING: no network interfaces found
Enviroment:
Linux Kernel: V2.6.32.5
Samba3: V3.6.3
gcc: V3.4

Cause:
Because gcc 3.4 don’t have getaddrinfo library function. And default in samba always return –1 when gcc don’t support this function.

Solution:
Using getaddrinfo by samba.
Add line 3 to samba.3.6.3/source3/include/config.h And make again.
   1: /* Whether iface ifconf is available */
   2: /* #undef HAVE_IFACE_IFCONF */
   3: #define HAVE_IFACE_IFCONF 1

沒有留言: