|
@@ -276,11 +276,7 @@ func (c *ChainInfo) Forward(action Action, ip net.IP, port int, proto, destAddr
|
|
|
"--dport", strconv.Itoa(destPort),
|
|
|
"-j", "MASQUERADE",
|
|
|
}
|
|
|
- if err := ProgramRule(Nat, "POSTROUTING", action, args); err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
-
|
|
|
- return nil
|
|
|
+ return ProgramRule(Nat, "POSTROUTING", action, args)
|
|
|
}
|
|
|
|
|
|
// Link adds reciprocal ACCEPT rule for two supplied IP addresses.
|
|
@@ -301,10 +297,7 @@ func (c *ChainInfo) Link(action Action, ip1, ip2 net.IP, port int, proto string,
|
|
|
// reverse
|
|
|
args[7], args[9] = args[9], args[7]
|
|
|
args[10] = "--sport"
|
|
|
- if err := ProgramRule(Filter, c.Name, action, args); err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- return nil
|
|
|
+ return ProgramRule(Filter, c.Name, action, args)
|
|
|
}
|
|
|
|
|
|
// ProgramRule adds the rule specified by args only if the
|