3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00

dline: Load DLINEs properly and return proper info

This commit is contained in:
Daniel Oaks 2016-11-04 22:15:14 +10:00
parent c3174bb648
commit 46307dedf2

View File

@ -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