summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2014-10-01 03:24:03 +0200
committerLuke Bratch <l_bratch@yahoo.co.uk>2014-10-01 03:24:03 +0200
commit9994da0a119d764994b921f252208a0cc89f50b5 (patch)
tree0e1d8a05716093bce2fb672458b3084539112ff8
parentf862ea896ebef66b83722104c2b708a59b13e97b (diff)
Fix silly paste location error in previous patch, my mistake
-rw-r--r--udprelay.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/udprelay.c b/udprelay.c
index aca49e8..94781b6 100644
--- a/udprelay.c
+++ b/udprelay.c
@@ -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);