Untag and stop watch on network sockets before closing them.
This patch untags the network sockets tagged with qtaguid_tagSocket()
before closing them, releasing the socket from the qtaguid kernel
module. Without this patch, the socket won't be actually closed.
This patch also removes the socket watch right before closing it, which
forces the epoll to stop watching. Closing the file descriptor would
also stop the watch if no other copy of the socket is kept open.
Explicitly stoping the watch is safer.
Test: Ran update_engine under strace; the /proc/net/xt_qtaguid/ctrl
is called and the socket object destroyed and removed from the epoll.
2 files changed