Skip to content

Commit

Permalink
sockops: Remove duplicate error logging
Browse files Browse the repository at this point in the history
If the compilation or loading of the sock_ops programs fail, we log the
error twice, first in the XXXEnable functions, then in the calling
function. This commit keeps only the error logging in Daemon.init().

Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno committed Jun 3, 2021
1 parent a33b703 commit cf910c3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/sockops/sockops.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,11 @@ func bpfLoadMapProg(object string, load string) error {
func SkmsgEnable() error {
err := bpfCompileProg(cIPC, oIPC)
if err != nil {
log.Error(err)
return err
}

err = bpfLoadMapProg(oIPC, eIPC)
if err != nil {
log.Error(err)
return err
}
log.Info("Sockmsg Enabled, bpf_redir loaded")
Expand Down Expand Up @@ -360,12 +358,10 @@ func bpfLoadAttachProg(object string, load string, mapName string) (int, int, er
func SockmapEnable() error {
err := bpfCompileProg(cSockops, oSockops)
if err != nil {
log.Error(err)
return err
}
progID, mapID, err := bpfLoadAttachProg(oSockops, eSockops, sockMap)
if err != nil {
log.Error(err)
return err
}
log.Infof("Sockmap Enabled: bpf_sockops prog_id %d and map_id %d loaded", progID, mapID)
Expand Down

0 comments on commit cf910c3

Please sign in to comment.