mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
fix various small ToDos throughout the codebase
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
@@ -65,7 +65,7 @@ var (
|
||||
FailedTimeout: 5 * time.Second,
|
||||
RestartTimeout: 5 * time.Second,
|
||||
InterfaceFilter: "*",
|
||||
KeepaliveInterval: 2 * time.Second, // TODO: increase
|
||||
KeepaliveInterval: 2 * time.Second,
|
||||
MaxBindingRequests: 7,
|
||||
PortRange: PortRangeSettings{
|
||||
Min: EphemeralPortMin,
|
||||
|
@@ -167,8 +167,7 @@ func (p *Peer) SetPresharedKey(psk *crypto.Key) error {
|
||||
return fmt.Errorf("failed to update peer preshared key: %w", err)
|
||||
}
|
||||
|
||||
// TODO: Remove PSK from log
|
||||
p.logger.Debug("Peer preshared key updated", zap.Any("psk", psk))
|
||||
p.logger.Debug("Peer preshared key updated")
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -203,7 +202,10 @@ func (p *Peer) RemoveAllowedIP(a net.IPNet) error {
|
||||
return util.CmpNet(a, b) != 0
|
||||
})
|
||||
|
||||
// TODO: Check is net is in AllowedIPs before attempting removing it
|
||||
if len(ips) == len(p.Peer.AllowedIPs) {
|
||||
// Nothing removed...
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg := wgtypes.Config{
|
||||
Peers: []wgtypes.PeerConfig{
|
||||
|
@@ -146,11 +146,6 @@ func (p *KernelProxy) Update(newCP *ice.CandidatePair, newConnICE *ice.Conn, new
|
||||
func (p *KernelProxy) copy(dst io.Writer, src io.Reader) {
|
||||
buf := make([]byte, maxSegmentSize)
|
||||
for {
|
||||
// TODO: Check why this is not working
|
||||
// if _, err := io.Copy(dst, src); err != nil {
|
||||
// p.logger.Error("Failed copy", zap.Error(err))
|
||||
// }
|
||||
|
||||
n, err := src.Read(buf)
|
||||
if err != nil {
|
||||
if errors.Is(err, ice.ErrClosed) || errors.Is(err, net.ErrClosed) || errors.Is(err, io.EOF) {
|
||||
|
@@ -68,7 +68,6 @@ func (hs *Interface) Hosts() []Host {
|
||||
for _, p := range hs.Peers {
|
||||
m := map[netip.Addr][]string{}
|
||||
|
||||
// Host names
|
||||
for name, addrs := range p.Hosts {
|
||||
for _, a := range addrs {
|
||||
// TODO: validate that the addresses are covered by the peers AllowedIPs
|
||||
|
@@ -54,8 +54,6 @@ func (rs *Interface) Start() error {
|
||||
}
|
||||
|
||||
func (rs *Interface) Close() error {
|
||||
// TODO: Remove Kernel routes added by us
|
||||
|
||||
close(rs.stop)
|
||||
|
||||
return nil
|
||||
|
@@ -178,6 +178,7 @@ var _ = Context("simple: Simple local-area switched topology with variable numbe
|
||||
})
|
||||
|
||||
// TODO: Check why IPv6 relay is not working
|
||||
// Blocked by: https://github.com/pion/ice/pull/462
|
||||
Context("ipv6", Pending, func() {
|
||||
ConnectivityTestsWithExtraArgs("--ice-candidate-type", "relay", "--ice-network-type", "udp6")
|
||||
})
|
||||
|
Reference in New Issue
Block a user