Skip to content

Commit 476e9e8

Browse files
swinslowMaureenHelm
authored andcommitted
samples: net: Fix vlan error message in samples
This fixes an incorrect error message log statement for IPv4 vs. IPv6 in several net samples. The error message is in a portion of the files dealing with IPv4 bring-up. If the address is invalid, it logs the invalid address; however, the IPv4 statement incorrectly refers to ipv6_addr. This PR corrects it to output ipv4_addr as expected. Signed-off-by: Steve Winslow <[email protected]>
1 parent 35c5fbe commit 476e9e8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

samples/net/gptp/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int setup_iface(struct net_if *iface, const char *ipv6_addr,
7777
}
7878

7979
if (net_addr_pton(AF_INET, ipv4_addr, &addr4)) {
80-
LOG_ERR("Invalid address: %s", ipv6_addr);
80+
LOG_ERR("Invalid address: %s", ipv4_addr);
8181
return -EINVAL;
8282
}
8383

samples/net/lldp/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int setup_iface(struct net_if *iface, const char *ipv6_addr,
9090
}
9191

9292
if (net_addr_pton(AF_INET, ipv4_addr, &addr4)) {
93-
LOG_ERR("Invalid address: %s", ipv6_addr);
93+
LOG_ERR("Invalid address: %s", ipv4_addr);
9494
return -EINVAL;
9595
}
9696

samples/net/sockets/echo_client/src/vlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int setup_iface(struct net_if *iface, const char *ipv6_addr,
6767
}
6868

6969
if (net_addr_pton(AF_INET, ipv4_addr, &addr4)) {
70-
LOG_ERR("Invalid address: %s", ipv6_addr);
70+
LOG_ERR("Invalid address: %s", ipv4_addr);
7171
return -EINVAL;
7272
}
7373

samples/net/sockets/echo_server/src/vlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int setup_iface(struct net_if *iface, const char *ipv6_addr,
7272

7373
if (IS_ENABLED(CONFIG_NET_IPV4)) {
7474
if (net_addr_pton(AF_INET, ipv4_addr, &addr4)) {
75-
LOG_ERR("Invalid address: %s", ipv6_addr);
75+
LOG_ERR("Invalid address: %s", ipv4_addr);
7676
return -EINVAL;
7777
}
7878

0 commit comments

Comments
 (0)