Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

uevent: Fix netlink error while assigning pid in netlink client #217

Merged
merged 1 commit into from
Apr 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/uevent/uevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package uevent
import (
"bufio"
"io"
"os"
"strings"

"golang.org/x/sys/unix"
Expand All @@ -35,7 +34,9 @@ type ReaderCloser struct {
func NewReaderCloser() (io.ReadCloser, error) {
nl := unix.SockaddrNetlink{
Family: unix.AF_NETLINK,
Pid: uint32(os.Getpid()),
// Passing Pid as 0 here allows the kernel to take care of assigning
// it. This allows multiple netlink sockets to be used.
Pid: uint32(0),
Groups: 1,
}

Expand Down