Your patch works as it makes the pointer point to the struct correctly. It's just that on
exiting it is not yet set up yet and all values initialized to 0 (gcc default for static
structs or all static variables? I'm not sure there). That's why it won't send any messages
with your patch either:
error(hipd/hipd.c:345@hipd_main): hipd_init() failed!
error(lib/tool/nlink.c:279@netlink_talk): Cannot talk to rtnetlinkSocket operation on non-socket
error(lib/tool/xfrmapi.c:382@hip_xfrm_policy_delete): Security policy deletion failed.
Your patch works as it makes the pointer point to the struct correctly. It's just that on
exiting it is not yet set up yet and all values initialized to 0 (gcc default for static
structs or all static variables? I'm not sure there). That's why it won't send any messages
with your patch either:
error(hipd/ hipd.c: 345@hipd_ main): hipd_init() failed! tool/nlink. c:279@netlink_ talk): Cannot talk to rtnetlinkSocket operation on non-socket tool/xfrmapi. c:382@hip_ xfrm_policy_ delete) : Security policy deletion failed.
error(lib/
error(lib/
And here comes in what Miika and René said. Your patch fixes one wrong call which is nice.
But making netlink_talk() more robust so that it can deal with any wrong call is more reliable.