]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: function to get local nl_pid used by netlink event socket
authorLaine Stump <laine@laine.org>
Fri, 4 May 2012 17:19:51 +0000 (13:19 -0400)
committerLaine Stump <laine@laine.org>
Mon, 7 May 2012 18:25:55 +0000 (14:25 -0400)
commitc99e93758d44e7c6d62dbd3d064b6df61d1fefb2
treed4e1c9f281cbedfcb6647f08cb63faf53030c6c2
parentcca7bb1fb583459824f7a42be0406d0833a80593
util: function to get local nl_pid used by netlink event socket

This value will be needed to set the src_pid when sending netlink
messages to lldpad. It is part of the solution to:

  https://bugzilla.redhat.com/show_bug.cgi?id=816465

Note that libnl's port generation algorithm guarantees that the
nl_socket_get_local_port() will always be > 0 (since it is "getpid() +
(n << 22>" where n is always < 1024), so it is okay to cast the
uint32_t to int (thus allowing us to use -1 as an error sentinel).
src/libvirt_private.syms
src/util/virnetlink.c
src/util/virnetlink.h