Commit da924fc3 authored by Shyam Jeedigunta's avatar Shyam Jeedigunta

Make fake iptables' Save operation more realistic

parent f038c549
...@@ -72,8 +72,10 @@ func (*FakeIPTables) IsIpv6() bool { ...@@ -72,8 +72,10 @@ func (*FakeIPTables) IsIpv6() bool {
return false return false
} }
func (*FakeIPTables) Save(table iptables.Table) ([]byte, error) { func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error) {
return make([]byte, 0), nil lines := make([]byte, len(f.Lines))
copy(lines, f.Lines)
return lines, nil
} }
func (*FakeIPTables) SaveAll() ([]byte, error) { func (*FakeIPTables) SaveAll() ([]byte, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment