mirror of
https://github.com/slackhq/nebula.git
synced 2026-04-01 07:05:17 +02:00
new error
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
var ErrCannotSNAT = errors.New("cannot SNAT this packet")
|
var ErrCannotSNAT = errors.New("cannot SNAT this packet")
|
||||||
var ErrSNATIdentityMismatch = errors.New("refusing to SNAT for mismatched host")
|
var ErrSNATIdentityMismatch = errors.New("refusing to SNAT for mismatched host")
|
||||||
|
var ErrSNATAddressCollision = errors.New("refusing to accept an incoming packet with my SNAT address")
|
||||||
|
|
||||||
const ipv4SourcePosition = 12
|
const ipv4SourcePosition = 12
|
||||||
const ipv4DestinationPosition = 16
|
const ipv4DestinationPosition = 16
|
||||||
@@ -522,7 +523,7 @@ func (f *Firewall) applySnat(data []byte, fp *firewall.Packet, c *conn, hostinfo
|
|||||||
return ErrCannotSNAT
|
return ErrCannotSNAT
|
||||||
}
|
}
|
||||||
if f.snatAddr == fp.LocalAddr { //a packet that came from UDP (incoming) should never ever have our snat address on it
|
if f.snatAddr == fp.LocalAddr { //a packet that came from UDP (incoming) should never ever have our snat address on it
|
||||||
return ErrSNATIdentityMismatch
|
return ErrSNATAddressCollision
|
||||||
}
|
}
|
||||||
if c.snat.Valid() {
|
if c.snat.Valid() {
|
||||||
//old flow: make sure it came from the right place
|
//old flow: make sure it came from the right place
|
||||||
|
|||||||
Reference in New Issue
Block a user