Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
6d552280
Commit
6d552280
authored
Jan 14, 2014
by
Marcin Siodelski
Browse files
[3279] Addressed review comments.
parent
c716f433
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/dhcp4_srv.cc
View file @
6d552280
...
...
@@ -1560,10 +1560,24 @@ Dhcpv4Srv::acceptServerId(const Pkt4Ptr& pkt) const {
}
Option4AddrLst
::
AddressContainer
addrs
=
option_addrs
->
getAddresses
();
// The server identifier option should carry exactly one IPv4 address.
// This option is encapsulated by the class which accepts a list of
// IPv4 addresses. So, there is a potential risk that the client has sent
// a server identifier option with multiple addresses and it has been
// parsed by the server. Here we are filtering out such malformed
// messages here.
if
(
addrs
.
size
()
!=
1
)
{
return
(
false
);
}
// This function iterates over all interfaces on which the
// server is listening to find the one which has a socket bound
// to the address carried in the server identifier option.
// This has some performance implications. However, given that
// typically there will be just a few active interfaces the
// performance hit should be acceptable. If it turns out to
// be significant, we will have to cache server identifiers
// when sockets are opened.
return
(
IfaceMgr
::
instance
().
hasOpenSocket
(
addrs
[
0
]));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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