wgengine/packet: refactor and expose UDP header marshaling (#408)

Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
This commit is contained in:
Dmytro Shynkevych
2020-06-04 18:42:44 -04:00
committed by GitHub
parent 5e0ff494a5
commit 059b1d10bb
11 changed files with 793 additions and 216 deletions

View File

@@ -133,7 +133,7 @@ func ipInList(ip packet.IP, netlist []Net) bool {
return false
}
func matchIPPorts(mm Matches, q *packet.QDecode) bool {
func matchIPPorts(mm Matches, q *packet.ParsedPacket) bool {
for _, acl := range mm {
for _, dst := range acl.Dsts {
if !dst.Net.Includes(q.DstIP) {
@@ -153,7 +153,7 @@ func matchIPPorts(mm Matches, q *packet.QDecode) bool {
return false
}
func matchIPWithoutPorts(mm Matches, q *packet.QDecode) bool {
func matchIPWithoutPorts(mm Matches, q *packet.ParsedPacket) bool {
for _, acl := range mm {
for _, dst := range acl.Dsts {
if !dst.Net.Includes(q.DstIP) {