moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.09k stars 182 forks source link

switch write failed: unknown: unknown: unknown: attempted to write to a closed flow #290

Open djs55 opened 6 years ago

djs55 commented 6 years ago

I connected another ethernet client and then disconnect it. When I run dhcpd in another VM I now see these in the logs:

com.docker.vpnkit: [ERROR] Socket.Pipe.writev unix:/Users/djs/Library/Containers/com.docker.docker/Data/s50: caught Broken pipe returning Eof
com.docker.vpnkit: [ERROR] switch write failed: unknown: unknown: unknown: attempted to write to a closed flow

It seems like it's trying to send the broadcast packets along closed connections.

djs55 commented 6 years ago

/cc @MagnusS

MagnusS commented 6 years ago

Hm, looking at the current code it looks like the bridge listener function is never cleared properly after an error/disconnect: https://github.com/moby/vpnkit/blob/master/src/hostnet/slirp.ml#L986. I thought this would automatically recover though, I'll take a closer look tomorrow