iplib: Fix thread-unsafeness in myipaddr
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 22 Dec 2016 15:53:04 +0000 (10:53 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 10 Jan 2017 00:01:40 +0000 (19:01 -0500)
commit7f3ad37973fc96faabc3da71e0aad4dbe271af89
treeef5e1b81a104e0d180f7779332a04a4f69306b02
parent9b9c978cc9c15554fb706819ee01fece8dda3ac4
iplib: Fix thread-unsafeness in myipaddr

readipifc() has this nasty style of "pass in your old one and we'll free
it", presumably so the caller doesn't need to just free whatever they got.
Of course, this style leads to thread-unsafe practices.  You gotta store
that pointer somewhere!

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/iplib/include/iplib/iplib.h
user/iplib/myipaddr.c
user/iplib/readipifc.c