Skip to content

Commit

Permalink
ovn: Modify the DHCPv4 router option to optional
Browse files Browse the repository at this point in the history
Co-authored-by: Dong Jun <[email protected]>
Signed-off-by: Dong Jun <[email protected]>
Signed-off-by: Guoshuai Li <[email protected]>
Acked-by: Numan Siddique <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
2 people authored and blp committed Mar 17, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent fed8962 commit b89d25e
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ Post-v2.7.0
- The "learn" action now supports a "limit" option (see ovs-ofctl(8)).
- New support for multiple VLANs (802.1ad or "QinQ"), including a new
"dot1q-tunnel" port VLAN mode.
- OVN:
* Make the DHCPv4 router setting optional.

v2.7.0 - 21 Feb 2017
---------------------
10 changes: 3 additions & 7 deletions ovn/northd/ovn-northd.c
Original file line number Diff line number Diff line change
@@ -2279,11 +2279,9 @@ build_dhcpv4_action(struct ovn_port *op, ovs_be32 offer_ip,
&op->nbsp->dhcpv4_options->options, "server_mac");
const char *lease_time = smap_get(
&op->nbsp->dhcpv4_options->options, "lease_time");
const char *router = smap_get(
&op->nbsp->dhcpv4_options->options, "router");

if (!(server_ip && server_mac && lease_time && router)) {
/* "server_id", "server_mac", "lease_time" and "router" should be
if (!(server_ip && server_mac && lease_time)) {
/* "server_id", "server_mac" and "lease_time" should be
* present in the dhcp_options. */
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_WARN_RL(&rl, "Required DHCPv4 options not defined for lport - %s",
@@ -2826,9 +2824,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
&od->nbs->ports[i]->dhcpv4_options->options, "server_mac");
const char *lease_time = smap_get(
&od->nbs->ports[i]->dhcpv4_options->options, "lease_time");
const char *router = smap_get(
&od->nbs->ports[i]->dhcpv4_options->options, "router");
if (server_id && server_mac && lease_time && router) {
if (server_id && server_mac && lease_time) {
struct ds match = DS_EMPTY_INITIALIZER;
const char *actions =
has_stateful ? "ct_commit; next;" : "next;";
16 changes: 8 additions & 8 deletions ovn/ovn-nb.xml
Original file line number Diff line number Diff line change
@@ -1393,14 +1393,6 @@
The Ethernet address for the DHCP server to use.
</column>

<column name="options" key="router">
<p>
The IP address of a gateway for the client to use. This should be
in the subnet of the offered IP. The DHCPv4 option code for this
option is 3.
</p>
</column>

<column name="options" key="lease_time"
type='{"type": "integer", "minInteger": 0, "maxInteger": 4294967295}'>
<p>
@@ -1422,6 +1414,14 @@
DHCPv4 options and their codes.
</p>

<column name="options" key="router">
<p>
The IP address of a gateway for the client to use. This should be
in the subnet of the offered IP. The DHCPv4 option code for this
option is 3.
</p>
</column>

<column name="options" key="netmask">
<p>
The DHCPv4 option code for this option is 1.

0 comments on commit b89d25e

Please sign in to comment.