net: if: Start index numbering from 1

In order to follow the BSD socket numbering of the network
interfaces, start numbering from 1. The index 0 is reserved
to mean any interface in BSD socket code.

Fixes #13084

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2019-02-14 11:37:23 +02:00 committed by Anas Nashif
commit 3206568e43
2 changed files with 14 additions and 8 deletions

View file

@ -1632,7 +1632,7 @@ bool net_if_need_calc_tx_checksum(struct net_if *iface);
*
* @return Pointer to interface or NULL if not found.
*/
struct net_if *net_if_get_by_index(u8_t index);
struct net_if *net_if_get_by_index(int index);
/**
* @brief Get interface index according to pointer
@ -1641,7 +1641,7 @@ struct net_if *net_if_get_by_index(u8_t index);
*
* @return Interface index
*/
u8_t net_if_get_by_iface(struct net_if *iface);
int net_if_get_by_iface(struct net_if *iface);
/**
* @typedef net_if_cb_t