我在做DHCP中继POC。我的设置如下。
DHCP客户端(VX-works)----------- DHCP中继----------- DHCP服务器(VXworks)
在此设置中,DHCP客户端正在发送DICOVER数据包,但中继代理未收到数据包。我查看了代码,发现Berkeley Packet Filtering(BPF)应用于套接字。 DHCP Relay只是丢弃数据包而不是将其转发到服务器。
为了进一步调试,我从代码中删除了BPF过滤器和校验和验证部分。
现在,DHCP Relay正在转发数据包,但数据包不是DHCP服务器所期望的。 DHCP Relay正在将数据包从广播更改为单播。在服务器端接收的帧,以太网报头,IP报头和UDP报头是正确的(我在Wireshark日志中检查过),但是bootstrap协议选项字段不正确。
我还在客户端捕获了Wireshark日志。客户端正在按预期发送DICOVER数据包。
如果您需要更多信息,请发表评论。
真的:基于ISC dhcrelay(4.3.1P1)Linux(3.14内核)
提前致谢。
编辑:下面是在DHCP客户端捕获的单个数据包的十六进制转储。
ff ff ff ff ff ff 00 20 61 1e 9e 14 08 00 45 00
01 1a 4f fe 40 00 20 11 09 d6 00 00 00 00 ff ff
ff ff 00 44 00 43 01 06 fd 9b 01 01 06 00 00 ae
af 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 20 61 1e 9e 14 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 63 82 53 63 35 01 01 39 02 02
4e 37 04 0f 06 03 01 ff
答案 0 :(得分:0)
BPF过滤器在common/bpf.c
中定义。它会检查数据包是否是带有单个片段(没有碎片)的IP / UDP数据包,并且发往67端口,否则会丢弃它。
你提到你的数据包是一个IP / UDP数据包,但是你确定它没有碎片并且有正确的端口吗?