-
Notifications
You must be signed in to change notification settings - Fork 90
Description
CanInterface uses the current process ID for nl_pid, which causes simultaneous accesses to CanInterface functions, as well as other code that opens netlink sockets with nl_pid=0, to fail.
According to the netlink(7) manual entry:
However, nl_pid identifies a netlink socket, not a process. If a process owns several netlink sockets, then nl_pid can be equal to the process ID only for at most one socket.
...
If the application sets nl_pid before calling bind(2), then it is up to the application to make sure that nl_pid is unique. If the application sets it to 0, the kernel takes care of assigning it. The kernel assigns the process ID to the first netlink socket the process opens and assigns a unique nl_pid to every netlink socket that the process subsequently creates.
Binding with nl_pid=0 should fix this.