Skip to content

Commit

Permalink
Set destination port same as received source port in request
Browse files Browse the repository at this point in the history
  • Loading branch information
herlesupreeth authored and axelsommerfeldt committed Mar 23, 2023
1 parent 8b62618 commit 9a0e3df
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/modules/ims_ipsec_pcscf/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,13 +1046,17 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d, int _cflags)
// for Reply and TCP sends to UE client port, for Reply and UDP sends to UE server port
// dst_port = dst_proto == PROTO_TCP ? s->port_uc : s->port_us;

// From P-CSCF client port
src_port = dst_proto == PROTO_TCP ? req->rcv.dst_port : s->port_pc;

if (vb && ((vb->port == s->port_uc) || (vb->port == s->port_us))) {
dst_port = vb->port;
// From Reply and TCP send via the same ports Request was recevied.
if (dst_proto == PROTO_TCP) {
src_port = req->rcv.dst_port;
dst_port = req->rcv.src_port;
} else {
dst_port = s->port_us;
src_port = s->port_pc;
if (vb && ((vb->port == s->port_uc) || (vb->port == s->port_us))) {
dst_port = vb->port;
} else {
dst_port = s->port_us;
}
}

// Check send socket
Expand Down

0 comments on commit 9a0e3df

Please sign in to comment.