checker: Report ping errors

This commit is contained in:
nemunaire 2022-03-10 19:39:30 +01:00
parent 6dd9097351
commit 8632db8e99

View File

@ -46,7 +46,7 @@ func check_ping(ip string, cb func(pkt *ping.Packet)) (err error) {
pinger.Count = 1 pinger.Count = 1
pinger.OnRecv = cb pinger.OnRecv = cb
pinger.SetPrivileged(true) pinger.SetPrivileged(true)
pinger.Run() err = pinger.Run()
return return
} }
@ -578,7 +578,7 @@ func studentChecker(std *adlin.Student, also_check_matrix bool) {
log.Printf("Tests %s on %s...", std.Login, stdIP) log.Printf("Tests %s on %s...", std.Login, stdIP)
} }
// Check ping // Check ping
check_ping(stdIP, func(pkt *ping.Packet) { err = check_ping(stdIP, func(pkt *ping.Packet) {
tunnel_version, err := minTunnelVersion(std, tun.SuffixIP) tunnel_version, err := minTunnelVersion(std, tun.SuffixIP)
if verbose { if verbose {
log.Printf("%s PONG (on %x); version=%d (%v)\n", std.Login, tun.SuffixIP, tunnel_version, err) log.Printf("%s PONG (on %x); version=%d (%v)\n", std.Login, tun.SuffixIP, tunnel_version, err)
@ -803,8 +803,10 @@ func studentChecker(std *adlin.Student, also_check_matrix bool) {
return return
}) })
if err != nil && verbose {
log.Printf("%s: Unable to perform ping to %s: %s", std.Login, stdIP, err.Error())
}
} }
} }
func studentsChecker() { func studentsChecker() {