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

Magic Cookie Error #58

Open
mcmar opened this issue May 18, 2022 · 2 comments
Open

Magic Cookie Error #58

mcmar opened this issue May 18, 2022 · 2 comments

Comments

@mcmar
Copy link

mcmar commented May 18, 2022

I'm testing this package. When my Android phone attempts to connect and asks for an IPv4 address, I get this error:

2022/05/18 22:02:15  warn failed to serve request from <32:b1:27:a1:dc:81>0.0.0.0:68: malformed DHCP packet: got magic cookie [0 0 0 0], want [99 130 83 99]

image

This is my Dhcpfile:

192.168.1.64 - 192.168.1.253
lease 1h
option {
    router 192.168.1.254
    nameserver 8.8.8.8
}

image

Have I done something wrong? I don't know why Android would make a DHCP request with a malformed packet and it seems to work with other DHCP servers I've tried, such as a standard off-the-shelf consumer router.

@ppacher
Copy link
Collaborator

ppacher commented May 19, 2022

Hi @mcmar, thanks for reporting.

I'm not sure whats up here. The value of the magic cookie has been fixed to 99 130 83 99 in RFC1048. I'm not sure why your phone does not send it as expected. Could you try to catch the DHCP request message using tcpdump (see here)? Maybe that can help us to get some more insights into the problem.

Also, what android version are you using?

@czerwe
Copy link

czerwe commented May 14, 2023

Hi, i have the same issue here with an iPhone

• serving request from <12:49:dc:33:90:a4>0.0.0.0:68
• failed to serve request from <12:49:dc:33:90:a4>0.0.0.0:68: malformed DHCP packet: got magic cookie [0 0 0 0], want [99 130 83 99]

i did a tcpdump

 20:33:22.174028 12:49:dc:33:90:a4 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 255, id 10023, offset 0, flags  [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:49:dc:33:90:a4, length 300, xid 0x9a048d0e, Flags [none] (0x0000)
      Client-Ethernet-Address 12:49:dc:33:90:a4
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message Option 53, length 1: Request
        Parameter-Request Option 55, length 9:
          Subnet-Mask, Classless-Static-Route, Default-Gateway, Domain-Name-Server
          Domain-Name, Option 108, URL, Option 119
          Option 252
        MSZ Option 57, length 2: 1500
        Client-ID Option 61, length 7: ether 12:49:dc:33:90:a4
        Requested-IP Option 50, length 4: 10.0.10.186
        Lease-Time Option 51, length 4: 7776000

I looks like there are correct Magic cookie information's.

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

3 participants