Merge pull request #1524 from amshinde/fix-netmon-routes-cidr

netmon: Fix bug in how routes are converted
This commit is contained in:
Sebastien Boeuf 2019-04-15 08:38:15 -06:00 committed by GitHub
commit d75e7fc8ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ func convertRoutes(netRoutes []netlink.Route) []vcTypes.Route {
dst := ""
if netRoute.Dst != nil {
if netRoute.Dst.IP.To4() != nil {
dst = netRoute.Dst.IP.String()
dst = netRoute.Dst.String()
} else {
netmonLog.WithField("destination", netRoute.Dst.IP.String()).Warn("Not IPv4 format")
}

View File

@ -213,7 +213,7 @@ func TestConvertRoutes(t *testing.T) {
expected := []vcTypes.Route{
{
Dest: testIPAddress,
Dest: testIPAddressWithMask,
Gateway: testIPAddress,
Source: testIPAddress,
Scope: uint32(testScope),