Browse Source

[2765] Close fallback sockets together with primary sockets.

Marcin Siodelski 11 years ago
parent
commit
183693547c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/lib/dhcp/iface_mgr.cc

+ 8 - 0
src/lib/dhcp/iface_mgr.cc

@@ -88,6 +88,10 @@ Iface::closeSockets(const uint16_t family) {
             // Close and delete the socket and move to the
             // next one.
             close(sock->sockfd_);
+            // Close fallback socket if open.
+            if (sock->fallbackfd_) {
+                close(sock->fallbackfd_);
+            }
             sockets_.erase(sock++);
 
         } else {
@@ -148,6 +152,10 @@ bool Iface::delSocket(uint16_t sockfd) {
     while (sock!=sockets_.end()) {
         if (sock->sockfd_ == sockfd) {
             close(sockfd);
+            // Close fallback socket if open.
+            if (sock->fallbackfd_) {
+                close(sock->fallbackfd_);
+            }
             sockets_.erase(sock);
             return (true); //socket found
         }