osmith has uploaded this change for review.
ggsn: f_wait_icmp4: ignore ICMPv4 redirect
In the test TC_pdp4_clients_interact_with_txseq, the testsuite opens two
PDP contexts and sends a ping (ICMP echo request) from the first context
to the second, then waits with f_wait_icmp4 until the ping arrives at
the second PDP context.
When running the test with testenv and podman, an additional ICMP
redirect packet arrives, before the ICMP echo request arrives. The
redirect packet has the TEID of the first PDP context, and so
f_wait_icmp4 fails if we don't ignore this redirect packet.
Adjust f_wait_icmp4 to ignore such redirect packets.
Change-Id: I6dff4db1fb0803a02f412ff23bb5dcac8e50a504
---
M ggsn_tests/GGSN_Tests.ttcn
M library/ICMP_Templates.ttcn
2 files changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/38264/1
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index c151346..6437f89 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -884,6 +884,16 @@
}
}
[] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud {
+ var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data;
+ var IPv4_packet ip4 := f_IPv4_dec(gpdu);
+ if (ip4.header.ver != 4) {
+ repeat;
+ }
+ var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload);
+ if (match(icmp4, tr_ICMPv4_RE)) {
+ log("Received ICMPv4 redirect, ignoring");
+ repeat;
+ }
setverdict(fail, "Received wrong local TEID");
}
[] GTPU.receive { setverdict(fail); }
diff --git a/library/ICMP_Templates.ttcn b/library/ICMP_Templates.ttcn
index cf88e93..892e4e2 100644
--- a/library/ICMP_Templates.ttcn
+++ b/library/ICMP_Templates.ttcn
@@ -50,6 +50,17 @@
}
}
+ /* template for receiving/matching an ICMPv4 redirect */
+ template (present) PDU_ICMP tr_ICMPv4_RE := {
+ redirect := {
+ type_field := 5,
+ code := ?,
+ checksum := ?,
+ gateway_internet_address := ?,
+ original_ip_msg := ?
+ }
+ }
+
/* template for receiving/matching an ICMPv6 Destination Unreachable */
template (present) PDU_ICMP tr_ICMPv4_DU := {
destination_unreachable := {
@@ -93,4 +104,4 @@
data[11] := cksum[1];
return data;
}
-}
\ No newline at end of file
+}
To view, visit change 38264. To unsubscribe, or for help writing mail filters, visit settings.