From 95d707a71f20eb32a23cf7345702dc2b06c55af1 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 7 Sep 2018 17:24:43 +0200 Subject: [PATCH] pcpserver.c: properly fill the opcode field of response fixes #327 --- miniupnpd/pcpserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniupnpd/pcpserver.c b/miniupnpd/pcpserver.c index 01b4e7a..9acfb44 100644 --- a/miniupnpd/pcpserver.c +++ b/miniupnpd/pcpserver.c @@ -1434,7 +1434,7 @@ static int processPCPRequest(void * req, int req_size, pcp_info_t *pcp_msg_info) } -static void createPCPResponse(unsigned char *response, pcp_info_t *pcp_msg_info) +static void createPCPResponse(unsigned char *response, const pcp_info_t *pcp_msg_info) { response[2] = 0; /* reserved */ memset(response + 12, 0, 12); /* reserved */ @@ -1445,7 +1445,7 @@ static void createPCPResponse(unsigned char *response, pcp_info_t *pcp_msg_info) response[0] = pcp_msg_info->version; } - response[1] |= 0x80; /* r_opcode */ + response[1] = pcp_msg_info->opcode | 0x80; /* r_opcode */ response[3] = pcp_msg_info->result_code; if(epoch_origin == 0) { epoch_origin = startup_time;