mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
Revert "Delete unused function net_ip_compare()"
This reverts commit cb5f3cba1f.
This commit is contained in:
parent
b8b90c76d4
commit
da59fd7c2d
2 changed files with 15 additions and 0 deletions
|
|
@ -57,6 +57,18 @@ IPADDR ip4_any = {
|
|||
#endif
|
||||
};
|
||||
|
||||
int net_ip_compare(IPADDR *ip1, IPADDR *ip2)
|
||||
{
|
||||
if (ip1->family != ip2->family)
|
||||
return 0;
|
||||
|
||||
if (ip1->family == AF_INET6)
|
||||
return memcmp(&ip1->ip, &ip2->ip, sizeof(ip1->ip)) == 0;
|
||||
|
||||
return memcmp(&ip1->ip, &ip2->ip, 4) == 0;
|
||||
}
|
||||
|
||||
|
||||
static void sin_set_ip(union sockaddr_union *so, const IPADDR *ip)
|
||||
{
|
||||
if (ip == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue