Skip to content

Commit e397d19

Browse files
jukkarhenrikbrixandersen
authored andcommitted
net: if: Fix typo in IPv6 hop limit API name
The net_if_ipv6_set_hop_limit() API was missing the "_if_" part in it. Fix this so that the network interface API is consistent. The old function is deprecated and should not be used. The old function is left to the code and it calls the new properly named function. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 8bd612c commit e397d19

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

include/zephyr/net/net_if.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,18 @@ uint8_t net_if_ipv6_get_hop_limit(struct net_if *iface);
16781678
* @param iface Network interface
16791679
* @param hop_limit New hop limit
16801680
*/
1681-
void net_ipv6_set_hop_limit(struct net_if *iface, uint8_t hop_limit);
1681+
void net_if_ipv6_set_hop_limit(struct net_if *iface, uint8_t hop_limit);
1682+
1683+
/* The old hop limit setter function is deprecated because the naming
1684+
* of it was incorrect. The API name was missing "_if_" so this function
1685+
* should not be used.
1686+
*/
1687+
__deprecated
1688+
static inline void net_ipv6_set_hop_limit(struct net_if *iface,
1689+
uint8_t hop_limit)
1690+
{
1691+
net_if_ipv6_set_hop_limit(iface, hop_limit);
1692+
}
16821693

16831694
/**
16841695
* @brief Get IPv6 multicast hop limit specified for a given interface. This is the

subsys/net/ip/ipv6_nbr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,8 +2438,8 @@ static int handle_ra_input(struct net_icmp_ctx *ctx,
24382438
retrans_timer = ntohl(ra_hdr->retrans_timer);
24392439

24402440
if (ra_hdr->cur_hop_limit) {
2441-
net_ipv6_set_hop_limit(net_pkt_iface(pkt),
2442-
ra_hdr->cur_hop_limit);
2441+
net_if_ipv6_set_hop_limit(net_pkt_iface(pkt),
2442+
ra_hdr->cur_hop_limit);
24432443
NET_DBG("New hop limit %d",
24442444
net_if_ipv6_get_hop_limit(net_pkt_iface(pkt)));
24452445
}

subsys/net/ip/net_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ uint8_t net_if_ipv6_get_hop_limit(struct net_if *iface)
27022702
#endif
27032703
}
27042704

2705-
void net_ipv6_set_hop_limit(struct net_if *iface, uint8_t hop_limit)
2705+
void net_if_ipv6_set_hop_limit(struct net_if *iface, uint8_t hop_limit)
27062706
{
27072707
#if defined(CONFIG_NET_NATIVE_IPV6)
27082708
net_if_lock(iface);

subsys/net/l2/virtual/ipip/ipip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static int interface_set_config(struct net_if *iface,
464464
ctx->family = AF_INET6;
465465
net_virtual_set_name(iface, "IPv6 tunnel");
466466

467-
net_ipv6_set_hop_limit(iface, 64);
467+
net_if_ipv6_set_hop_limit(iface, 64);
468468

469469
if (ctx->attached_to == NULL) {
470470
(void)net_virtual_interface_attach(iface,

0 commit comments

Comments
 (0)