net/utils: Switch argument order of net_ipv6_pref2mask

When implementing IPv6-related logic, we found the `net_ipv6_pref2mask`
and `net_ipv6addr_copy` are using different argument order:
```
net_ipv6addr_copy(ifaddr->addr, addr);
net_ipv6_pref2mask(preflen, ifaddr->mask);
```
Change the order to:
```
net_ipv6addr_copy(ifaddr->addr, addr);
net_ipv6_pref2mask(ifaddr->mask, preflen);
```

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng
2023-11-03 21:22:03 +08:00
committed by Xiang Xiao
parent 3e4d847f42
commit 4c99ad1ba9
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -42,15 +42,15 @@
* specifies the number of MS bits under mask (0-128)
*
* Input Parameters:
* mask - The location to return the netmask.
* preflen - Determines the width of the netmask (in bits). Range 0-128
* mask - The location to return the netmask.
*
* Returned Value:
* None
*
****************************************************************************/
void net_ipv6_pref2mask(uint8_t preflen, net_ipv6addr_t mask)
void net_ipv6_pref2mask(net_ipv6addr_t mask, uint8_t preflen)
{
unsigned int bit;
unsigned int i;
+2 -2
View File
@@ -242,8 +242,8 @@ uint8_t net_ipv6_mask2pref(FAR const uint16_t *mask);
* specifies the number of MS bits under mask (0-128)
*
* Input Parameters:
* mask - The location to return the netmask.
* preflen - Determines the width of the netmask (in bits). Range 0-128
* mask - The location to return the netmask.
*
* Returned Value:
* None
@@ -251,7 +251,7 @@ uint8_t net_ipv6_mask2pref(FAR const uint16_t *mask);
****************************************************************************/
#ifdef CONFIG_NET_IPv6
void net_ipv6_pref2mask(uint8_t preflen, net_ipv6addr_t mask);
void net_ipv6_pref2mask(net_ipv6addr_t mask, uint8_t preflen);
#endif
/****************************************************************************