Skip to content

Commit

Permalink
Extra log for failed enable of the IP forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
soffokl committed Sep 19, 2018
1 parent bd4d163 commit ed84b39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 2 additions & 6 deletions nat/service_iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,11 @@ func (service *serviceIPTables) Add(rule RuleForwarding) {
func (service *serviceIPTables) Start() error {
err := service.ipForward.Enable()
if err != nil {
return err
log.Warn(natLogPrefix, "Failed to enable IP forwarding: ", err)
}

service.clearStaleRules()
err = service.enableRules()
if err != nil {
return err
}
return nil
return service.enableRules()
}

func (service *serviceIPTables) Stop() {
Expand Down
6 changes: 5 additions & 1 deletion nat/service_pfctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ func (service *servicePFCtl) Add(rule RuleForwarding) {
}

func (service *servicePFCtl) Start() error {
service.ipForward.Enable()
err := service.ipForward.Enable()
if err != nil {
log.Warn(natLogPrefix, "Failed to enable IP forwarding: ", err)
}

service.clearStaleRules()
return service.enableRules()
}
Expand Down

0 comments on commit ed84b39

Please sign in to comment.