From 70933e08304d3829ab22de3201bd8536ffa29f9b Mon Sep 17 00:00:00 2001 From: Daniel Adolfsson Date: Sat, 17 Sep 2011 02:22:33 +0200 Subject: [PATCH] iface proper destructor Inside iface::~iface(), make sure to close any open sockets and restore ALLMULTI to it's original value. --- src/iface.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/iface.cc b/src/iface.cc index d46dd9c..001692e 100644 --- a/src/iface.cc +++ b/src/iface.cc @@ -53,6 +53,15 @@ iface::iface() : iface::~iface() { DBG("iface::~iface()"); + + if(_ifd >= 0) + close(_ifd); + + if(_pfd >= 0) + { + allmulti(_prev_allmulti); + close(_pfd); + } } strong_ptr iface::open_pfd(const std::string& name)