diff options
author | Neale Ranns <nranns@cisco.com> | 2018-01-17 10:29:10 -0800 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-01-23 13:36:48 +0000 |
commit | 54c6dc450031443663d40b836a8b0bffdcc2bdea (patch) | |
tree | 0d59479cda2cdaf14ecd72a6d72ef2ac3083e6ac /src/vpp-api/vom/dhcp_config.cpp | |
parent | 9d42087149a6870965896be74dc6260f72d2cac9 (diff) |
For DHCP client configuration control the setting of the broadcast flag in the
DISCOVER message sent.
According to RFC2131:
In the case of a client using DHCP for initial configuration (before
the client's TCP/IP software has been completely configured), DHCP
requires creative use of the client's TCP/IP software and liberal
interpretation of RFC 1122. The TCP/IP software SHOULD accept and
forward to the IP layer any IP packets delivered to the client's
hardware address before the IP address is configured; DHCP servers
and BOOTP relay agents may not be able to deliver DHCP messages to
clients that cannot accept hardware unicast datagrams before the
TCP/IP software is configured.
To work around some clients that cannot accept IP unicast datagrams
before the TCP/IP software is configured as discussed in the previous
paragraph, DHCP uses the 'flags' field [21]. The leftmost bit is
defined as the BROADCAST (B) flag. The semantics of this flag are
discussed in section 4.1 of this document. The remaining bits of the
flags field are reserved for future use. They MUST be set to zero by
clients and ignored by servers and relay agents. Figure 2 gives the
format of the 'flags' field.
this changes means VPP conforms to the:
"SHOULD accept and forward to the IP layer any IP packets delivered
to the client's hardware address before the IP address is configured"
with the caveat that VPP allows DHCP packets destined to the stanard client
DHCP port to be delivered. With this enhancement the control-plane is now
able to choose the setting of the broadcast flag.
Change-Id: Ia4eb2c9bb1e30c29f9192facc645e9533641955a
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/dhcp_config.cpp')
-rw-r--r-- | src/vpp-api/vom/dhcp_config.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vpp-api/vom/dhcp_config.cpp b/src/vpp-api/vom/dhcp_config.cpp index 0b6e2eff0de..8071fb15c57 100644 --- a/src/vpp-api/vom/dhcp_config.cpp +++ b/src/vpp-api/vom/dhcp_config.cpp @@ -24,20 +24,25 @@ singular_db<interface::key_t, dhcp_config> dhcp_config::m_db; dhcp_config::event_handler dhcp_config::m_evh; -dhcp_config::dhcp_config(const interface& itf, const std::string& hostname) +dhcp_config::dhcp_config(const interface& itf, + const std::string& hostname, + bool set_broadcast_flag) : m_itf(itf.singular()) , m_hostname(hostname) , m_client_id(l2_address_t::ZERO) + , m_set_broadcast_flag(set_broadcast_flag) , m_binding(0) { } dhcp_config::dhcp_config(const interface& itf, const std::string& hostname, - const l2_address_t& client_id) + const l2_address_t& client_id, + bool set_broadcast_flag) : m_itf(itf.singular()) , m_hostname(hostname) , m_client_id(client_id) + , m_set_broadcast_flag(set_broadcast_flag) , m_binding(0) { } @@ -46,6 +51,7 @@ dhcp_config::dhcp_config(const dhcp_config& o) : m_itf(o.m_itf) , m_hostname(o.m_hostname) , m_client_id(o.m_client_id) + , m_set_broadcast_flag(o.m_set_broadcast_flag) , m_binding(0) { } |