Merge pull request #488 from mdlayher/vendor-netlink

Bump github.com/mdlayher/netlink to clean up on bind failure
This commit is contained in:
Tobias Schmidt 2017-03-03 10:45:45 -04:00 committed by GitHub
commit 6aa9afc8df
2 changed files with 6 additions and 3 deletions

View file

@ -62,6 +62,9 @@ func bind(s socket, config *Config) (*conn, error) {
}
if err := s.Bind(addr); err != nil {
// Since this never returns conn (and as such, the caller cannot close it),
// close the socket here in the event of a failure to bind.
_ = s.Close()
return nil, err
}