summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArtem Glazychev <glazychev@mts.ru>2024-07-17 16:48:45 +0700
committerMatthew Smith <mgsmith@netgate.com>2024-10-23 13:44:09 +0000
commit768c8d4ece46610de15644342a4f63e4ccd2c04f (patch)
tree984db831c68ba960975a715a5938cef2c0921942 /test
parent3bd4e47a9ae8eb53f2441aa82e6f18148ee69c2a (diff)
dhcp: fix buffer length after adding new option
The size of dhcp option should be o.length + 2 additional bytes of the header. Incorrect offset results in an extra byte at the end of the packet: ... 0120 04 00 00 00 04 05 04 AC 10 04 01 FF 00 ... RFC2131 says the last should be the 'end' option (ff) Type: fix Change-Id: I056d755d29465aab8c1c55a0b930f65ece6fafce Signed-off-by: Artem Glazychev <glazychev@mts.ru>
Diffstat (limited to 'test')
-rw-r--r--test/test_dhcp.py3
1 files changed, 3 insertions, 0 deletions
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
)