diff options
author | Bernd Fix <brf@hoi-polloi.org> | 2020-02-15 18:19:34 +0100 |
---|---|---|
committer | Bernd Fix <brf@hoi-polloi.org> | 2020-02-15 18:19:34 +0100 |
commit | 7bfc54a066e5a2c65f43ef17783fc9b3abbfbef0 (patch) | |
tree | c72411be047e87a705d907d1ba88cb2603916fac /src | |
parent | 7e13256995f3af254d8637a9eb44a2702c6ef541 (diff) | |
download | gnunet-go-7bfc54a066e5a2c65f43ef17783fc9b3abbfbef0.tar.gz gnunet-go-7bfc54a066e5a2c65f43ef17783fc9b3abbfbef0.zip |
Adjusted LEHO coexist rules to spec.
Diffstat (limited to 'src')
-rw-r--r-- | src/gnunet/service/gns/block_handler.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gnunet/service/gns/block_handler.go b/src/gnunet/service/gns/block_handler.go index 747f26f..1d5a9e5 100644 --- a/src/gnunet/service/gns/block_handler.go +++ b/src/gnunet/service/gns/block_handler.go | |||
@@ -460,14 +460,8 @@ func (h *LehoHandler) AddRecord(rec *message.GNSResourceRecord, labels []string) | |||
460 | // Coexist return a flag indicating how a resource record of a given type | 460 | // Coexist return a flag indicating how a resource record of a given type |
461 | // is to be treated (see BlockHandler interface) | 461 | // is to be treated (see BlockHandler interface) |
462 | func (h *LehoHandler) Coexist(cm util.CounterMap) bool { | 462 | func (h *LehoHandler) Coexist(cm util.CounterMap) bool { |
463 | // requires exactly one A/AAAA record alongside single LEHO | 463 | // requires exactly one LEHO and any number of other records. |
464 | if len(cm) != 2 { | 464 | return cm.Num(enums.GNS_TYPE_LEHO) == 1 |
465 | return false | ||
466 | } | ||
467 | if cm.Num(enums.GNS_TYPE_LEHO) != 1 { | ||
468 | return false | ||
469 | } | ||
470 | return (cm.Num(enums.GNS_TYPE_DNS_A) + cm.Num(enums.GNS_TYPE_DNS_AAAA)) > 1 | ||
471 | } | 465 | } |
472 | 466 | ||
473 | // Records returns a list of RR of the given type associated with this handler | 467 | // Records returns a list of RR of the given type associated with this handler |