1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_dhcpv6_client: fix for SLIP link-layer

In a point-to-point serial connection, we don't have L2 addresses.
Set the link type & packet length accordingly and we will get a
prefix from KEA.
This commit is contained in:
Benjamin Valentin 2020-04-07 22:01:03 +02:00
parent 079aea8775
commit f198d689be
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ extern "C" {
* @{
*/
#define ARP_HWTYPE_ETHERNET (1U) /**< Ethernet */
#define ARP_HWTYPE_SERIAL (20U) /**< Serial Line */
#define ARP_HWTYPE_EUI64 (27U) /**< EUI-64 */
/** @} */

View File

@ -52,6 +52,11 @@ unsigned dhcpv6_client_get_duid_l2(unsigned iface, dhcpv6_duid_l2_t *duid)
}
else {
switch (netif->device_type) {
case NETDEV_TYPE_SLIP:
duid->l2type = byteorder_htons(ARP_HWTYPE_SERIAL);
/* L2 address length is 0 */
res = 0;
break;
case NETDEV_TYPE_ETHERNET:
case NETDEV_TYPE_BLE:
case NETDEV_TYPE_ESP_NOW: