- memcpy(&address[12], &ban->address, 4);
- memset(&address[10], 0xff, 2); /* IPv4 */
- Msg_banList_addEntry(msg, i++, address, ban->mask, ban->name,
- hexhash, ban->reason, timestr, ban->duration);
+
+ if(ban->address.ss_family == AF_INET) {
+ memcpy(&address[12], &((struct sockaddr_in *)&ban->address)->sin_addr, 4);
+ memset(&address[10], 0xff, 2);
+ Msg_banList_addEntry(msg, i++, address, ban->mask + 96, ban->name, hexhash, ban->reason, timestr, ban->duration);
+ } else {
+ memcpy(&address, &((struct sockaddr_in6 *)&ban->address)->sin6_addr, 16);
+ Msg_banList_addEntry(msg, i++, address, ban->mask, ban->name, hexhash, ban->reason, timestr, ban->duration);
+ }
+