Skip to content
Snippets Groups Projects
Commit 43fb687f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix issue when packing netmails for multiple different linked-nodes

Introduced in commit 15b230af (9 months ago), the first linked-node config
(including packet password!) for the first packed netmail message would be
reused for subsequent packed netmail messages.

Thank you to Wilfred van Velzen (2:280/464) for reporting this problem!

Additional debug-level log message when using a packet password for a newly
created packet.
parent 95a380d5
No related branches found
No related tags found
No related merge requests found
Pipeline #4939 passed
...@@ -947,8 +947,10 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_ ...@@ -947,8 +947,10 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_
hdr->type2.prodcode = SBBSECHO_PRODUCT_CODE&0xff; hdr->type2.prodcode = SBBSECHO_PRODUCT_CODE&0xff;
hdr->type2.sernum = SBBSECHO_VERSION_MAJOR; hdr->type2.sernum = SBBSECHO_VERSION_MAJOR;
if(nodecfg != NULL && nodecfg->pktpwd[0] != 0) if(nodecfg != NULL && nodecfg->pktpwd[0] != 0) {
lprintf(LOG_DEBUG, "Using packet password for %s: '%s'", smb_faddrtoa(&nodecfg->addr, NULL), nodecfg->pktpwd);
strncpy((char*)hdr->type2.password, nodecfg->pktpwd, sizeof(hdr->type2.password)); strncpy((char*)hdr->type2.password, nodecfg->pktpwd, sizeof(hdr->type2.password));
}
if(pkt_type == PKT_TYPE_2) if(pkt_type == PKT_TYPE_2)
return true; return true;
...@@ -965,7 +967,7 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_ ...@@ -965,7 +967,7 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_
/* 2e and 2+ */ /* 2e and 2+ */
if(pkt_type != PKT_TYPE_2_EXT && pkt_type != PKT_TYPE_2_PLUS) { if(pkt_type != PKT_TYPE_2_EXT && pkt_type != PKT_TYPE_2_PLUS) {
lprintf(LOG_ERR, "UNSUPPORTED PACKET TYPE: %u", pkt_type); lprintf(LOG_ERR, "UNSUPPORTED PACKET TYPE for %s: %u", smb_faddrtoa(&nodecfg->addr, NULL), pkt_type);
return false; return false;
} }
...@@ -5384,7 +5386,6 @@ void pack_netmail(void) ...@@ -5384,7 +5386,6 @@ void pack_netmail(void)
fidoaddr_t addr; fidoaddr_t addr;
addrlist_t msg_seen,msg_path; addrlist_t msg_seen,msg_path;
area_t fakearea; area_t fakearea;
nodecfg_t* nodecfg = NULL;
memset(&msg_seen,0,sizeof(msg_seen)); memset(&msg_seen,0,sizeof(msg_seen));
memset(&msg_path,0,sizeof(msg_path)); memset(&msg_path,0,sizeof(msg_path));
...@@ -5479,6 +5480,7 @@ void pack_netmail(void) ...@@ -5479,6 +5480,7 @@ void pack_netmail(void)
return; return;
} }
nodecfg_t* nodecfg = NULL;
if(addr.point != 0) { if(addr.point != 0) {
nodecfg = findnodecfg(&cfg, addr, /* exact: */true); nodecfg = findnodecfg(&cfg, addr, /* exact: */true);
if(nodecfg == NULL) { if(nodecfg == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment