[Debian-ha-maintainers] Bug#701914: cluster-agents: send_arp leaks socket fds, dies when all FDs consumed.

Tim Small tim at seoss.co.uk
Thu Feb 28 14:09:06 UTC 2013


Package: cluster-agents
Version: 1:1.0.3-3.1
Severity: normal

send_arp consumes all available FDs (one per packet sent), and then
exits.

e.g. stracing:

/usr/lib/heartbeat/send_arp -i 20 -r 512 -p
/var/run/heartbeat/rsctmp/send_arp-192.168.42.189-eth1 eth1
192.168.42.189 auto 192.168.42.189 ffffffffffff

Fails shortly before it would otherwise exit with:

16374 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = -1 EMFILE (Too many open
files)

This seems to be because the libnet function libnet_get_hwaddr() results
in the leak of one socket per ARP packet sent.

Hard coding the MAC address (as a proof of concept) appears to fix the
issue.

Haven't tried on newer libnet versions.

Given that send_arp sends the exact same pair of packets again,
and again, the binary could just build the two necessary packets, and
resend each alternately, I think?

Tim.

-- System Information:
Debian Release: 6.0.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



More information about the Debian-ha-maintainers mailing list