Skip to content

Commit 7d9282b

Browse files
committed
fixed ip6tables command in error message
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
1 parent a543cbc commit 7d9282b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

iptables/iptables.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,16 +533,18 @@ func (iptable IPTable) raw(args ...string) ([]byte, error) {
533533
}
534534

535535
path := iptablesPath
536+
commandName := "iptables"
536537
if iptable.Version == IPv6 {
537538
path = ip6tablesPath
539+
commandName = "ip6tables"
538540
}
539541

540542
logrus.Debugf("%s, %v", path, args)
541543

542544
startTime := time.Now()
543545
output, err := exec.Command(path, args...).CombinedOutput()
544546
if err != nil {
545-
return nil, fmt.Errorf("iptables failed: iptables %v: %s (%s)", strings.Join(args, " "), output, err)
547+
return nil, fmt.Errorf("iptables failed: %s %v: %s (%s)", commandName, strings.Join(args, " "), output, err)
546548
}
547549

548550
return filterOutput(startTime, output, args...), err

0 commit comments

Comments
 (0)