Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2018 13:05:09 +0000 (UTC)
From:      Emanuel Haupt <ehaupt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r474364 - in head/dns/utdns: . files
Message-ID:  <201807101305.w6AD59lW057237@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ehaupt
Date: Tue Jul 10 13:05:09 2018
New Revision: 474364
URL: https://svnweb.freebsd.org/changeset/ports/474364

Log:
  Provide a patch to specify the destination port.

Added:
  head/dns/utdns/files/patch-src_utdns.c   (contents, props changed)
Modified:
  head/dns/utdns/Makefile

Modified: head/dns/utdns/Makefile
==============================================================================
--- head/dns/utdns/Makefile	Tue Jul 10 13:03:02 2018	(r474363)
+++ head/dns/utdns/Makefile	Tue Jul 10 13:05:09 2018	(r474364)
@@ -4,6 +4,7 @@
 PORTNAME=	utdns
 PORTVERSION=	1.0
 DISTVERSIONSUFFIX=	.r1437
+PORTREVISION=	1
 CATEGORIES=	dns
 MASTER_SITES=	https://www.cypherpunk.at/download/utdns/ \
 		LOCAL/ehaupt

Added: head/dns/utdns/files/patch-src_utdns.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/utdns/files/patch-src_utdns.c	Tue Jul 10 13:05:09 2018	(r474364)
@@ -0,0 +1,45 @@
+--- src/utdns.c.orig	2013-04-17 08:20:51 UTC
++++ src/utdns.c
+@@ -622,7 +622,8 @@ static void usage(const char *argv0)
+          "   -4 .......... Bind to IPv4 only instead of IP + IPv6.\n"
+          "   -b .......... Background process and log to syslog.\n"
+          "   -d .......... Set log level to LOG_DEBUG.\n"
+-         "   -p <port> ... Set incoming UDP port number.\n",
++         "   -p <port> ... Set incoming UDP port number.\n"
++         "   -P <port> ... Set destination port number.\n",
+          argv0);
+ }
+ 
+@@ -642,7 +643,8 @@ int main(int argc, char **argv)
+    (void) init_log("stderr", debuglevel);
+ #endif
+ 
+-   while ((c = getopt(argc, argv, "4bdhp:")) != -1)
++   int dst_port = 53;
++   while ((c = getopt(argc, argv, "4bdhp:P:")) != -1)
+    {
+       switch (c)
+       {
+@@ -665,6 +667,10 @@ int main(int argc, char **argv)
+          case 'p':
+             udp_port = atoi(optarg);
+             break;
++
++	 case 'P':
++	    dst_port = atoi(optarg);
++	    break;
+       }
+    }
+ 
+@@ -674,10 +680,9 @@ int main(int argc, char **argv)
+       exit(EXIT_FAILURE);
+    }
+ 
+-   // FIXME: this should not be hardcoded
+    memset(&in, 0, sizeof(in));
+    in.sin_family = AF_INET;
+-   in.sin_port = htons(53);
++   in.sin_port = htons(dst_port);
+    if (!inet_aton(argv[optind], &in.sin_addr))
+    {
+       log_msg(LOG_ERR, "could not convert %s to in_addr\n", argv[optind]);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807101305.w6AD59lW057237>