2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-22 07:38:08 +00:00
Commit Graph

11 Commits

Author SHA1 Message Date
Vinícius Ferrão cce001abb8 refactor(dhcp): share the packet capture lifecycle
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-10-11 01:29:22 -03:00
Vinícius Ferrão 955713c4b2 fix(detect_dhcpd): capture into a private file and stop only its own tcpdump
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>
2026-09-10 03:12:16 -03:00
Vinícius Ferrão 20eef6d224 fix(detect_dhcpd): find tcpdump through PATH
Both copies refused to run unless /usr/sbin/tcpdump existed. Debian and Ubuntu
install it as /usr/bin/tcpdump, so the rogue DHCP detector never ran there and
the probe reported its tcpdump check as failed.

Resolve tcpdump through PATH and the standard system directories with
CommandUtils::find_executable, run the resolved path, and match that path when
the capture process is killed at the end.
2026-09-08 11:43:00 -03:00
Mark Gurevich 4614bbe515 Detect SLES15 when running detect_dhcpd xcatprobe 2022-03-07 15:17:07 -05:00
GONG Jie f97e276ffc Remove trailing spaces in file xCAT-probe/subcmds/detect_dhcpd 2017-12-31 23:59:59 +00:00
hu-weihua eda410a169 To support rhels7.4 DHCP response format 2017-10-12 05:24:39 -04:00
hu-weihua 758b1c9b96 Remove the Debian Support Message in the xcatprobe command. 2016-08-17 01:36:02 -04:00
Mark Gurevich fc1f1c575d xcat-probe grammar and spelling fixes 2016-08-16 13:18:18 -04:00
XuWei 1646d8bed2 Modify usage, some probe commands do not support hierarchy 2016-08-08 04:53:38 -04:00
hu-weihua 6c67f700e1 fix some bugs and change -t to -T 2016-07-04 05:18:55 -04:00
hu-weihua f3c7e7f156 Add new probe command to detect DHCP, base on original detect_dhcpd tool 2016-06-07 05:28:18 -04:00