mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 14:03:55 +01:00
gnrc/ipv6_auto_subnets: allow to configure minimal prefix length
This commit is contained in:
parent
9358a4430d
commit
2a7691176b
@ -89,6 +89,7 @@
|
||||
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
|
||||
*/
|
||||
|
||||
#include "compiler_hints.h"
|
||||
#include "net/gnrc/ipv6.h"
|
||||
#include "net/gnrc/netif.h"
|
||||
#include "net/gnrc/netif/hdr.h"
|
||||
@ -141,6 +142,14 @@
|
||||
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_FIX_LEN (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Minimal length of a new prefix.
|
||||
* e.g. Linux will only accept /64 prefixes for SLAAC
|
||||
*/
|
||||
#ifndef CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN
|
||||
#define CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Number of subnets that can be configured.
|
||||
*
|
||||
@ -369,6 +378,10 @@ static void _configure_subnets(uint8_t subnets, uint8_t start_idx, gnrc_netif_t
|
||||
return;
|
||||
}
|
||||
|
||||
if (new_prefix_len < may_be_zero(CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN)) {
|
||||
new_prefix_len = CONFIG_GNRC_IPV6_AUTO_SUBNETS_PREFIX_MIN_LEN;
|
||||
}
|
||||
|
||||
while ((downstream = gnrc_netif_iter(downstream))) {
|
||||
gnrc_pktsnip_t *tmp;
|
||||
ipv6_addr_t new_prefix;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user