Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
b09fdcc6
Commit
b09fdcc6
authored
Dec 05, 2011
by
Tomek Mrugalski
🛰
Browse files
[1238] Sockets are now closed properly.
parent
4d97ef5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/dhcp6_srv.cc
View file @
b09fdcc6
...
...
@@ -47,6 +47,8 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) {
Dhcpv6Srv
::~
Dhcpv6Srv
()
{
cout
<<
"DHCPv6 Srv shutdown."
<<
endl
;
IfaceMgr
::
instance
().
closeSockets
();
}
bool
...
...
src/bin/dhcp6/dhcp6_srv.h
View file @
b09fdcc6
...
...
@@ -47,7 +47,7 @@ public:
Dhcpv6Srv
(
uint16_t
port
=
DHCP6_SERVER_PORT
);
/// @brief Destructor. Used during DHCPv6 service shutdown.
~
Dhcpv6Srv
();
virtual
~
Dhcpv6Srv
();
/// @brief Returns server-intentifier option
///
...
...
src/bin/dhcp6/iface_mgr.cc
View file @
b09fdcc6
...
...
@@ -134,8 +134,7 @@ IfaceMgr::IfaceMgr()
}
}
IfaceMgr
::~
IfaceMgr
()
{
void
IfaceMgr
::
closeSockets
()
{
for
(
IfaceCollection
::
iterator
iface
=
ifaces_
.
begin
();
iface
!=
ifaces_
.
end
();
++
iface
)
{
...
...
@@ -147,6 +146,11 @@ IfaceMgr::~IfaceMgr() {
iface
->
sockets_
.
clear
();
}
}
IfaceMgr
::~
IfaceMgr
()
{
closeSockets
();
// control_buf_ is deleted automatically (scoped_ptr)
control_buf_len_
=
0
;
}
...
...
src/bin/dhcp6/iface_mgr.h
View file @
b09fdcc6
...
...
@@ -301,6 +301,11 @@ public:
/// @param port specifies port number (usually DHCP6_SERVER_PORT)
void
openSockets
(
uint16_t
port
);
/// @brief Closes all open sockets.
/// Is used in destructor, but also from Dhcpv4_srv and Dhcpv6_srv classes.
void
closeSockets
();
// don't use private, we need derived classes in tests
protected:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment