[Slirp] [Git][slirp/libslirp][master] 2 commits: dhcp: Always send DHCP_OPT_LEN bytes in options

Marc-André Lureau (@elmarco) gitlab at gitlab.freedesktop.org
Mon Jun 21 07:40:42 UTC 2021



Marc-André Lureau pushed to branch master at slirp / libslirp


Commits:
d7fb5421 by Samuel Thibault at 2021-06-21T09:32:38+02:00
dhcp: Always send DHCP_OPT_LEN bytes in options

RFC2131 suggests that the options field may be at least 312 bytes.
Some DHCP clients seem to assume that it has to be at least 312 bytes.

Fixes #51
Fixes: f13cad45b25d92760bb0ad67bec0300a4d7d5275 ("bootp: limit
vendor-specific area to input packet memory buffer")

Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

- - - - -
f3c5eea0 by Marc-André Lureau at 2021-06-21T07:40:39+00:00
Merge branch 'dhcp-fix' into 'master'

dhcp: Always send DHCP_OPT_LEN bytes in options

Closes #51

See merge request slirp/libslirp!97
- - - - -


1 changed file:

- src/bootp.c


Changes:

=====================================
src/bootp.c
=====================================
@@ -355,13 +355,13 @@ static void bootp_reply(Slirp *slirp,
         q += sizeof(nak_msg) - 1;
     }
     assert(q < end);
-    *q = RFC1533_END;
+    *q++ = RFC1533_END;
 
     daddr.sin_addr.s_addr = 0xffffffffu;
 
-    assert ((q - rbp->bp_vend + 1) <= DHCP_OPT_LEN);
+    assert(q <= end);
 
-    m->m_len = sizeof(struct bootp_t) + (q - rbp->bp_vend + 1) - sizeof(struct ip) - sizeof(struct udphdr);
+    m->m_len = sizeof(struct bootp_t) + (end - rbp->bp_vend) - sizeof(struct ip) - sizeof(struct udphdr);
     udp_output(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
 }
 



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/146ff910d4b62837c11c65a30c7257ab02d17d0f...f3c5eea002a6257996319c6398beab5c63fb316b

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/146ff910d4b62837c11c65a30c7257ab02d17d0f...f3c5eea002a6257996319c6398beab5c63fb316b
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210621/e4875632/attachment.htm>


More information about the Slirp mailing list