OCT 1.更新 DHCP 服务处理不带VLAN头数据包异常问题

This commit is contained in:
黄昕 2023-05-17 11:26:26 +08:00
parent a966345329
commit 0ee31cdd61
1 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ static PDHCP_PROTO fill_pkg(U8 *pRsp, U8 *pReq) {
switch (get_package_vlan_type(pReq)) { switch (get_package_vlan_type(pReq)) {
default: default:
pIp = (struct iphdr *)(pReq + IP_HDR_OFFSET); pIp = (struct iphdr *)(pReq + IP_HDR_OFFSET);
pUdp = (struct udphdr *)(UDP_HDR_OFFSET); pUdp = (struct udphdr *)(pReq + UDP_HDR_OFFSET);
pDhcp = (PDHCP_PROTO)((U8 *)pReq + DHCP_OFFSET); pDhcp = (PDHCP_PROTO)((U8 *)pReq + DHCP_OFFSET);
p = pRsp + sizeof(struct ethhdr); p = pRsp + sizeof(struct ethhdr);
break; break;
@ -330,7 +330,7 @@ static int dhcp_prepare_tx(U8 *pRsp, U32 optSize) {
switch (get_package_vlan_type(pRsp)) { switch (get_package_vlan_type(pRsp)) {
default: default:
pIp = (struct iphdr *)(pRsp + IP_HDR_OFFSET); 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; tolSize = optSize + sizeof(DHCP_PROTO) + DHCP_OFFSET;
break; break;