mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 17:52:40 +00:00
Merge pull request #1524 from amshinde/fix-netmon-routes-cidr
netmon: Fix bug in how routes are converted
This commit is contained in:
commit
d75e7fc8ca
@ -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")
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ func TestConvertRoutes(t *testing.T) {
|
||||
|
||||
expected := []vcTypes.Route{
|
||||
{
|
||||
Dest: testIPAddress,
|
||||
Dest: testIPAddressWithMask,
|
||||
Gateway: testIPAddress,
|
||||
Source: testIPAddress,
|
||||
Scope: uint32(testScope),
|
||||
|
Loading…
Reference in New Issue
Block a user