diff --git a/AISCommon.c b/AISCommon.c index 300e888..a193d2f 100644 --- a/AISCommon.c +++ b/AISCommon.c @@ -3201,6 +3201,19 @@ static VOID ADSBConnect(void * unused) destaddr.sin_family = AF_INET; destaddr.sin_port = htons(ADSBPort); + if (destaddr.sin_addr.s_addr == INADDR_NONE) + { + // Resolve name to address + + struct hostent * HostEnt = gethostbyname(ADSBHost); + + if (!HostEnt) + return; // Resolve failed + + memcpy(&destaddr.sin_addr.s_addr,HostEnt->h_addr,4); + } + + TCPSock = socket(AF_INET,SOCK_STREAM,0); if (TCPSock == INVALID_SOCKET) diff --git a/APRSCode.c b/APRSCode.c index d3fe994..76b0140 100644 --- a/APRSCode.c +++ b/APRSCode.c @@ -4273,6 +4273,18 @@ static VOID TCPConnect(void * unused) destaddr.sin_family = AF_INET; destaddr.sin_port = htons(HostPort); + if (destaddr.sin_addr.s_addr == INADDR_NONE) + { + // Resolve name to address + + struct hostent * HostEnt = gethostbyname(HostName); + + if (!HostEnt) + return; // Resolve failed + + memcpy(&destaddr.sin_addr.s_addr,HostEnt->h_addr,4); + } + TCPSock = socket(AF_INET,SOCK_STREAM,0); if (TCPSock == INVALID_SOCKET) diff --git a/ARDOP.c b/ARDOP.c index ced421c..1e1c9be 100644 --- a/ARDOP.c +++ b/ARDOP.c @@ -3522,7 +3522,7 @@ VOID ARDOPProcessResponse(struct TNCINFO * TNC, UCHAR * Buffer, int MsgLen) if (_memicmp(Buffer, "PINGACK ", 8) == 0) { WritetoTrace(TNC, Buffer, MsgLen - 1); - // Drop through to return touser + // Drop through to return to user } if (_memicmp(Buffer, "CQ ", 3) == 0 && MsgLen > 10) diff --git a/Bpq32.c b/Bpq32.c index 26d4ef3..63903d4 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1133,6 +1133,12 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Fix SESSIONTIMELIMIT processing // Add STOPPORT/STARTPORT for UZ7HO driver // Fix processing of extended QtSM 'g' frame (36) +// Allow setting just freq on Yaseu rigs (37) +// Enable KISSHF driver on Linux (40) +// Allow AISHOST and ADSBHOST to be a name as well as an address (41) +// Fix Interlock of incoming UZ7HO connections (41) +// Disable VARA Actions menu if not sysop (41) +// Fix Port CTEXT on UZ7HO B C or D channels (42) #define CKernel diff --git a/ChatUtilities.c b/ChatUtilities.c index 50b6b8b..a255faf 100644 --- a/ChatUtilities.c +++ b/ChatUtilities.c @@ -14,7 +14,7 @@ int SEMCLASHES = 0; VOID __cdecl Debugprintf(const char * format, ...) { - char Mess[1000]; + char Mess[65536]; va_list(arglist);int Len; va_start(arglist, format); @@ -29,7 +29,7 @@ VOID __cdecl Debugprintf(const char * format, ...) VOID __cdecl Logprintf(int LogMode, ChatCIRCUIT * conn, int InOut, const char * format, ...) { - char Mess[1000]; + char Mess[65536]; va_list(arglist);int Len; va_start(arglist, format); @@ -85,7 +85,7 @@ void FreeSemaphore(struct SEM * Semaphore) VOID __cdecl nodeprintf(ChatCIRCUIT * conn, const char * format, ...) { - char Mess[1000]; + char Mess[65536]; int len; va_list(arglist); diff --git a/Cmd.c b/Cmd.c index 19e3af4..f6c3fc1 100644 --- a/Cmd.c +++ b/Cmd.c @@ -3975,11 +3975,16 @@ VOID ATTACHCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, CMDX if (rxInterlock == OtherTNC->RXRadio || txInterlock == OtherTNC->TXRadio) // Same Group { - if (OtherTNC->PortRecord->ATTACHEDSESSIONS[0]) - { - Bufferptr = Cmdprintf(Session, Bufferptr, "Sorry, interlocked port %d is in use\r", i); - SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER)); - return; + int n; + + for (n = 0; n <= 26; n++) + { + if (OtherTNC->PortRecord->ATTACHEDSESSIONS[n]) + { + Bufferptr = Cmdprintf(Session, Bufferptr, "Sorry, interlocked port %d is in use\r", i); + SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER)); + return; + } } } } diff --git a/HTTPcode.c b/HTTPcode.c index 6ea9e76..488b366 100644 --- a/HTTPcode.c +++ b/HTTPcode.c @@ -2307,6 +2307,9 @@ doHeader: if (TNC == 0) return 1; + if (LOCAL == FALSE && COOKIE == FALSE) + return 1; + if (strcmp(input, "Abort") == 0) { if (TNC->ForcedCloseProc) diff --git a/HanksRT.c b/HanksRT.c index 0a8eca5..a65b38e 100644 --- a/HanksRT.c +++ b/HanksRT.c @@ -130,7 +130,7 @@ int AddtoHistory(struct user_t * user, char * text) struct HistoryRec * Rec; struct HistoryRec * ptr; int n = 1; - char buf[512]; + char buf[2048]; char Stamp[16]; struct tm * tm; time_t Now = time(NULL); @@ -150,6 +150,9 @@ int AddtoHistory(struct user_t * user, char * text) tm = gmtime(&Now); + if (strlen(text) + strlen(user->name) + strlen(user->call) > 2000) + return 0; // Shouldn't be that long, but protect buffer + sprintf(Stamp,"%02d:%02d ", tm->tm_hour, tm->tm_min); sprintf(buf, "%s%-6.6s %s %c %s\r", Stamp, user->call, user->name, ':', text); @@ -290,11 +293,11 @@ VOID __cdecl nprintf(ChatCIRCUIT * conn, const char * format, ...) { // seems to be printf to a socket - char buff[600]; + char buff[65536]; va_list(arglist); va_start(arglist, format); - vsprintf(buff, format, arglist); + vsnprintf(buff, sizeof(buff), format, arglist); nputs(conn, buff); } @@ -517,6 +520,11 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe WCHAR BufferW[65536]; UCHAR BufferB[65536]; + // Sanity Check + + if (len > 32768) + return; + // Convert to UTF8 if not already in UTF-8 if (len == 73 && memcmp(&OrigBuffer[40], " ", 20) == 0) diff --git a/LinBPQ.c b/LinBPQ.c index cd1dd3d..8c1e940 100644 --- a/LinBPQ.c +++ b/LinBPQ.c @@ -1379,6 +1379,7 @@ void * SerialExtInit(EXTPORTDATA * PortEntry); void * WinRPRExtInit(EXTPORTDATA * PortEntry); void * HSMODEMExtInit(EXTPORTDATA * PortEntry); void * FreeDataExtInit(EXTPORTDATA * PortEntry); +void * KISSHFExtInit(EXTPORTDATA * PortEntry); void * InitializeExtDriver(PEXTPORTDATA PORTVEC) { @@ -1455,6 +1456,9 @@ void * InitializeExtDriver(PEXTPORTDATA PORTVEC) if (strstr(Value, "VARA")) return VARAExtInit; + if (strstr(Value, "KISSHF")) + return KISSHFExtInit; + if (strstr(Value, "SERIAL")) return SerialExtInit; diff --git a/RigControl.c b/RigControl.c index aa38953..e0d38be 100644 --- a/RigControl.c +++ b/RigControl.c @@ -820,36 +820,6 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, int Session, return FALSE; } - if (RIG->RIGOK == 0) - { - if (Session != -1) - { - if (PORT->Closed) - sprintf(Command, "Sorry - Radio port closed\r"); - else - sprintf(Command, "Sorry - Radio not responding\r"); - } - return FALSE; - } - - if (n == 2 && _stricmp(FreqString, "FREQ") == 0) - { - if (RIG->Valchar[0]) - sprintf(Command, "Frequency is %s MHz\r", RIG->Valchar); - else - sprintf(Command, "Frequency not known\r"); - - return FALSE; - } - - if (n == 2 && _stricmp(FreqString, "PTT") == 0) - { - Rig_PTTEx(RIG, TRUE, NULL); - RIG->PTTTimer = 10; // 1 sec - sprintf(Command, "Ok\r"); - return FALSE; - } - if (n > 1) { if (_stricmp(FreqString, "SCANSTART") == 0) @@ -905,6 +875,38 @@ int Rig_CommandEx(struct RIGPORTINFO * PORT, struct RIGINFO * RIG, int Session, } } + + + if (RIG->RIGOK == 0) + { + if (Session != -1) + { + if (PORT->Closed) + sprintf(Command, "Sorry - Radio port closed\r"); + else + sprintf(Command, "Sorry - Radio not responding\r"); + } + return FALSE; + } + + if (n == 2 && _stricmp(FreqString, "FREQ") == 0) + { + if (RIG->Valchar[0]) + sprintf(Command, "Frequency is %s MHz\r", RIG->Valchar); + else + sprintf(Command, "Frequency not known\r"); + + return FALSE; + } + + if (n == 2 && _stricmp(FreqString, "PTT") == 0) + { + Rig_PTTEx(RIG, TRUE, NULL); + RIG->PTTTimer = 10; // 1 sec + sprintf(Command, "Ok\r"); + return FALSE; + } + RIG->Session = Session; // BPQ Stream RIG->PollCounter = 50; // Dont read freq for 5 secs in case clash with Poll diff --git a/UZ7HODrv.c b/UZ7HODrv.c index 94088a5..d17e409 100644 --- a/UZ7HODrv.c +++ b/UZ7HODrv.c @@ -2179,15 +2179,17 @@ VOID ProcessAGWPacket(struct TNCINFO * TNC, UCHAR * Message) if (TNC == NULL) return; + PORT = &TNC->PortRecord->PORTCONTROL; + if (strstr(Message, " To Station")) { char noStreams[] = "No free sessions - disconnecting\r"; // Incoming. Look for a free Stream - Stream = 1; + Stream = 0; - while(Stream <= AGW->MaxSessions) + while(Stream < AGW->MaxSessions) { if (TNC->PortRecord->ATTACHEDSESSIONS[Stream] == 0) goto GotStream; diff --git a/VARA.c b/VARA.c index 271fcdd..5dddeca 100644 --- a/VARA.c +++ b/VARA.c @@ -918,8 +918,9 @@ char WebProcTemplate[] = "" "{location.reload()}\n" "\r\n" "