mirror of
https://github.com/jwhited/wgsd.git
synced 2025-11-26 21:35:34 +08:00
skip peers with nil endpoints
This commit is contained in:
committed by
Jordan Whited
parent
d9845d72b8
commit
7eaacc000b
6
wgsd.go
6
wgsd.go
@@ -103,6 +103,9 @@ func handleSRV(state request.Request, peers []wgtypes.Peer) (int, error) {
|
||||
if strings.EqualFold(
|
||||
base32.StdEncoding.EncodeToString(peer.PublicKey[:]), pubKey) {
|
||||
endpoint := peer.Endpoint
|
||||
if endpoint == nil {
|
||||
return nxDomain(state)
|
||||
}
|
||||
hostRR := getHostRR(state.Name(), endpoint)
|
||||
if hostRR == nil {
|
||||
return nxDomain(state)
|
||||
@@ -137,6 +140,9 @@ func handleHostOrTXT(state request.Request, peers []wgtypes.Peer) (int, error) {
|
||||
if strings.EqualFold(
|
||||
base32.StdEncoding.EncodeToString(peer.PublicKey[:]), pubKey) {
|
||||
endpoint := peer.Endpoint
|
||||
if endpoint == nil {
|
||||
return nxDomain(state)
|
||||
}
|
||||
if state.QType() == dns.TypeA || state.QType() == dns.TypeAAAA {
|
||||
hostRR := getHostRR(state.Name(), endpoint)
|
||||
if hostRR == nil {
|
||||
|
||||
Reference in New Issue
Block a user