On Thu, Aug 14, 2014 at 08:35:39PM -0700, Nithin Raju wrote:
> To verify if the netlink support in the kernel works, I updated
> the netlink-socket.c code to get the PID for a given device
> descriptor.
> 
> In the existing code, userspace sets the PID, which will not be
> unique across different processes. So, it is better for the
> kernel to generate the PID and give it back to userspace.
> 
> I had to include odp-netlink.h to get the definition of
> struct ovs_header.
> 
> dpif-linux.c was ported to Windows (similar to Alin's change in
> the cloudbase repo) and was able to exercise the code changes
> in netlink-socket.c to read the PID. dpif-linux.c changes are
> not being checked in.
> 
> Signed-off-by: Nithin Raju <nit...@vmware.com>

I don't understand why get_sock_pid_from_kernel() returns a negative
errno only to have nl_sock_create() turn it back positive.  It seems
that it would be easier to return a positive errno to begin with.

I'm OK with the code otherwise given that the intent is to eventually
use nl_transact() instead.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to