diff options
author | Bernd Fix <brf@hoi-polloi.org> | 2020-02-19 11:01:27 +0100 |
---|---|---|
committer | Bernd Fix <brf@hoi-polloi.org> | 2020-02-19 11:01:27 +0100 |
commit | be8e465cd061612133282db80ab1c7b7387ee251 (patch) | |
tree | f75ff99a93d927644ada3016ea481dc47c3ef6b1 | |
parent | db8edd2189c526a79039661844314081739010e1 (diff) | |
download | gnunet-go-be8e465cd061612133282db80ab1c7b7387ee251.tar.gz gnunet-go-be8e465cd061612133282db80ab1c7b7387ee251.zip |
Fixed filtering of supplemental records and GNS2DNS handling.
-rw-r--r-- | src/gnunet/service/gns/block_handler.go | 8 | ||||
-rw-r--r-- | src/gnunet/service/gns/module.go | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gnunet/service/gns/block_handler.go b/src/gnunet/service/gns/block_handler.go index 1d5a9e5..3b3438d 100644 --- a/src/gnunet/service/gns/block_handler.go +++ b/src/gnunet/service/gns/block_handler.go | |||
@@ -148,10 +148,12 @@ func NewBlockHandlerList(records []*message.GNSResourceRecord, labels []string) | |||
148 | // Third pass: Traverse active list and build list of handler instances. | 148 | // Third pass: Traverse active list and build list of handler instances. |
149 | for _, rec := range active { | 149 | for _, rec := range active { |
150 | // update counter map for non-supplemental records | 150 | // update counter map for non-supplemental records |
151 | rrType := int(rec.Type) | 151 | if (int(rec.Flags) & enums.GNS_FLAG_SUPPL) != 0 { |
152 | if (rrType & enums.GNS_FLAG_SUPPL) == 0 { | 152 | logger.Printf(logger.DBG, "[gns] handler_list: skip %v\n", rec) |
153 | hl.counts.Add(rrType) | 153 | continue |
154 | } | 154 | } |
155 | rrType := int(rec.Type) | ||
156 | hl.counts.Add(rrType) | ||
155 | 157 | ||
156 | // check for custom handler type | 158 | // check for custom handler type |
157 | if creat, ok := customHandler[rrType]; ok { | 159 | if creat, ok := customHandler[rrType]; ok { |
diff --git a/src/gnunet/service/gns/module.go b/src/gnunet/service/gns/module.go index e8d8847..d067633 100644 --- a/src/gnunet/service/gns/module.go +++ b/src/gnunet/service/gns/module.go | |||
@@ -214,7 +214,7 @@ func (gns *GNSModule) ResolveRelative(labels []string, pkey *ed25519.PublicKey, | |||
214 | inst := hdlr.(*Gns2DnsHandler) | 214 | inst := hdlr.(*Gns2DnsHandler) |
215 | // if we are at the end of the path and the requested type | 215 | // if we are at the end of the path and the requested type |
216 | // includes GNS_TYPE_GNS2DNS, the GNS2DNS records are returned... | 216 | // includes GNS_TYPE_GNS2DNS, the GNS2DNS records are returned... |
217 | if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_GNS2DNS) { | 217 | if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_GNS2DNS) && !kind.IsAny() { |
218 | records = inst.recs | 218 | records = inst.recs |
219 | break | 219 | break |
220 | } | 220 | } |
@@ -246,8 +246,10 @@ func (gns *GNSModule) ResolveRelative(labels []string, pkey *ed25519.PublicKey, | |||
246 | // if we are at the end of the path and the requested type | 246 | // if we are at the end of the path and the requested type |
247 | // includes GNS_TYPE_DNS_CNAME, the records are returned... | 247 | // includes GNS_TYPE_DNS_CNAME, the records are returned... |
248 | if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_DNS_CNAME) && !kind.IsAny() { | 248 | if len(labels) == 1 && kind.HasType(enums.GNS_TYPE_DNS_CNAME) && !kind.IsAny() { |
249 | logger.Println(logger.DBG, "[gns] CNAME requested.") | ||
249 | break | 250 | break |
250 | } | 251 | } |
252 | logger.Println(logger.DBG, "[gns] CNAME resolution required.") | ||
251 | if set, err = gns.ResolveUnknown(inst.name, labels, pkey, kind, depth+1); err != nil { | 253 | if set, err = gns.ResolveUnknown(inst.name, labels, pkey, kind, depth+1); err != nil { |
252 | logger.Println(logger.ERROR, "[gns] CNAME resolution failed.") | 254 | logger.Println(logger.ERROR, "[gns] CNAME resolution failed.") |
253 | return | 255 | return |