Don't fail if there are no existing nat mappings.

This commit is contained in:
Tom Wilkie
2015-09-23 03:35:53 +00:00
parent 5f82478452
commit b9ffca42e5

View File

@@ -194,10 +194,9 @@ func (c *Conntracker) existingConnections(args ...string) ([]Flow, error) {
}
}()
var result conntrack
if err := xml.NewDecoder(stdout).Decode(&result); err != nil {
if err == io.EOF {
return []Flow{}, err
}
if err := xml.NewDecoder(stdout).Decode(&result); err == io.EOF {
return []Flow{}, nil
} else if err != nil {
return []Flow{}, err
}
return result.Flows, nil