Commit 5c7a460a authored by Matt Layher's avatar Matt Layher
Browse files

syscall: hoist Getsockname out of NetlinkRIB loops

Calling Getsockname once to fetch the Pid field from the *SockaddrNetlink
is necessary, but this data will remain static for the rest of the netlink
socket's lifetime. Moving this call and type assertion outside of the inner
loops will remove a number of unnecessary system calls.

Change-Id: I7e7e81866af1a31fccdaaf7531efd6cc4cbb8926
Reviewed-on: https://go-review.googlesource.com/c/go/+/336369


Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matt Layher <mdlayher@gmail.com>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
parent 850768bb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment