mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
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:
@@ -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
@@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user