Skip to content

file descriptor leak when processing UDP packets #46

@tmueller64

Description

@tmueller64

When pen is configured to forward UDP packets, I'm seeing an increasing number of open UDP file descriptors until eventually the process terminates. The root cause appears to be in the add_client method where the downfd socket is opened but is then never closed.

Here is a bit of output from lsof which shows the open file descriptors (pen is being used to forward Kerberos port 88 UDP packets):

pen 4173 root 318u IPv4 10252194 0t0 UDP 10.1.8.71:kerberos->98.161.23.149:60888
pen 4173 root 319u IPv4 10252195 0t0 UDP 10.1.8.71:58509->10.1.93.108:kerberos
pen 4173 root 320u IPv4 10252196 0t0 UDP 10.1.8.71:kerberos->98.161.23.149:60888
pen 4173 root 321u IPv4 10252197 0t0 UDP 10.1.8.71:42021->10.1.93.108:kerberos

Here 10.1.8.71 is the IP address of the host running pen, 10.1.93.108 is the server that packets are being forwarded to, and 98.161.23.149 is a client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions