-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Unpack Crash #12
Comments
In an effort to debug this further I have patched diff --git a/jvpn.pl b/jvpn.pl
index 95d951f..547beb9 100755
--- a/jvpn.pl
+++ b/jvpn.pl
@@ -553,10 +553,23 @@ if($mode eq "ncsvc") {
my $now = time - $start_t;
# printing RX/TX. This packet also contains encription type,
# compression and transport info, but length seems to be variable
- printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s",
- int($now / 3600), int(($now % 3600) / 60), int($now % 60),
- format_bytes(unpack('x[78]N',$data)), format_bytes(unpack('x[68]N',$data)));
- sleep(1);
+ eval {
+ my $hours = int($now / 3600);
+ my $minutes = int(($now % 3600) / 60);
+ my $seconds = int($now % 60);
+ my $txUnpack = unpack('x[78]N', $data);
+ my $rxUnpack = unpack('x[68]N', $data);
+ my $txBytes = format_bytes($txUnpack);
+ my $rxBytes = format_bytes($rxUnpack);
+ printf("Duration: %02d:%02d:%02d Sent: %s\tReceived: %s",
+ $hours, $minutes, $seconds, $txBytes, $rxBytes);
+ sleep(1);
+ } or do {
+ my $e = $@;
+ print("Something went wrong: $e\n");
+ hdump($data);
+ print("$data\n");
+ }
} This now outputs this when it encounters an error (line 560 is
I am no Perl ninja so I am not entirely sure what |
I'm seeing this error too. Usually when the VPN tunnel is dropped after the 24 hour connection time limit that is set on our VPN. I, too, am a bit vague on I suspect that the solution when this error occurs is to drop the connection and reconnect. But I can't see a tidy way to do that apart from |
@Line-Noise I usually get this within 45 minutes of the connection starting. Does not rule out it being some sort of connection drop message. Just that the timing is different. Oddly enough usually within a few minutes of receiving this 'bad' packet, I call it that for lack of better understanding, the connection resumes and continues on. It is definitely a weird situation. |
I like @RLovelett idea and i think i will import it. There is no any documentation of the format of the packets, so everything possible. Another suggestion is to try to use ncsvc mode, this could help. |
After successfully connecting to my VPN, occasionally the connection will die with the following error:
'x' outside of string in unpack at ./jvpn.pl line 556.
.Ultimately, it is not a show stopper issue because I can always restart the connection. It is just a nuisance.
The text was updated successfully, but these errors were encountered: