forked from PsychoticNinja/irssi
Revert "Delete unused function net_ip_compare()"
This reverts commit cb5f3cba1f2b5dbad67bcc107f3fe4a1875cc52d.
This commit is contained in:
parent
b8b90c76d4
commit
da59fd7c2d
@ -57,6 +57,18 @@ IPADDR ip4_any = {
|
|||||||
#endif
|
#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)
|
static void sin_set_ip(union sockaddr_union *so, const IPADDR *ip)
|
||||||
{
|
{
|
||||||
if (ip == NULL) {
|
if (ip == NULL) {
|
||||||
|
@ -33,6 +33,9 @@ extern IPADDR ip4_any;
|
|||||||
|
|
||||||
GIOChannel *g_io_channel_new(int handle);
|
GIOChannel *g_io_channel_new(int handle);
|
||||||
|
|
||||||
|
/* returns 1 if IPADDRs are the same */
|
||||||
|
int net_ip_compare(IPADDR *ip1, IPADDR *ip2);
|
||||||
|
|
||||||
int net_connect_ip_handle(const IPADDR *ip, int port, const IPADDR *my_ip);
|
int net_connect_ip_handle(const IPADDR *ip, int port, const IPADDR *my_ip);
|
||||||
|
|
||||||
/* Connect to socket with ip address and SSL*/
|
/* Connect to socket with ip address and SSL*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user