[Clinkc-devel] [bug report] clinkc/src/cybergarage/net/cinterface_function.c
Brought to you by:
skonno
|
From: minhong <mi...@we...> - 2007-04-04 11:38:27
|
Hi, all
I found a bug in file located at =
clinkc/src/cybergarage/net/cinterface_function.c
In the function of cg_net_gethostinterfaces(), UNIX version, I think =
the following lines should be changed :
338 // if (getnameinfo(i->ifa_addr, sizeof(struct sockaddr), addr, =
NI_MAXHOST, NULL, 0, NI_NUMERICHOST) =3D=3D 0)
339 if (getnameinfo(i->ifa_addr, sizeof(struct sockaddr), addr, =
NI_MAXHOST, NULL, 0, NI_NUMERICHOST) !=3D 0)
342 // if (getnameinfo(i->ifa_netmask, sizeof(struct sockaddr), =
netmask, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) =3D=3D 0)
343 if (getnameinfo(i->ifa_netmask, sizeof(struct sockaddr), =
netmask, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) !=3D 0)
351 // cg_net_interface_setnetmask(netIf, addr);
352 cg_net_interface_setnetmask(netIf, netmask);
Briefly to say, the return value of getnameinfo will be 0 on =
success, however, in the originial source code
it seems that return value of 0 is an error ? That makes an =
interface be a wrong one such that an upnp device can't get started.
Also, the 2nd parameter of cg_net_interface_setnetmask() should be =
netmask instead of addr, right ?
After I make the 3 changes, the sample of clock device works well as =
running on Windows. |