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

Commit

Permalink
Merge pull request #217 from amshinde/fix-uevent-error
Browse files Browse the repository at this point in the history
uevent: Fix netlink error while assigning pid in netlink client
  • Loading branch information
Sebastien Boeuf authored Apr 23, 2018
2 parents bdc70d4 + 8f828bb commit bf6f367
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit bf6f367

Please sign in to comment.