Skip to content

Commit

Permalink
fix: Missing neighbor solicitation when handling IPv6 payload with un…
Browse files Browse the repository at this point in the history
…known destination MAC

Issue: #51
  • Loading branch information
kaaass committed Jul 10, 2023
1 parent 4b043d7 commit a932f69
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,15 @@ private void handleIPv6Packet(byte[] packetData) {
destMac = 0L;
}
sendNSPacket = true;
} else if (this.ndpTable.hasMacForAddress(destIP)) {
// 目标地址 MAC 已知
destMac = this.ndpTable.getMacForAddress(destIP);
} else {
destMac = 0L;
// 收到普通数据包,根据 NDP 表记录确定是否发送 NS 请求
if (this.ndpTable.hasMacForAddress(destIP)) {
// 目标地址 MAC 已知
destMac = this.ndpTable.getMacForAddress(destIP);
} else {
destMac = 0L;
sendNSPacket = true;
}
}
// 发送数据包
if (destMac != 0L) {
Expand Down

0 comments on commit a932f69

Please sign in to comment.