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

dhcp breaks when renew ACKs don't contain router and netmask #445

Closed
Dirbaio opened this issue Mar 23, 2021 · 0 comments · Fixed by #456
Closed

dhcp breaks when renew ACKs don't contain router and netmask #445

Dirbaio opened this issue Mar 23, 2021 · 0 comments · Fixed by #456
Labels

Comments

@Dirbaio
Copy link
Member

Dirbaio commented Mar 23, 2021

Had some fun with a customer's Mikrotik HAP AC2 router today...

Its DHCP server includes netmask, router and DNS only in the ACK to the initial request, and not in the ACK to renew requests: pcap, text

This causes DHCP to deconfigure the interface on first renew. Afterwards, it tries to renew with client_ip: 0.0.0.0, which doesn't even seem to hit the wire.

2796 TRACE DHCP send discover to 255.255.255.255:67: Repr { message_type: Discover,
    transaction_id: 2,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 0.0.0.0,
    your_ip: 0.0.0.0,
    server_ip: 0.0.0.0,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: true,
    requested_ip: None,
    client_identifier: Some(Address([2, 173, 57, 2, 48, 41])),
    server_identifier: None,
    parameter_request_list: None,
    dns_servers: None,
    max_size: Some(900) }  smoltcp::dhcp::clientv4::{{impl}}::egress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:10
3037 DEBUG DHCP recv Offer from 172.29.47.1 (172.29.47.1): Repr { message_type: Offer,
    transaction_id: 2,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 0.0.0.0,
    your_ip: 192.168.1.56,
    server_ip: 172.29.47.1,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: true,
    requested_ip: None,
    client_identifier: None,
    server_identifier: Some(172.29.47.1),
    parameter_request_list: None,
    dns_servers: None,
    max_size: None }  smoltcp::dhcp::clientv4::{{impl}}::ingress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:11
3047 TRACE DHCP send request to 255.255.255.255:67 = Repr { message_type: Request,
    transaction_id: 3,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 0.0.0.0,
    your_ip: 0.0.0.0,
    server_ip: 0.0.0.0,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: false,
    requested_ip: Some(192.168.1.56),
    client_identifier: Some(Address([2, 173, 57, 2, 48, 41])),
    server_identifier: Some(172.29.47.1),
    parameter_request_list: Some([1, 3, 6]),
    dns_servers: None,
    max_size: Some(900) }  smoltcp::dhcp::clientv4::{{impl}}::egress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:10
3292 DEBUG DHCP recv Ack from 172.29.47.1 (172.29.47.1): Repr { message_type: Ack,
    transaction_id: 3,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 0.0.0.0,
    your_ip: 192.168.1.56,
    server_ip: 172.29.47.1,
    router: Some(192.168.1.1),
    subnet_mask: Some(255.255.255.0),
    relay_agent_ip: 0.0.0.0,
    broadcast: false,
    requested_ip: None,
    client_identifier: None,
    server_identifier: Some(172.29.47.1),
    parameter_request_list: None,
    dns_servers: Some([Some(193.22.119.22), Some(217.18.237.74), Some(8.8.8.8)]),
    max_size: None }  smoltcp::dhcp::clientv4::{{impl}}::ingress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:11
3306 INFO  IPv4 address: 0.0.0.0/32 -> 192.168.1.56/24  embassy_net::stack::{{impl}}::poll_configurator::{{closure}} @ /home/dirbaio/.cargo/git/checkouts/embassy-net-5fb2bb5f0f16ef02/9bee576/embassy-net/src/stack.rs:85
3308 INFO  IPv4 gateway: None -> Some(192.168.1.1)  embassy_net::stack::{{impl}}::poll_configurator::{{closure}} @ /home/dirbaio/.cargo/git/checkouts/embassy-net-5fb2bb5f0f16ef02/9bee576/embassy-net/src/stack.rs:96

....

1969306 TRACE DHCP send renew to 172.29.47.1:67: Repr { message_type: Request,
    transaction_id: 4,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 192.168.1.56,
    your_ip: 0.0.0.0,
    server_ip: 0.0.0.0,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: false,
    requested_ip: None,
    client_identifier: Some(Address([2, 173, 57, 2, 48, 41])),
    server_identifier: None,
    parameter_request_list: None,
    dns_servers: None,
    max_size: Some(900) }  smoltcp::dhcp::clientv4::{{impl}}::egress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:10
1969546 DEBUG DHCP recv Ack from 172.29.47.1 (172.29.47.1): Repr { message_type: Ack,
    transaction_id: 4,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 192.168.1.56,
    your_ip: 192.168.1.56,
    server_ip: 172.29.47.1,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: false,
    requested_ip: None,
    client_identifier: None,
    server_identifier: Some(172.29.47.1),
    parameter_request_list: None,
    dns_servers: None,
    max_size: None }  smoltcp::dhcp::clientv4::{{impl}}::ingress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:11
1969556 INFO  IPv4 address: 192.168.1.56/24 -> 0.0.0.0/32  embassy_net::stack::{{impl}}::poll_configurator::{{closure}} @ /home/dirbaio/.cargo/git/checkouts/embassy-net-5fb2bb5f0f16ef02/9bee576/embassy-net/src/stack.rs:85
1969559 INFO  IPv4 gateway: Some(192.168.1.1) -> None  embassy_net::stack::{{impl}}::poll_configurator::{{closure}} @ /home/dirbaio/.cargo/git/checkouts/embassy-net-5fb2bb5f0f16ef02/9bee576/embassy-net/src/stack.rs:96

...

3935614 TRACE DHCP send renew to 172.29.47.1:67: Repr { message_type: Request,
    transaction_id: 5,
    client_hardware_address: Address([2, 173, 57, 2, 48, 41]),
    client_ip: 0.0.0.0,
    your_ip: 0.0.0.0,
    server_ip: 0.0.0.0,
    router: None,
    subnet_mask: None,
    relay_agent_ip: 0.0.0.0,
    broadcast: false,
    requested_ip: None,
    client_identifier: Some(Address([2, 173, 57, 2, 48, 41])),
    server_identifier: None,
    parameter_request_list: None,
    dns_servers: None,
    max_size: Some(900) }  smoltcp::dhcp::clientv4::{{impl}}::egress @ /home/dirbaio/akiles/smoltcp/src/macros.rs:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant