Created
April 26, 2013 11:43
-
-
Save Habbie/5466775 to your computer and use it in GitHub Desktop.
Add ability to change port nproxy listens on.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur pdns-3.1.orig/pdns/nproxy.cc pdns-3.1.nproxyport/pdns/nproxy.cc | |
--- pdns-3.1.orig/pdns/nproxy.cc 2012-05-04 06:13:23.000000000 -0400 | |
+++ pdns-3.1.nproxyport/pdns/nproxy.cc 2012-07-13 10:00:47.394599792 -0400 | |
@@ -198,6 +198,7 @@ | |
("setgid", po::value<int>(), "setgid to this numerical user id") | |
("origin-address", po::value<string>()->default_value("::"), "Source address for notifications to PowerDNS") | |
("listen-address", po::value<vector<string> >(), "IP addresses to listen on") | |
+ ("listen-port", po::value<int>(), "Port to listen on") | |
("daemon,d", po::value<bool>()->default_value(true), "operate in the background") | |
("verbose,v", "be verbose"); | |
@@ -224,11 +225,17 @@ | |
else | |
addresses.push_back("::"); | |
+ int lport; | |
+ if(g_vm.count("listen-port")) | |
+ lport=g_vm["listen-port"].as<int>(); | |
+ else | |
+ lport=53; | |
+ | |
// create sockets to listen on | |
syslogFmt(boost::format("Starting up")); | |
for(vector<string>::const_iterator address = addresses.begin(); address != addresses.end(); ++address) { | |
- ComboAddress local(*address, 53); | |
+ ComboAddress local(*address, lport); | |
int sock = socket(local.sin4.sin_family, SOCK_DGRAM, 0); | |
if(sock < 0) | |
throw runtime_error("Creating socket for incoming packets: "+stringerror()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment