chiark / gitweb /
test: send an initial ping packet
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 11 Oct 2019 20:41:18 +0000 (21:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Oct 2019 22:29:26 +0000 (23:29 +0100)
The hex data came from
  ping -I secnet-test-i 172.18.232.1
  tcpdump -wt -isecnet-test-i
  tcpdump -rt -x

We send it twice because the first causes a key exchange and then gets
lost.

The result is that the script crashes with
  inside rx'd!

This is because we are pinging the remote secnet, which responds
without sending the packet to its host (ie, "outside.r" in our terms).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
test/invoke

index 30106d95538d62eea53c3594df103210be80d592..7182d13336286ec8f93afd42c2feb66cc137859a 100755 (executable)
@@ -139,7 +139,24 @@ $message
     exit 1
 }
 
+proc sendpkt {} {
+    global netlinkfh
+    set p {
+        4500 0054 ed9d 4000 4001 24da ac12 e809
+        ac12 e802 0800 1de4 2d96 0001 f1d4 a05d
+        0000 0000 507f 0b00 0000 0000 1011 1213
+        1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
+        2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
+        3435 3637
+    }
+    puts -nonewline $netlinkfh(inside.t) \
+       [hbytes h2raw c0[join $p ""]c0]
+}
+
 spawn-secnet inside
 spawn-secnet outside
 
+after 500 sendpkt
+after 1000 sendpkt
+
 vwait ok