From 46307dedf206cb714c1e8e15599087c5a56c8bc3 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Fri, 4 Nov 2016 22:15:14 +1000 Subject: [PATCH] dline: Load DLINEs properly and return proper info --- irc/dline.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/irc/dline.go b/irc/dline.go index 4524c7be..120fba9e 100644 --- a/irc/dline.go +++ b/irc/dline.go @@ -135,7 +135,7 @@ func (dm *DLineManager) CheckIP(addr net.IP) (isBanned bool, info *IPBanInfo) { return true, &addrInfo.Info } } else { - return true, nil + return true, &addrInfo.Info } } @@ -155,7 +155,7 @@ func (dm *DLineManager) CheckIP(addr net.IP) (isBanned bool, info *IPBanInfo) { return true, &addrInfo.Info } } else { - return true, nil + return true, &addrInfo.Info } } @@ -349,6 +349,9 @@ func (s *Server) loadDLines() { s.store.View(func(tx *buntdb.Tx) error { //TODO(dan): We could make this safer tx.AscendKeys("bans.dline *", func(key, value string) bool { + // get address name + key = key[len("bans.dline "):] + // load addr/net var hostAddr net.IP var hostNet *net.IPNet