diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-11-22 15:09:25 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-11-22 15:09:25 +0000 |
| commit | 944fdfc524370b62a6a4cf2a057ea47e6f631f08 (patch) | |
| tree | 72d2ef9317d0745096a86e96c311a193a5cbcb4e /NETROMTCP.c | |
| parent | 3fbe745ec92c434dca98fba054624bd7654c7050 (diff) | |
| parent | 52e35f45b4cfefc21707b42883dd1afa142ac7d4 (diff) | |
Update upstream source from tag 'upstream/6.0.25.12+repack'
Update to upstream version '6.0.25.12+repack'
with Debian dir 0b59d86e0b6d3519d318d8e3302c0d9616ad0774
Diffstat (limited to 'NETROMTCP.c')
| -rw-r--r-- | NETROMTCP.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/NETROMTCP.c b/NETROMTCP.c index f756621..0710f73 100644 --- a/NETROMTCP.c +++ b/NETROMTCP.c @@ -110,7 +110,7 @@ struct ConnectionInfo * AllocateNRTCPRec() sockptr->SocketActive = TRUE;
sockptr->ConnectTime = sockptr->LastSendTime = time(NULL);
- Debugprintf("NRTCP Allocated %d", i);
+// Debugprintf("NRTCP Allocated %d", i);
return sockptr;
}
}
@@ -217,7 +217,7 @@ int NETROMOpenConnection(struct ROUTE * Route) farCall[ConvFromAX25(Route->NEIGHBOUR_CALL, farCall)] = 0;
- Debugprintf("Opening NRTCP Connection to %s", farCall);
+// Debugprintf("Opening NRTCP Connection to %s", farCall);
if (Route->TCPSession)
{
@@ -366,14 +366,14 @@ void NETROMConnectionAccepted(struct ConnectionInfo * sockptr) // Not sure we can do much here until first message arrives with callsign
sockptr->Connected = TRUE;
- Debugprintf("NRTCP Connection Accepted");
+// Debugprintf("NRTCP Connection Accepted");
}
void NETROMConnected(struct ConnectionInfo * sockptr, SOCKET sock, struct NRTCPSTRUCT * Info)
{
// Connection Complete
- Debugprintf("NRTCP Connected");
+// Debugprintf("NRTCP Connected");
sockptr->Connecting = FALSE;
sockptr->Connected = TRUE;
@@ -428,7 +428,7 @@ checkLen: // This must be an incoming connection as Call is set before calling so need to find route record and set things up.
- Debugprintf("New NRTCP Connection from %s", Msg->Call);
+// Debugprintf("New NRTCP Connection from %s", Msg->Call);
memcpy(Info->Call, Msg->Call, 10);
@@ -461,8 +461,13 @@ checkLen: if (memcmp(Info->Call, Msg->Call, 10) != 0)
{
- Debugprintf("Mismatch");
- // something wrong - maybe connection reused
+ Debugprintf("NRTCP Mismatch - closing connection");
+
+ closesocket(sockptr->socket);
+ sockptr->SocketActive = FALSE;
+ memset(sockptr, 0, sizeof(struct ConnectionInfo));
+ Info->Call[0] = 0;
+ return 0;
}
// Format as if come from an ax.25 link
@@ -593,6 +598,7 @@ void NETROMConnectionLost(struct ConnectionInfo * sockptr) Route->TCPSession = 0;
Info->Call[0] = 0;
+ Info->LINK->L2STATE = 0;
}
sockptr->SocketActive = FALSE;
|
