diff options
-rw-r--r-- | udprelay.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -133,12 +133,6 @@ int main(int argc, char *argv[]) { return 1; }; - /* Allow UDP broadcasts on sending socket */ - if (setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(int)) < 0) { - perror("setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, ...)"); - return 1; - } - /* Set properties of source address */ srcaddr.sin_family = AF_INET; srcaddr.sin_port = htons(lstport); @@ -159,6 +153,12 @@ int main(int argc, char *argv[]) { return 1; } + /* Allow UDP broadcasts on sending socket */ + if (setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(int)) < 0) { + perror("setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, ...)"); + return 1; + } + /* Set destination port in outgoing packet */ *(u_short *)(packet + 22) = (u_short)htons(dstport); |