mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 02:02:24 +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 := ""
|
dst := ""
|
||||||
if netRoute.Dst != nil {
|
if netRoute.Dst != nil {
|
||||||
if netRoute.Dst.IP.To4() != nil {
|
if netRoute.Dst.IP.To4() != nil {
|
||||||
dst = netRoute.Dst.IP.String()
|
dst = netRoute.Dst.String()
|
||||||
} else {
|
} else {
|
||||||
netmonLog.WithField("destination", netRoute.Dst.IP.String()).Warn("Not IPv4 format")
|
netmonLog.WithField("destination", netRoute.Dst.IP.String()).Warn("Not IPv4 format")
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ func TestConvertRoutes(t *testing.T) {
|
|||||||
|
|
||||||
expected := []vcTypes.Route{
|
expected := []vcTypes.Route{
|
||||||
{
|
{
|
||||||
Dest: testIPAddress,
|
Dest: testIPAddressWithMask,
|
||||||
Gateway: testIPAddress,
|
Gateway: testIPAddress,
|
||||||
Source: testIPAddress,
|
Source: testIPAddress,
|
||||||
Scope: uint32(testScope),
|
Scope: uint32(testScope),
|
||||||
|
Loading…
Reference in New Issue
Block a user