server: some minor fixes

This commit is contained in:
Nick Peng
2022-07-05 23:32:22 +08:00
parent 092b4ede88
commit 7d62226995
4 changed files with 76 additions and 38 deletions

View File

@@ -1216,6 +1216,11 @@ static struct fast_ping_packet *_fast_ping_icmp_packet(struct ping_host_struct *
return NULL;
}
if (icmp->icmp_type != ICMP_ECHOREPLY) {
tlog(TLOG_DEBUG, "icmp type faild, %d:%d", icmp->icmp_type, ICMP_ECHOREPLY);
return NULL;
}
if (ping.no_unprivileged_ping) {
if (ip->ip_p != IPPROTO_ICMP) {
tlog(TLOG_ERROR, "ip type faild, %d:%d", ip->ip_p, IPPROTO_ICMP);
@@ -1228,12 +1233,6 @@ static struct fast_ping_packet *_fast_ping_icmp_packet(struct ping_host_struct *
}
}
if (icmp->icmp_type != ICMP_ECHOREPLY) {
tlog(TLOG_DEBUG, "icmp type faild, %d:%d", icmp->icmp_type, ICMP_ECHOREPLY);
return NULL;
}
return packet;
}