Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
62409cd9
Commit
62409cd9
authored
Oct 22, 2014
by
Tomek Mrugalski
🛰
Browse files
[3486] DHCPv6 now processed vendor-class option properly.
parent
5b92bcd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
62409cd9
8xx. [bug] tomek
DHCPv6 component now processes incoming vendor-class options
properly (packets are classified as VENDOR_CLASS_[content of the
vendor-class option]).
(Trac #3486, git tbd)
848. [func] fdupont
Added truncated HMAC support to TSIG, as per RFC 4635.
(Trac #3593, git ae3a9cd1a0d2dc07b7092368149381d69bc2c61a)
...
...
src/bin/dhcp6/dhcp6_srv.cc
View file @
62409cd9
...
...
@@ -2555,8 +2555,7 @@ void Dhcpv6Srv::classifyPacket(const Pkt6Ptr& pkt) {
classes
<<
VENDOR_CLASS_PREFIX
<<
DOCSIS3_CLASS_EROUTER
;
}
else
{
classes
<<
vclass
->
getTuple
(
0
).
getText
();
classes
<<
VENDOR_CLASS_PREFIX
<<
vclass
->
getTuple
(
0
).
getText
();
}
// If there is no class identified, leave.
...
...
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
View file @
62409cd9
...
...
@@ -25,6 +25,7 @@
#include <dhcp/option_int_array.h>
#include <dhcp/option_string.h>
#include <dhcp/option_vendor.h>
#include <dhcp/option_vendor_class.h>
#include <dhcp/iface_mgr.h>
#include <dhcp6/json_config_parser.h>
#include <dhcp/dhcp6.h>
...
...
@@ -1849,6 +1850,37 @@ TEST_F(Dhcpv6SrvTest, clientClassify2) {
EXPECT_TRUE
(
srv_
.
selectSubnet
(
sol
));
}
// Tests whether a packet with custom vendor-class (not erouter or docsis)
// is classified properly.
TEST_F
(
Dhcpv6SrvTest
,
clientClassification3
)
{
NakedDhcpv6Srv
srv
(
0
);
// Let's create a SOLICIT.
Pkt6Ptr
sol
=
Pkt6Ptr
(
new
Pkt6
(
DHCPV6_SOLICIT
,
1234
));
sol
->
setRemoteAddr
(
IOAddress
(
"2001:db8:1::3"
));
sol
->
addOption
(
generateIA
(
D6O_IA_NA
,
234
,
1500
,
3000
));
OptionPtr
clientid
=
generateClientId
();
sol
->
addOption
(
clientid
);
// Now let's add a vendor-class with id=1234 and content "foo"
OptionVendorClassPtr
vendor_class
(
new
OptionVendorClass
(
Option
::
V6
,
1234
));
OpaqueDataTuple
tuple
(
OpaqueDataTuple
::
LENGTH_2_BYTES
);
tuple
=
"foo"
;
vendor_class
->
addTuple
(
tuple
);
sol
->
addOption
(
vendor_class
);
// Now the server classifies the packet.
srv
.
classifyPacket
(
sol
);
// The packet should now belong to VENDOR_CLASS_foo.
EXPECT_TRUE
(
sol
->
inClass
(
srv
.
VENDOR_CLASS_PREFIX
+
"foo"
));
// It should not belong to "foo"
EXPECT_FALSE
(
sol
->
inClass
(
"foo"
));
}
// This test checks that the server will handle a Solicit with the Vendor Class
// having a length of 4 (enterprise-id only).
TEST_F
(
Dhcpv6SrvTest
,
cableLabsShortVendorClass
)
{
...
...
Write
Preview
Markdown
is supported
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