Add IPv6 support
Brought to you by:
paulcockings,
sbajic
Please provide support for IPv6. Dspam currently assume IPv4 in several places but the change shouldn't be too big. The IPv6 API is able to handle IPv4 as well so switching should not introduce much code, it's more about rewriting. Some of the places I've noticed relying on IPv4 are:
daemon_listen()
tracksource()
dspam_getsource()
is_blacklisted()
Some of the changes needed are:
char ip[32] -> char [INET6_ADDRSTRLEN]
inet_addr -> inet_pton(AF_INET6, …)
sizeof(struct sockaddr *) -> sizeof(var) // it's also good practice
inet_ntoa_r -> inet_ntop
I had started a patch but it's unfinished work so I prefer not to induce you in error.
Best regards.