-t $DEV://00:00:00:00:00:00/0829 \
-l out.log | \
awk '{print "CM R->B [rx]:", $0}';
- grep 54:45:53:54 out.log || break
+ grep 54:45:53:54 out.log && break
done;
$MOREP -v 4 \
-t $DEV://00:00:00:00:00:00/0809 \
-l in.log | \
awk '{print "CM B->R [rx]:", $0}';
- grep 54:45:53:54 in.log || break
+ grep 54:45:53:54 in.log && break
done;
$MOREP -v 4 \
awk '{print "CM B->R [tx]:", $0}';
} &
pid=$!
+trap "kill -9 $pid; ip addr del dev eth0 10.1.0.1/24 && ip link del eth0 type dummy || echo no need to remove eth0;" 0 1 2 15
{ sleep 1; echo "TEST: This is a very long text" | nc -uq0 10.2.1.1 3000; } &
-$VPN \
#gdb $VPN --args $VPN \
+$VPN \
-v 5 -V 4 \
-d tun://tun0:$MTU \
-l tun://10.2.0.1 -r tun://10.2.1.0 \
char *cmremred = NULL;
int seqcheck = 0;
-int timeout = 100; /* ms */
+int timeout = 900; /* ms */
int stop = 0;
#define BUFMAX 4096
uint8_t msgtype = 0;
int in_len = 0;
int seqrx = MOREP_Receive_timeout (cm->rxblack, &msgtype, in, &in_len, timeout);
- VERBOSE (ulvpn, DEBUG, PRINTF ("received %d bytes from MOREP CM black\n", in_len));
- if ((msgtype != 0x01) || (in_len != out_len + 16) || ((seqcheck) && (seqtx != seqrx))) {
+ VERBOSE (ulvpn, DEBUG, PRINTF ("received msg %d, seq %d/%d, length %d/%d bytes from MOREP CM black\n", msgtype, seqtx, seqrx, out_len, in_len));
+ if ((msgtype != 0x01) || (in_len != out_len + 12 + 16) || ((seqcheck) && (seqtx != seqrx))) {
VERBOSE (ulvpn, WARNING, PRINTF ("non-coherent encrypted message\n"));
return 0;
}
uint8_t msgtype = 0;
int in_len = 0;
int seqrx = MOREP_Receive_timeout (cm->rxred, &msgtype, in, &in_len, timeout);
+ VERBOSE (ulvpn, DEBUG, PRINTF ("received msg %d, seq %d/%d, length %d/%d bytes from MOREP CM black\n", msgtype, seqtx, seqrx, out_len, in_len));
VERBOSE (ulvpn, DEBUG, PRINTF ("received %d bytes from MOREP CM red\n", in_len));
- if ((msgtype != 0x03) || (in_len != out_len - 16) || ((seqcheck) && (seqtx != seqrx))) {
+ if ((msgtype != 0x03) || (in_len != out_len - 12 - 16) || ((seqcheck) && (seqtx != seqrx))) {
VERBOSE (ulvpn, WARNING, PRINTF ("non-coherent decrypted message\n"));
return 0;
}