mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_dhcpv6_client_simple_pd: select upstream based on type/index
This commit is contained in:
parent
a311b3f951
commit
3173150ef7
@ -36,6 +36,25 @@ extern "C" {
|
||||
#define CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Interface type of the upstream interface
|
||||
*
|
||||
* See @ref netdev_type_t for possible values
|
||||
*/
|
||||
#ifndef CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_TYPE
|
||||
#define CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_TYPE NETDEV_ANY
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Interface index of the upstream interface
|
||||
*
|
||||
* If there are multiple interfaces of the same type, set this to select
|
||||
* which one to use for the upstream.
|
||||
*/
|
||||
#ifndef CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_IDX
|
||||
#define CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_IDX (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief 6LoWPAN compression context lifetime for configured prefixes in
|
||||
* minutes
|
||||
|
@ -48,6 +48,12 @@ static gnrc_netif_t *_find_upstream_netif(void)
|
||||
if (CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM) {
|
||||
return gnrc_netif_get_by_pid(CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM);
|
||||
}
|
||||
|
||||
if (CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_TYPE != NETDEV_ANY) {
|
||||
return gnrc_netif_get_by_type(CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_TYPE,
|
||||
CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM_IDX);
|
||||
}
|
||||
|
||||
while ((netif = gnrc_netif_iter(netif))) {
|
||||
if (!gnrc_netif_is_6lo(netif)) {
|
||||
LOG_WARNING("DHCPv6: Selecting interface %d as upstream\n",
|
||||
|
Loading…
Reference in New Issue
Block a user