Explorar o código

Add getter for the random-fully flag being supported

Arto Jantunen %!s(int64=6) %!d(string=hai) anos
pai
achega
194045f251
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      iptables/iptables.go

+ 5 - 0
iptables/iptables.go

@@ -303,6 +303,11 @@ func (ipt *IPTables) ChangePolicy(table, chain, target string) error {
 	return ipt.run("-t", table, "-P", chain, target)
 }
 
+// Check if the underlying iptables command supports the --random-fully flag
+func (ipt *IPTables) HasRandomFully() bool {
+	return ipt.hasRandomFully
+}
+
 // run runs an iptables command with the given arguments, ignoring
 // any stdout output
 func (ipt *IPTables) run(args ...string) error {