Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: long DHCPv4 options (RFC 3396) #4642

Open
evverx opened this issue Jan 16, 2025 · 0 comments
Open

RFE: long DHCPv4 options (RFC 3396) #4642

evverx opened this issue Jan 16, 2025 · 0 comments

Comments

@evverx
Copy link
Contributor

evverx commented Jan 16, 2025

Brief description

Long DHCPv4 options longer than 255 bytes aren't supported out of the box. For example

raw(DHCP(options=[('captive-portal', 'a'*256)]))

fails with

error: While dissecting field 'options': ubyte format requires 0 <= number <= 255

but according to https://www.rfc-editor.org/rfc/rfc3396#section-1 it can be split and then it should be joined on the receiving side

when more than
one option with a given type code appears in the DHCP packet, all
such options should be concatenated together.

Wireshark started concatenating options according to that RFC a couple months ago: https://gitlab.com/wireshark/wireshark/-/merge_requests/18079

https://www.ietf.org/archive/id/draft-tojens-dhcp-option-concat-considerations-00.html was also mentioned there.

(It's possible to do all that manually. It's just something I noticed in the context of suboptions in NetworkConfiguration/dhcpcd#404. It came up again when I took a look at #4638 and tried to stuff quite a few IP addresses into a reply :-))

Scapy version

7106b01

Python version

Python 3.13.1

Operating system

Fedora 41

Additional environment information

No response

How to reproduce

raw(DHCP(options=[('captive-portal', 'a'*256)]))

and

DHCP(b'\x06\x02\x01\x02\x06\x02\x03\x04')

should be the same as

DHCP(b'\x06\x04\x01\x02\x03\x04')

Actual result

No response

Expected result

No response

Related resources

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant