From 0b2206cd4222422001cfc525c0f3af1b5171a33e Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Mon, 15 Jan 2024 19:02:09 +0000 Subject: [PATCH] 6.0.24.27 --- ...=> BPQWinAPP.vcproj.NOTTSDESKTOP.John.user | 4 +- Bpq32.c | 3 +- ...er => CBPQ32.vcproj.NOTTSDESKTOP.John.user | 6 +- CommonCode.c | 13 ++-- GetVersion.h | 5 +- IPCode.c | 44 +++++++++++++ MailNode.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------------------- Versions.h | 4 +- ...WinRPRHelper.vcproj.NOTTSDESKTOP.John.user | 4 +- ...orControl.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------------------- ...inmorControl.vcproj.NOTTSDESKTOP.John.user | 4 +- 11 files changed, 68 insertions(+), 149 deletions(-) rename BPQMail.vcproj.DESKTOP-TGEL8RC.John.user => BPQWinAPP.vcproj.NOTTSDESKTOP.John.user (90%) rename CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user => CBPQ32.vcproj.NOTTSDESKTOP.John.user (87%) delete mode 100644 MailNode.vcproj.DESKTOP-TGEL8RC.John.user rename BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user => WinRPRHelper.vcproj.NOTTSDESKTOP.John.user (90%) delete mode 100644 WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user rename WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user => WinmorControl.vcproj.NOTTSDESKTOP.John.user (90%) diff --git a/BPQMail.vcproj.DESKTOP-TGEL8RC.John.user b/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user similarity index 90% rename from BPQMail.vcproj.DESKTOP-TGEL8RC.John.user rename to BPQWinAPP.vcproj.NOTTSDESKTOP.John.user index 40182c4..fa82c00 100644 --- a/BPQMail.vcproj.DESKTOP-TGEL8RC.John.user +++ b/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user @@ -15,7 +15,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" @@ -43,7 +43,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" diff --git a/Bpq32.c b/Bpq32.c index be103d3..bc76ca0 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1206,7 +1206,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // First pass at api (24) // Send OK in response to Rigcontrol CMD (24) // Disable CTS check in WriteComBlock (26) -// Improvments to reporting to M0LTE Map +// Improvments to reporting to M0LTE Map (26) +// IPGateway fix from github user isavitsky (27) #define CKernel diff --git a/CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user b/CBPQ32.vcproj.NOTTSDESKTOP.John.user similarity index 87% rename from CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user rename to CBPQ32.vcproj.NOTTSDESKTOP.John.user index fdd7820..f4ba73a 100644 --- a/CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user +++ b/CBPQ32.vcproj.NOTTSDESKTOP.John.user @@ -15,7 +15,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" @@ -37,13 +37,13 @@ Name="Release|Win32" > PortRecord; + struct PORTCONTROL * PORT = (struct PORTCONTROL *)TNC->PortRecord; - // Stop Scanner if (Stream == 0 || TNC->Hardware == H_UZ7HO) @@ -4877,7 +4876,7 @@ static char HeaderTemplate[] = "POST %s HTTP/1.1\r\n" "Content-Type: application/json\r\n" "Host: %s:%d\r\n" "Content-Length: %d\r\n" - //r\nUser-Agent: BPQ32(G8BPQ)\r\n" + "User-Agent: %s%s\r\n" // "Expect: 100-continue\r\n" "\r\n"; @@ -4891,7 +4890,11 @@ VOID SendWebRequest(SOCKET sock, char * Host, char * Request, char * Params, int char * ptr, * ptr1; int Sent; - sprintf(Header, HeaderTemplate, Request, Host, 80, Len, Params); +#ifdef LINBPQ + sprintf(Header, HeaderTemplate, Request, Host, 80, Len, "linbpq/", VersionString, Params); +#else + sprintf(Header, HeaderTemplate, Request, Host, 80, Len, "bpq32/", VersionString, Params); +#endif Sent = send(sock, Header, (int)strlen(Header), 0); Sent = send(sock, Params, (int)strlen(Params), 0); @@ -5088,7 +5091,7 @@ void SendDataToPktMap(char *Msg) MHJSON[0]=0; // G7TAJ // - printf("Sending to new map\n"); +// printf("Sending to new map\n"); sprintf(Request, "/api/NodeData/%s", MYNODECALL); diff --git a/GetVersion.h b/GetVersion.h index c239ae1..d830bef 100644 --- a/GetVersion.h +++ b/GetVersion.h @@ -11,13 +11,14 @@ void GetVersionInfo(char * File) char isDebug[40]=""; #ifdef SPECIALVERSION + strcat(isDebug, " "); strcat(isDebug, SPECIALVERSION); #endif #ifdef _DEBUG - strcat(isDebug, "Debug Build "); + strcat(isDebug, " Debug Build"); #endif - sprintf(VersionString,"%d.%d.%d.%d %s", Ver[0], Ver[1], Ver[2], Ver[3], isDebug); + sprintf(VersionString,"%d.%d.%d.%d%s", Ver[0], Ver[1], Ver[2], Ver[3], isDebug); sprintf(TextVerstring,"V%d.%d.%d.%d", Ver[0], Ver[1], Ver[2], Ver[3]); diff --git a/IPCode.c b/IPCode.c index efc4d91..7958b73 100644 --- a/IPCode.c +++ b/IPCode.c @@ -4539,6 +4539,50 @@ void OpenTAP() return; } + // Fix from github user isavitsky + + /* + * After some research I found that on most of my + * systems, including Raspberry Pi IV, a slight delay + * is needed before considering the TAP device + * up and running. Otherwise the interface structures + * do not initialise properly and later in the code + * around the line 4700 when we initialise our ARP + * structure: + * + * memcpy(Arp->HWADDR, xbuffer.ifr_hwaddr.sa_data, 6); + * + * the MAC address is getting filled in with random + * value which makes the communication via our TAP + * device using the configured IPADDR virtually + * impossible. + * + */ + + Debugprintf("Waiting for the TAP to become UP and RUNNING"); + + for (int i=10; i>0; i--) + { + Sleep(10); + + if ((err = ioctl(sockfd, SIOCGIFFLAGS, &ifr)) < 0) + { + perror("SIOCGIFFLAGS"); + return; + } + + if((ifr.ifr_flags & IFF_UP) && (ifr.ifr_flags & IFF_RUNNING)) + { + Debugprintf("TAP is UP and RUNNING"); + break; + } + else if (i == 1) + { + Debugprintf("TAP is still not UP and RUNNING"); + return; + } + } + printf("TAP brought up\n"); // Set MTU to 256 diff --git a/MailNode.vcproj.DESKTOP-TGEL8RC.John.user b/MailNode.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/MailNode.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/Versions.h b/Versions.h index 8a7c6e9..d86948c 100644 --- a/Versions.h +++ b/Versions.h @@ -10,8 +10,8 @@ #endif -#define KVers 6,0,24,26 -#define KVerstring "6.0.24.26\0" +#define KVers 6,0,24,27 +#define KVerstring "6.0.24.27\0" #ifdef CKernel diff --git a/BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user b/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user similarity index 90% rename from BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user rename to WinRPRHelper.vcproj.NOTTSDESKTOP.John.user index 40182c4..fa82c00 100644 --- a/BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user +++ b/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user @@ -15,7 +15,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" @@ -43,7 +43,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" diff --git a/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user b/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user b/WinmorControl.vcproj.NOTTSDESKTOP.John.user similarity index 90% rename from WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user rename to WinmorControl.vcproj.NOTTSDESKTOP.John.user index 40182c4..fa82c00 100644 --- a/WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user +++ b/WinmorControl.vcproj.NOTTSDESKTOP.John.user @@ -15,7 +15,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath="" @@ -43,7 +43,7 @@ Attach="false" DebuggerType="3" Remote="1" - RemoteMachine="DESKTOP-TGEL8RC" + RemoteMachine="NOTTSDESKTOP" RemoteCommand="" HttpUrl="" PDBPath=""