luscis / openlan

Cloudify VPN written in Golang, and simple deployment via Kubernetes
http://vpn.luscis.cn
GNU General Public License v3.0
56 stars 24 forks source link

When network has not subnet to new lease for a new point, switch will crach #33

Closed danieldin95 closed 10 months ago

danieldin95 commented 10 months ago
2024-01-16T13:56:09Z INFO|jphc.luscis.cn|Switch.ReadTap: vir2
2024-01-16T13:56:09Z INFO|218.94.118.90:39058|Request.onIpAddr: {"name":"hongkong","ifAddr":"","ipStart":"","ipEnd":"","netmask":"255.255.255.255","routes":null}
2024-01-16T13:56:09Z FATAL|root|Go.func|PANIC >>> runtime error: invalid memory address or nil pointer dereference <<<
2024-01-16T13:56:09Z FATAL|root|Go.func|STACK >>> goroutine 281 [running]:
runtime/debug.Stack(0x127dee0, 0x63, 0xc00046c690)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/luscis/openlan/pkg/libol.Catch(0xc11152, 0x7)
    /root/daniel/openlan/pkg/libol/logger.go:148 +0x18a
panic(0xb3d300, 0x127a090)
    /usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/luscis/openlan/pkg/app.findLease(0x0, 0x0, 0xc00024c900, 0xc00024c900)
    /root/daniel/openlan/pkg/app/request.go:77 +0xd1
github.com/luscis/openlan/pkg/app.(*Request).onIpAddr(0xc0002e0c70, 0xd03ad8, 0xc0002e0010, 0xc000210010, 0x61, 0x31ff0)
    /root/daniel/openlan/pkg/app/request.go:126 +0x42d
github.com/luscis/openlan/pkg/app.(*Request).OnFrame(0xc0002e0c70, 0xd03ad8, 0xc0002e0010, 0xc000371580, 0x0, 0x0)
    /root/daniel/openlan/pkg/app/request.go:38 +0x216
github.com/luscis/openlan/pkg/switch.(*Switch).onFrame(0xc00024c0c0, 0xd03ad8, 0xc0002e0010, 0xc000371580, 0x2, 0xc00041feac)
    /root/daniel/openlan/pkg/switch/switch.go:292 +0xab
github.com/luscis/openlan/pkg/switch.(*Switch).ReadClient(0xc00024c0c0, 0xd03ad8, 0xc0002e0010, 0xc000371580, 0x0, 0x0)
    /root/daniel/openlan/pkg/switch/switch.go:348 +0xc7
github.com/luscis/openlan/pkg/libol.(*SocketServerImpl).Read.func1()
    /root/daniel/openlan/pkg/libol/socket.go:537 +0x11d
github.com/luscis/openlan/pkg/libol.Go.func1(0xc0004a0390, 0xd66df0, 0x24)
    /root/daniel/openlan/pkg/libol/go.go:36 +0x187
created by github.com/luscis/openlan/pkg/libol.Go