Skip to content

Commit

Permalink
Reuse IMP interface UDP port.
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbrinkhoff committed Dec 29, 2024
1 parent b4ab2ed commit b254b9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/imp.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ static void args (int argc, char **argv)
static void make_socket (void)
{
struct sockaddr_in source;
int enable = 1;

imp_sock = socket (AF_INET, SOCK_DGRAM, 0);
if (imp_sock == -1)
fatal ("socket");

if (setsockopt(imp_sock, SOL_SOCKET, SO_REUSEADDR,
&enable, sizeof enable) != 0)
fatal ("setsockopt(SO_REUSEADDR)");

source.sin_family = AF_INET;
source.sin_addr.s_addr = INADDR_ANY;
source.sin_port = port;
Expand Down

0 comments on commit b254b9b

Please sign in to comment.