Make fake iptables' Save operation more realistic

pull/6/head
Shyam Jeedigunta 2017-05-16 00:56:58 +02:00
parent f038c5494e
commit da924fc337
1 changed files with 4 additions and 2 deletions

View File

@ -72,8 +72,10 @@ func (*FakeIPTables) IsIpv6() bool {
return false
}
func (*FakeIPTables) Save(table iptables.Table) ([]byte, error) {
return make([]byte, 0), nil
func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error) {
lines := make([]byte, len(f.Lines))
copy(lines, f.Lines)
return lines, nil
}
func (*FakeIPTables) SaveAll() ([]byte, error) {