AmendHub

Download:

jcs

/

subtext

/

amendments

/

545

fidopkt: Properly extract per-message orig/dest node and net


jcs made amendment 545 about 1 year ago
--- fidopkt.c Wed Nov 15 08:48:09 2023 +++ fidopkt.c Thu Nov 16 13:22:58 2023 @@ -265,7 +265,17 @@ fidopkt_parse_message(char *packet_filename, struct fi } attr = GET_U16(buf + FIDOPKT_MSG_ATTR); - + + /* prefer message header values over packet header values */ + if (GET_U16(buf + FIDOPKT_MSG_ORIGNODE) != 0) { + orig_address.node = GET_U16(buf + FIDOPKT_MSG_ORIGNODE); + dest_address.node = GET_U16(buf + FIDOPKT_MSG_DESTNODE); + } + if (GET_U16(buf + FIDOPKT_MSG_ORIGNET) != 0) { + orig_address.net = GET_U16(buf + FIDOPKT_MSG_ORIGNET); + dest_address.net = GET_U16(buf + FIDOPKT_MSG_DESTNET); + } + buf += FIDOPKT_MSG_HEADER_SIZE; len -= FIDOPKT_MSG_HEADER_SIZE;