mirror of
https://github.com/coredns/coredns.git
synced 2026-03-11 16:15:05 -04:00
chore(lint): bump golangci-lint to v2.11.1 (#7905)
- Added nolint to plugin/auto/walk.go to avoid a symlink/TOCTOU warning, as it needs to follow symlink. - Replaced a few flagged integer conversions with safe equivalents in cache hashing, reuseport socket setup, and TLS arg handling - Preallocated response rule slices in plugin/rewrite/name.go - Replaced WriteString(fmt.Sprintf/Sprintln(...)) with direct fmt.Fprint* calls - Removed stale nolint directives from code and tests that are no longer needed Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -14,7 +14,13 @@ import (
|
||||
|
||||
func control(network, address string, c syscall.RawConn) error {
|
||||
c.Control(func(fd uintptr) {
|
||||
if err := unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {
|
||||
const maxInt = int(^uint(0) >> 1)
|
||||
if fd > uintptr(maxInt) {
|
||||
log.Warningf("Failed to set SO_REUSEPORT on socket: invalid file descriptor %d", fd)
|
||||
return
|
||||
}
|
||||
|
||||
if err := unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil { // #nosec G115 -- fd is range-checked above
|
||||
log.Warningf("Failed to set SO_REUSEPORT on socket: %s", err)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user