mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 00:15:37 +01:00
Switch most everything to netip in prep for ipv6 in the overlay (#1173)
This commit is contained in:
14
udp/conn.go
14
udp/conn.go
@@ -1,6 +1,8 @@
|
||||
package udp
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
|
||||
"github.com/slackhq/nebula/config"
|
||||
"github.com/slackhq/nebula/firewall"
|
||||
"github.com/slackhq/nebula/header"
|
||||
@@ -9,7 +11,7 @@ import (
|
||||
const MTU = 9001
|
||||
|
||||
type EncReader func(
|
||||
addr *Addr,
|
||||
addr netip.AddrPort,
|
||||
out []byte,
|
||||
packet []byte,
|
||||
header *header.H,
|
||||
@@ -22,9 +24,9 @@ type EncReader func(
|
||||
|
||||
type Conn interface {
|
||||
Rebind() error
|
||||
LocalAddr() (*Addr, error)
|
||||
LocalAddr() (netip.AddrPort, error)
|
||||
ListenOut(r EncReader, lhf LightHouseHandlerFunc, cache *firewall.ConntrackCacheTicker, q int)
|
||||
WriteTo(b []byte, addr *Addr) error
|
||||
WriteTo(b []byte, addr netip.AddrPort) error
|
||||
ReloadConfig(c *config.C)
|
||||
Close() error
|
||||
}
|
||||
@@ -34,13 +36,13 @@ type NoopConn struct{}
|
||||
func (NoopConn) Rebind() error {
|
||||
return nil
|
||||
}
|
||||
func (NoopConn) LocalAddr() (*Addr, error) {
|
||||
return nil, nil
|
||||
func (NoopConn) LocalAddr() (netip.AddrPort, error) {
|
||||
return netip.AddrPort{}, nil
|
||||
}
|
||||
func (NoopConn) ListenOut(_ EncReader, _ LightHouseHandlerFunc, _ *firewall.ConntrackCacheTicker, _ int) {
|
||||
return
|
||||
}
|
||||
func (NoopConn) WriteTo(_ []byte, _ *Addr) error {
|
||||
func (NoopConn) WriteTo(_ []byte, _ netip.AddrPort) error {
|
||||
return nil
|
||||
}
|
||||
func (NoopConn) ReloadConfig(_ *config.C) {
|
||||
|
||||
Reference in New Issue
Block a user