pdnsd leaking udp sockets

Ashish SHUKLA ashish at freebsd.org
Tue Feb 15 11:57:04 UTC 2011

Marius Nünnerich writes:
> Hi Ashish,


> dmesg and messages are clean. My FreeBSD ist 8.0-RELEASE/amd64.
> I took a look at the code too but couldn't see anything suspicious. I
> don't have time right now but one idea would be to add some dtrace
> probes to the source.

I looked at the source code, and found a place where it's leaking socket
descriptors, but I'm not sure if this is the major source of impact. I fixed
that. You can test the diff[1] to see if it fixes issue you're experiencing.

To reproduce this at my end, I switched to 'resolv.conf' server method and
commented 'server_ip' in the pdnsd.conf(5). Following are the contents of the

chateau.d.if!abbe:~ % cat /etc/resolv.conf

Before applying the diff, it is leaking following socket descriptor:

chateau.d.if!abbe:~ % sockstat -64  |fgrep pdns
nobody   pdnsd      38434 3  tcp4   *:53                  *:*
nobody   pdnsd      38434 4  udp4   *:*                   *:*
nobody   pdnsd      38434 5  udp4   *:53                  *:*

And with the diff applied:

chateau.d.if!abbe:~ % sockstat -64  |fgrep pdns
nobody   pdnsd      43666 3  tcp4   *:53                  *:*
nobody   pdnsd      43666 4  udp4   *:53                  *:*

[1]  http://people.freebsd.org/~ashish/diffs/pdnsd-sockets-leak.diff

Ashish SHUKLA      | GPG: F682 CDCC 39DC 0FEA E116  20B6 C746 CFA9 E74F A4B0
freebsd.org!ashish | http://people.freebsd.org/~ashish/

Avoid Success At All Costs !!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20110215/c6d6eab4/attachment.pgp

More information about the freebsd-ports mailing list