Commit Graph

22 Commits (fb2d0029d8b7c9d7461db7215a3d6ed674e4c6b7)

Author SHA1 Message Date
Thibaut Vandervelden fb2d0029d8 Add support for 802.15.4 and 6LoWPAN 2021-10-21 01:25:12 +02:00
Dario Nieuwenhuis 48debf7db8 dhcp: add "ignore NAKs" option.
This workarounds a known broken Vodafone Fiber router which replies
with both NAK and ACK:

![screenshot-2021-10-19_01-18-41](https://user-images.githubusercontent.com/1247578/137819133-a8f9ab28-8bc5-4cca-9c91-2eac15d88070.png)
2021-10-19 01:17:28 +02:00
Dario Nieuwenhuis bcf6211fbe socket/dhcp: add nak tests 2021-10-15 01:02:31 +02:00
Dario Nieuwenhuis a43a6772c9 socket/dhcp: add retransmission/timeout tests 2021-10-15 00:43:21 +02:00
Dario Nieuwenhuis 6768d89165 socket/dhcp: add renew test 2021-10-14 23:33:25 +02:00
Dario Nieuwenhuis 94541ae827 socket/dhcp: add basic test 2021-10-14 23:19:30 +02:00
Dario Nieuwenhuis 3b7100c501 socket/dhcp: log incoming reprs as well as outgoing. 2021-10-14 19:41:10 +02:00
Dario Nieuwenhuis af4db615f5 socket/dhcp: Use random transaction_id instead of sequential.
This is a minor security improvement against blind packet spoofing, since
it adds more entropy to the packets.
2021-10-14 14:10:08 +02:00
Dario Nieuwenhuis d34f4f783b socket/dhcp: do not set BROADCAST flag.
Reasons:
1. We were already accidentally not setting the BROADCAST flag due to it being the wrong bit (see previous commit).
2. Major OSes don't set it.
3. rfc1542 section 3.1.1 states it's discouraged, and the issue it's supposed to workaround doesn't apply to smoltcp.

    Unfortunately, some client implementations are
    unable to receive such unicast IP datagrams until they know their own
    IP address
    (..)
    This addition to the protocol is a workaround for old host
    implementations.  Such implementations SHOULD be modified so
    that they may receive unicast BOOTREPLY messages, thus making
    use of this workaround unnecessary.  In general, the use of
    this mechanism is discouraged.
2021-10-14 14:03:50 +02:00
Thibaut Vandervelden 82a62327ba Fix clippy because of MSV change 2021-09-16 19:44:26 +02:00
Thibaut Vandervelden 6a27136047 Fix clippy lints 2021-08-18 16:05:50 +02:00
qiujiangkun 2a574fbca6 various clippy fix 2021-06-27 10:45:57 +02:00
Dario Nieuwenhuis 98fe17890a rustfmt 2021-06-27 09:31:59 +02:00
Dario Nieuwenhuis 32311b23dc Add Context struct. 2021-06-17 03:20:58 +02:00
Ryan Summers 9f7bf5dc68 Adding support for retrieving socket handle from DHCP sockets 2021-06-14 10:53:27 +02:00
Dario Nieuwenhuis a81f2fef56 dhcp: convert port check to hard assert. 2021-05-28 18:43:52 +02:00
Dario Nieuwenhuis 743f9de039 dhcp: address review comments. 2021-05-28 18:23:50 +02:00
Dario Nieuwenhuis a916888ab8 dhcp: add max_lease_duration option 2021-04-13 20:23:28 +02:00
Dario Nieuwenhuis 53b62cfbad dhcp: remove 0.0.0.0s from the DNS serevr list.
tp-link routers pad the DNS server list with 0.0.0.0 to a fixed size :(
2021-04-13 18:43:23 +02:00
Dario Nieuwenhuis b1f2bcb678 dhcp: retry REQUEST slower and with exponential backoff. Fixes #464 2021-04-07 21:52:26 +02:00
Dario Nieuwenhuis cb075bfc16 dhcp: handle NAK packets 2021-04-07 19:00:36 +02:00
Dario Nieuwenhuis 0d53163c55 dhcp: convert to socket 2021-04-07 19:00:36 +02:00