netstack: log upon attempted raw socket creation when --net-raw is missing

Helpful when debugging issues like #9917.
This commit is contained in:
Kevin Krakauer
2024-01-30 10:34:58 -08:00
parent aa8e121e8d
commit c351246ce8
+3
View File
@@ -167,6 +167,9 @@ func packetSocket(t *kernel.Task, epStack *Stack, stype linux.SockType, protocol
wq := &waiter.Queue{}
ep, err := epStack.Stack.NewPacketEndpoint(cooked, netProto, wq)
if err != nil {
if _, ok := err.(*tcpip.ErrNotPermitted); ok {
rawMissingLogger.Infof("A process tried to create a raw socket, which is disabled by default. Should the runtime config enable --net-raw?")
}
return nil, syserr.TranslateNetstackError(err)
}