Fix broadcast filter not applied to mixed stack
This commit is contained in:
parent
ce9c864d89
commit
78e0dfa18f
1 changed files with 7 additions and 0 deletions
|
|
@ -145,6 +145,10 @@ func (m *Mixed) wintunLoop(winTun WinTun) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mixed) processIPv4(packet clashtcpip.IPv4Packet) error {
|
func (m *Mixed) processIPv4(packet clashtcpip.IPv4Packet) error {
|
||||||
|
destination := packet.DestinationIP()
|
||||||
|
if destination == m.broadcastAddr || !destination.IsGlobalUnicast() {
|
||||||
|
return common.Error(m.tun.Write(packet))
|
||||||
|
}
|
||||||
switch packet.Protocol() {
|
switch packet.Protocol() {
|
||||||
case clashtcpip.TCP:
|
case clashtcpip.TCP:
|
||||||
return m.processIPv4TCP(packet, packet.Payload())
|
return m.processIPv4TCP(packet, packet.Payload())
|
||||||
|
|
@ -163,6 +167,9 @@ func (m *Mixed) processIPv4(packet clashtcpip.IPv4Packet) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mixed) processIPv6(packet clashtcpip.IPv6Packet) error {
|
func (m *Mixed) processIPv6(packet clashtcpip.IPv6Packet) error {
|
||||||
|
if !packet.DestinationIP().IsGlobalUnicast() {
|
||||||
|
return common.Error(m.tun.Write(packet))
|
||||||
|
}
|
||||||
switch packet.Protocol() {
|
switch packet.Protocol() {
|
||||||
case clashtcpip.TCP:
|
case clashtcpip.TCP:
|
||||||
return m.processIPv6TCP(packet, packet.Payload())
|
return m.processIPv6TCP(packet, packet.Payload())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue