summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorAdriano Cordova <adrianox@gmail.com>2024-11-11 18:09:45 -0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-11-18 16:12:35 +0100
commit9063dba2d326e07682338cdb636787e99f1bf3f5 (patch)
tree2013532b61da4c9903fea97a89e1d406dd01efa9 /net/net.c
parent1327c2a8d6514d4abfa3642ce338fed50b811b21 (diff)
net: net_utils: Move ip_to_string to lib/net_utils.c
The function string_to_ip is already in net_utils, which is compiled unconditionally, but ip_to_string is currently only accessible if the legacy network stack is selected. This commit puts ip_to_string in net_utils.c and removes it from the legacy network code. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/net.c b/net/net.c
index f47e9fbe33a..ca35704f661 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1723,17 +1723,6 @@ int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
return 1;
}
-void ip_to_string(struct in_addr x, char *s)
-{
- x.s_addr = ntohl(x.s_addr);
- sprintf(s, "%d.%d.%d.%d",
- (int) ((x.s_addr >> 24) & 0xff),
- (int) ((x.s_addr >> 16) & 0xff),
- (int) ((x.s_addr >> 8) & 0xff),
- (int) ((x.s_addr >> 0) & 0xff)
- );
-}
-
void vlan_to_string(ushort x, char *s)
{
x = ntohs(x);