aboutgitcodebugslistschat
path: root/dhcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-09-21 18:42:45 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-09-27 17:25:22 +0200
commitc09069211a97dc4cc0247b95d99ed33a98e8153c (patch)
treeac52cd9b550577bdc3cce37489e76132e08dabff /dhcp.c
parent8b8537d30142a3d8b343cdd4e176a65ccdff1748 (diff)
downloadpasst-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar.gz
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar.bz2
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar.lz
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar.xz
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.tar.zst
passt-c09069211a97dc4cc0247b95d99ed33a98e8153c.zip
dhcp: Actually note down the length of options received by the client
It turns out we never used 'clen' until commit 1f24d3efb499 ("dhcp: support BOOTP clients"), and we always ignored option 55 (Parameter Request List), while, according to RFC 2132, we MUST try to insert the requested options in the order requested by the client. The commit mentioned above made this visible because now every client is reported as sending a DHCPREQUEST as an old BOOTP client, based on the lack of option 53 (that is, zero length). Fixes: b439984641ed ("merd: ARP and DHCP handlers, connection tracking fixes") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dhcp.c')
-rw-r--r--dhcp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dhcp.c b/dhcp.c
index c1ac95e..46c258e 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -317,6 +317,7 @@ int dhcp(const struct ctx *c, const struct pool *p)
return -1;
memcpy(&opts[*type].c, val, *olen);
+ opts[*type].clen = *olen;
opt_off += *olen + 2;
}