[net-dns-users] Including protocol in the Nameserver $conn structure

John Kristoff jtk at dataplane.org
Fri Nov 19 22:36:17 UTC 2021


It would be really handy to know which transport the connection/socket
is using in the ReplyHandler with Net::DNS::Nameserver.  I'm going to
hack a version of the module myself for the time being, but ideally I'd
like to have this properly done in a future release if possible.

e.g.

$ diff -u orig.Nameserver.pm Nameserver.pm 
--- orig.Nameserver.pm	2021-11-19 16:20:00.931891729 -0600
+++ Nameserver.pm	2021-11-19 16:23:23.919528743 -0600
@@ -410,7 +410,8 @@
 				sockhost => $sock->sockhost,
 				sockport => $sock->sockport,
 				peerhost => $sock->peerhost,
-				peerport => $sock->peerport
+				peerport => $sock->peerport,
+				protocol => 6,
 				};
 			my $reply = $self->make_reply( $query, $sock->peerhost, $conn );
 			if ( not defined $reply ) {
@@ -463,7 +464,8 @@
 		sockhost => $sock->sockhost,
 		sockport => $sock->sockport,
 		peerhost => $sock->peerhost,
-		peerport => $sock->peerport
+		peerport => $sock->peerport,
+		protocol => 17,
 		};
 	my $reply = $self->make_reply( $query, $peerhost, $conn ) || return;

Thank you,

John


More information about the net-dns-users mailing list