[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 01383) question about netlink and getifaddrs



Hi guys,

I have in a program an opened NETLINK socket waiting for messages. When
I run getifaddr without closing that NETLINK socket, getifaddr will stop
at recvmsg. After tracing through both getifaddr and af_netlink, I think
the reason is because the recvmsg meant for getifaddr was sent to the
opened socket through netlink_unicast (since netlink send messages
through matching pid). I tried setting the dst_groups before the NETLINK
socket binding, but to no avail. 

I overcome the problem by doing a fork() inside getifaddr so that it is
using another pid, but I don't think it's a good solution. Does anyone
knows how to get getifaddr working without closing the NETLINK socket? 

thanks for any advices...
jon.