OpenBSD cvs log

created 2023-10-29T07:21:52Z
begin 2023-10-23T00:00:00Z
end 2023-10-24T00:00:00Z
path src/sys
commits 1

date 2023-10-23T10:22:05Z
author mvs
files src/sys/net/if_wg.c log diff annotate
message Prevent wg(4) stuck on peer destruction.

While interface going down and output stopped, packets could rest in
`if_snd' queue. So the (!ifq_empty(&sc->sc_if.if_snd)) condition will
always be true and wg_peer_destroy() will sleep until interface became
up and stuck packets transmitted.

Check IFF_RUNNING flag within (!ifq_empty(&sc->sc_if.if_snd)) loop in
wg_peer_destroy(). If the flag is not set that means interface is down,
so drain the `if_snd' queue manually to prevent wg_peer_destroy() stuck.

Problem reported and fix tested by Kirill Miazine.

ok bluhm@