parent
524c064b7c
commit
8ee1d22c8d
|
@ -30,7 +30,7 @@ static PDHCP_PROTO fill_dhcp_pkg(U8 *pRsp, PDHCP_INFO pInfo) {
|
|||
|
||||
if (pInfo->vni == 0) {
|
||||
pIp = (struct iphdr *)(pRsp + IP_HDR_OFFSET);
|
||||
pUdp = (struct udphdr *)(UDP_HDR_OFFSET);
|
||||
pUdp = (struct udphdr *)(pRsp + UDP_HDR_OFFSET);
|
||||
pDhcp = (PDHCP_PROTO)((U8 *)pRsp + DHCP_OFFSET);
|
||||
pEth->h_proto = htons(ETH_P_IP);
|
||||
} else if (pInfo->vni >= 1 && pInfo->vni <= 4095) {
|
||||
|
@ -100,7 +100,7 @@ static U32 dhcp_pkk_checksum(U8 *pRsp, U32 optSize) {
|
|||
switch (get_package_vlan_type(pRsp)) {
|
||||
default:
|
||||
pIp = (struct iphdr *)(pRsp + IP_HDR_OFFSET);
|
||||
pUdp = (struct udphdr *)(UDP_HDR_OFFSET);
|
||||
pUdp = (struct udphdr *)(pRsp + UDP_HDR_OFFSET);
|
||||
// 计算包总长度
|
||||
tolSize = optSize + sizeof(DHCP_PROTO) + DHCP_OFFSET;
|
||||
break;
|
||||
|
@ -309,7 +309,7 @@ int dhcp_tools_init_network(const char *pNicName) {
|
|||
return ERR_SUCCESS;
|
||||
}
|
||||
|
||||
init_filter("vlan or (udp and dst port 68)");
|
||||
init_filter(" (udp and dst port 68) or vlan");
|
||||
|
||||
ret = create_udp_raw_socket(g_pNicName);
|
||||
if (ret != ERR_SUCCESS) {
|
||||
|
|
Loading…
Reference in New Issue