smartdns: bump copyright to 2023, and fix some typo
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* Copyright (C) 2018-2020 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
* Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
*
|
||||
* smartdns is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -63,8 +63,8 @@ struct ping_dns_head {
|
||||
unsigned short flag;
|
||||
unsigned short qdcount;
|
||||
unsigned short ancount;
|
||||
unsigned short aucount;
|
||||
unsigned short adcount;
|
||||
unsigned short nscount;
|
||||
unsigned short nrcount;
|
||||
char qd_name;
|
||||
unsigned short q_qtype;
|
||||
unsigned short q_qclass;
|
||||
@@ -171,7 +171,7 @@ static int bool_print_log = 1;
|
||||
|
||||
static void _fast_ping_host_put(struct ping_host_struct *ping_host);
|
||||
|
||||
static void _fast_ping_wakup_thread(void)
|
||||
static void _fast_ping_wakeup_thread(void)
|
||||
{
|
||||
uint64_t u = 1;
|
||||
int unused __attribute__((unused));
|
||||
@@ -534,7 +534,7 @@ static int _fast_ping_sendping_v6(struct ping_host_struct *ping_host)
|
||||
|
||||
char ping_host_name[PING_MAX_HOSTLEN];
|
||||
tlog(TLOG_ERROR, "sendto %s, id %d, %s",
|
||||
gethost_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
get_host_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
ping_host->sid, strerror(err));
|
||||
goto errout;
|
||||
}
|
||||
@@ -574,7 +574,7 @@ static int _fast_ping_sendping_v4(struct ping_host_struct *ping_host)
|
||||
}
|
||||
char ping_host_name[PING_MAX_HOSTLEN];
|
||||
tlog(TLOG_ERROR, "sendto %s, id %d, %s",
|
||||
gethost_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
get_host_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
ping_host->sid, strerror(err));
|
||||
goto errout;
|
||||
}
|
||||
@@ -626,7 +626,7 @@ static int _fast_ping_sendping_udp(struct ping_host_struct *ping_host)
|
||||
}
|
||||
char ping_host_name[PING_MAX_HOSTLEN];
|
||||
tlog(TLOG_ERROR, "sendto %s, id %d, %s",
|
||||
gethost_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
get_host_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
ping_host->sid, strerror(err));
|
||||
goto errout;
|
||||
}
|
||||
@@ -680,7 +680,7 @@ static int _fast_ping_sendping_tcp(struct ping_host_struct *ping_host)
|
||||
}
|
||||
|
||||
tlog(TLOG_ERROR, "connect %s, id %d, %s",
|
||||
gethost_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
get_host_by_addr(ping_host_name, sizeof(ping_host_name), (struct sockaddr *)&ping_host->addr),
|
||||
ping_host->sid, strerror(errno));
|
||||
goto errout;
|
||||
}
|
||||
@@ -1205,7 +1205,7 @@ struct ping_host_struct *fast_ping_start(PING_TYPE type, const char *host, int c
|
||||
pthread_mutex_lock(&ping.map_lock);
|
||||
_fast_ping_host_get(ping_host);
|
||||
if (hash_empty(ping.addrmap)) {
|
||||
_fast_ping_wakup_thread();
|
||||
_fast_ping_wakeup_thread();
|
||||
}
|
||||
hash_add(ping.addrmap, &ping_host->addr_node, addrkey);
|
||||
ping_host->run = 1;
|
||||
@@ -1326,7 +1326,7 @@ static struct fast_ping_packet *_fast_ping_icmp_packet(struct ping_host_struct *
|
||||
|
||||
if (ping.no_unprivileged_ping) {
|
||||
if (ip->ip_p != IPPROTO_ICMP) {
|
||||
tlog(TLOG_ERROR, "ip type faild, %d:%d", ip->ip_p, IPPROTO_ICMP);
|
||||
tlog(TLOG_ERROR, "ip type failed, %d:%d", ip->ip_p, IPPROTO_ICMP);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1407,7 +1407,7 @@ static int _fast_ping_process_icmp(struct ping_host_struct *ping_host, struct ti
|
||||
}
|
||||
|
||||
tlog(TLOG_DEBUG, "recv ping packet from %s failed.",
|
||||
gethost_by_addr(name, sizeof(name), (struct sockaddr *)&from));
|
||||
get_host_by_addr(name, sizeof(name), (struct sockaddr *)&from));
|
||||
goto errout;
|
||||
}
|
||||
|
||||
@@ -1899,7 +1899,7 @@ int fast_ping_init(void)
|
||||
|
||||
ret = pthread_create(&ping.notify_tid, &attr, _fast_ping_notify_worker, NULL);
|
||||
if (ret != 0) {
|
||||
tlog(TLOG_ERROR, "create ping notifyer work thread failed, %s\n", strerror(ret));
|
||||
tlog(TLOG_ERROR, "create ping notifier work thread failed, %s\n", strerror(ret));
|
||||
goto errout;
|
||||
}
|
||||
|
||||
@@ -1923,7 +1923,7 @@ errout:
|
||||
if (ping.tid) {
|
||||
void *retval = NULL;
|
||||
atomic_set(&ping.run, 0);
|
||||
_fast_ping_wakup_thread();
|
||||
_fast_ping_wakeup_thread();
|
||||
pthread_join(ping.tid, &retval);
|
||||
ping.tid = 0;
|
||||
}
|
||||
@@ -1982,7 +1982,7 @@ void fast_ping_exit(void)
|
||||
if (ping.tid) {
|
||||
void *ret = NULL;
|
||||
atomic_set(&ping.run, 0);
|
||||
_fast_ping_wakup_thread();
|
||||
_fast_ping_wakeup_thread();
|
||||
pthread_join(ping.tid, &ret);
|
||||
ping.tid = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user