Skip to content

Commit

Permalink
cathedral: only bind nat port if != 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvink committed Dec 3, 2024
1 parent 7592f2d commit 073c592
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ sanctum_proc_start(void)

io.crypto = sanctum_bind_local(&sanctum->local);

if (sanctum->mode == SANCTUM_MODE_CATHEDRAL) {
if (sanctum->mode == SANCTUM_MODE_CATHEDRAL &&
sanctum->cathedral_nat_port != 0) {
memcpy(&nat, &sanctum->local, sizeof(nat));
nat.sin_port = htobe16(sanctum->cathedral_nat_port);
io.nat = sanctum_bind_local(&nat);
Expand Down

0 comments on commit 073c592

Please sign in to comment.