fix various small ToDos throughout the codebase

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2022-10-09 09:21:26 +02:00
parent df1864119b
commit b117f42d4f
6 changed files with 7 additions and 12 deletions

View File

@@ -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,

View File

@@ -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{

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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")
})