Merge pull request #508 from weaveworks/506-conntrack-error

Don't fail if there are no existing NAT mappings.
This commit is contained in:
Tom Wilkie
2015-09-23 16:00:30 +08:00
+3 -4
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