Skip to content

Commit

Permalink
pcpserver.c: properly fill the opcode field of response
Browse files Browse the repository at this point in the history
fixes #327
  • Loading branch information
miniupnp committed Sep 7, 2018
1 parent a2baa36 commit 95d707a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miniupnpd/pcpserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down

0 comments on commit 95d707a

Please sign in to comment.