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
ISC Open Source Projects
Kea
Commits
9e2efc3d
Commit
9e2efc3d
authored
Dec 10, 2019
by
Francis Dupont
Browse files
[
#898
] Changed received RFC 951 error message
parent
cde15d3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/pkt4.cc
View file @
9e2efc3d
// Copyright (C) 2011-201
7
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-201
9
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -184,18 +184,18 @@ Pkt4::unpack() {
if
(
buffer_in
.
getLength
()
==
buffer_in
.
getPosition
())
{
// this is *NOT* DHCP packet. It does not have any DHCPv4 options. In
// particular, it does not have magic cookie, a 4 byte sequence that
// differentiates between DHCP and BOOTP packets.
isc_throw
(
InvalidOperation
,
"Received BOOTP packet
. BOOTP is not supported
."
);
// differentiates between DHCP and
RFC 951
BOOTP packets.
isc_throw
(
InvalidOperation
,
"Received BOOTP packet
without vendor information extensions
."
);
}
if
(
buffer_in
.
getLength
()
-
buffer_in
.
getPosition
()
<
4
)
{
// there is not enough data to hold magic DHCP cookie
isc_throw
(
Unexpected
,
"Truncated or no DHCP packet."
);
// there is not enough data to hold magic DHCP cookie
isc_throw
(
Unexpected
,
"Truncated or no DHCP packet."
);
}
uint32_t
magic
=
buffer_in
.
readUint32
();
if
(
magic
!=
DHCP_OPTIONS_COOKIE
)
{
isc_throw
(
Unexpected
,
"Invalid or missing DHCP magic cookie"
);
isc_throw
(
Unexpected
,
"Invalid or missing DHCP magic cookie"
);
}
size_t
opts_len
=
buffer_in
.
getLength
()
-
buffer_in
.
getPosition
();
...
...
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