- tag being null causes crashes when vpp API is called
- null flags causes crashes, flags should be set at least to
default value (0)
Change-Id: If4e116212b1a85b312837830501ec226cec37bfa
Signed-off-by: Michal Cmarada <[email protected]>
import io.fd.jvpp.nat.dto.Nat44AddDelAddressRange;
import io.fd.jvpp.nat.dto.Nat64AddDelPoolAddrRange;
import io.fd.jvpp.nat.future.FutureJVppNatFacade;
+import io.fd.jvpp.nat.types.NatConfigFlags;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.nat.rev180510.ExternalIpAddressPoolAugmentation;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
getReplyForWrite(jvppNat.nat64AddDelPoolAddrRange(request).toCompletableFuture(), id);
} else {
final Nat44AddDelAddressRange request = getNat44Request(addressPool.getExternalIpPool(), isAdd);
+ if (request.flags == null) {
+ request.flags = new NatConfigFlags();
+ }
getReplyForWrite(jvppNat.nat44AddDelAddressRange(request).toCompletableFuture(), id);
}
}
request.localPort = internalPortNumber.shortValue();
request.externalPort = externalPortNumber.shortValue();
}
+ request.tag = "";
return request;
}
import io.fd.jvpp.nat.dto.Nat64AddDelPoolAddrRangeReply;
import io.fd.jvpp.nat.future.FutureJVppNatFacade;
import io.fd.jvpp.nat.types.Ip4Address;
+import io.fd.jvpp.nat.types.NatConfigFlags;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
expectedRequest.firstIpAddress.ip4Address = new byte[]{(byte) 192, (byte) 168, 1, 0};
expectedRequest.lastIpAddress = new Ip4Address();
expectedRequest.lastIpAddress.ip4Address = new byte[]{(byte) 192, (byte) 168, 1, (byte) 255};
+ expectedRequest.flags = new NatConfigFlags();
return expectedRequest;
}
expectedRequest.localIpAddress.ip4Address = new byte[]{(byte) 192, (byte) 168, 1, 87};
expectedRequest.externalIpAddress = new Ip4Address();
expectedRequest.externalIpAddress.ip4Address = new byte[]{45, 1, 5, 7};
+ expectedRequest.tag = "";
return expectedRequest;
}