mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-08 18:20:41 +08:00
Fix: nil options panic
This commit is contained in:
@@ -23,7 +23,7 @@ func resolveInterfaceByName(name string) (*net.Interface, error) {
|
||||
}
|
||||
|
||||
func setSocketOptions(network, address string, c syscall.RawConn, opts *Options) (err error) {
|
||||
if !isTCPSocket(network) && !isUDPSocket(network) {
|
||||
if opts == nil || !isTCPSocket(network) && !isUDPSocket(network) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func setSocketOptions(network, address string, c syscall.RawConn, opts *Options) (err error) {
|
||||
if !isTCPSocket(network) && !isUDPSocket(network) {
|
||||
if opts == nil || !isTCPSocket(network) && !isUDPSocket(network) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user