mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-11 12:06:24 +00:00
955713c4b2
Both copies wrote the capture to /tmp/dhcpdumpfile.log, so a file left by another user or an earlier root run blocked the probe and two runs overwrote each other. tcpdump ran behind a shell, so the script killed it by searching the process table for any tcpdump on the interface, and a tcpdump that failed to start left an empty file that read as zero DHCP servers. An interrupt left the capture running. The capture file is now a private temporary file removed on every exit. The child execs tcpdump itself, so the script stops and reaps exactly that pid, and a tcpdump that ended before the window did fails the run. A failed send and an INT or TERM stop the capture and exit 1 as well. Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>