aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/dhcp/dhcp4_proxy_node.c3
-rw-r--r--test/test_dhcp.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/dhcp/dhcp4_proxy_node.c b/src/plugins/dhcp/dhcp4_proxy_node.c
index 2b49d49bb7f..740ae8043e0 100644
--- a/src/plugins/dhcp/dhcp4_proxy_node.c
+++ b/src/plugins/dhcp/dhcp4_proxy_node.c
@@ -321,7 +321,8 @@ dhcp_proxy_to_server_input (vlib_main_t * vm,
o->length += id_len + 5;
}
- len = o->length + 3;
+ /* 2 bytes for option header 82+len */
+ len = o->length + 2;
b0->current_length += len;
/* Fix IP header length and checksum */
old_l0 = ip0->length;
diff --git a/test/test_dhcp.py b/test/test_dhcp.py
index e668b7bd1c0..15af323454f 100644
--- a/test/test_dhcp.py
+++ b/test/test_dhcp.py
@@ -327,6 +327,9 @@ class TestDHCP(VppTestCase):
is_discover = True
self.assertTrue(is_discover)
+ # The last option must always be the 'end' option
+ self.assertEqual(dhcp.options[-1], "end")
+
data = self.validate_relay_options(
pkt, src_intf, src_intf.local_ip4, vpn_id, fib_id, oui
)