aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
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 /src/plugins
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 'src/plugins')
-rw-r--r--src/plugins/dhcp/dhcp4_proxy_node.c3
1 files changed, 2 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;