aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-01-25 17:19:05 +0000
committerChristian Grothoff <christian@grothoff.org>2013-01-25 17:19:05 +0000
commit06d7fc57df9e5d90c50b00337493bebcbee6e6c0 (patch)
treefbb2bba50eae1eab19dbdf36a14cbd501fe99179 /src/gns
parentfe25fb0534c0a1cf363ac3588c18cad391907e34 (diff)
downloadgnunet-06d7fc57df9e5d90c50b00337493bebcbee6e6c0.tar.gz
gnunet-06d7fc57df9e5d90c50b00337493bebcbee6e6c0.zip
-allow custom listen port
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/gnunet-dns2gns.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index 5329e4917..835010357 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -135,6 +135,12 @@ static char *fcfs_suffix;
135static char *dns_ip; 135static char *dns_ip;
136 136
137/** 137/**
138 * UDP Port we listen on for inbound DNS requests.
139 */
140static unsigned int listen_port = 53;
141
142
143/**
138 * Task run on shutdown. Cleans up everything. 144 * Task run on shutdown. Cleans up everything.
139 * 145 *
140 * @param cls unused 146 * @param cls unused
@@ -598,7 +604,7 @@ run (void *cls, char *const *args, const char *cfgfile,
598#if HAVE_SOCKADDR_IN_SIN_LEN 604#if HAVE_SOCKADDR_IN_SIN_LEN
599 v4.sin_len = sizeof (v4); 605 v4.sin_len = sizeof (v4);
600#endif 606#endif
601 v4.sin_port = htons (53); 607 v4.sin_port = htons (listen_port);
602 if (GNUNET_OK != 608 if (GNUNET_OK !=
603 GNUNET_NETWORK_socket_bind (listen_socket4, 609 GNUNET_NETWORK_socket_bind (listen_socket4,
604 (struct sockaddr *) &v4, 610 (struct sockaddr *) &v4,
@@ -621,7 +627,7 @@ run (void *cls, char *const *args, const char *cfgfile,
621#if HAVE_SOCKADDR_IN_SIN_LEN 627#if HAVE_SOCKADDR_IN_SIN_LEN
622 v6.sin6_len = sizeof (v6); 628 v6.sin6_len = sizeof (v6);
623#endif 629#endif
624 v6.sin6_port = htons (53); 630 v6.sin6_port = htons (listen_port);
625 if (GNUNET_OK != 631 if (GNUNET_OK !=
626 GNUNET_NETWORK_socket_bind (listen_socket6, 632 GNUNET_NETWORK_socket_bind (listen_socket6,
627 (struct sockaddr *) &v6, 633 (struct sockaddr *) &v6,
@@ -678,6 +684,9 @@ main (int argc,
678 {'f', "fcfs", "NAME", 684 {'f', "fcfs", "NAME",
679 gettext_noop ("Authoritative FCFS suffix to use (optional); default: fcfs.zkey.eu"), 1, 685 gettext_noop ("Authoritative FCFS suffix to use (optional); default: fcfs.zkey.eu"), 1,
680 &GNUNET_GETOPT_set_string, &fcfs_suffix}, 686 &GNUNET_GETOPT_set_string, &fcfs_suffix},
687 {'p', "port", "UDPPORT",
688 gettext_noop ("UDP port to listen on for inbound DNS requests; default: 53"), 1,
689 &GNUNET_GETOPT_set_uint, &listen_port},
681 GNUNET_GETOPT_OPTION_END 690 GNUNET_GETOPT_OPTION_END
682 }; 691 };
683 int ret; 692 int ret;