[hipl-dev] [Bug 790679] Re: Minor segfault on failed startup

  • From: David Martin <790679@xxxxxxxxxxxxxxxxxx>
  • To: hipl-dev@xxxxxxxxxxxxx
  • Date: Fri, 03 Jun 2011 12:27:12 -0000

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.

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.

** Changed in: hipl
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of HIPL core
team, which is subscribed to HIPL.
https://bugs.launchpad.net/bugs/790679

Title:
  Minor segfault on failed startup

Status in Host Identity Protocol for Linux:
  Fix Committed

Bug description:
  If the kernel module checks during startup fails, hipd segfaults
  instead of exiting nicely. This because the hip_xfrmapi_nl_ipsec
  (lib/tool/xfrmapi.c:49) hasn't been initialized before it is used in
  hip_delete_hit_sp_pair() [which is called on exit].

  quick & dirty patch attached

Other related posts: