multicast cleanup
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||
|
||||
"vppn/m"
|
||||
"vppn/peer/multicast"
|
||||
"vppn/peer/wginterface"
|
||||
)
|
||||
|
||||
@@ -60,7 +61,7 @@ func New(
|
||||
pingCh := make(chan PingEvent)
|
||||
hubAddCh := make(chan m.Peer)
|
||||
hubRemoveCh := make(chan wgtypes.Key)
|
||||
multicastCh := make(chan MulticastEvent)
|
||||
multicastCh := make(chan multicast.Packet)
|
||||
|
||||
poller, err := NewHubPoller(
|
||||
state.VPNIP,
|
||||
@@ -79,8 +80,8 @@ func New(
|
||||
go poller.Run()
|
||||
|
||||
if !state.IsPublic {
|
||||
go RunMCWriter(state.VPNIP, state.PrivKey.PublicKey(), state.WGPort, &state.SignKey)
|
||||
go RunMCReader(state.VPNNet, state.VPNIP, multicastCh)
|
||||
go multicast.Broadcast(state.VPNIP, state.PrivKey.PublicKey(), state.WGPort, &state.SignKey)
|
||||
go multicast.Receiver(state.VPNNet, state.VPNIP, multicastCh)
|
||||
}
|
||||
|
||||
return &App{
|
||||
@@ -98,6 +99,8 @@ func New(
|
||||
peersByKey: make(map[wgtypes.Key]*Peer),
|
||||
peersByIP: make(map[netip.Addr]*Peer),
|
||||
|
||||
mcVerifyBuf: make([]byte, 0, multicast.SignedPacketSize),
|
||||
|
||||
hubAddCh: hubAddCh,
|
||||
hubRemoveCh: hubRemoveCh,
|
||||
pingCh: pingCh,
|
||||
|
||||
Reference in New Issue
Block a user