Skip to content

Commit a5e6aea

Browse files
committed
net: ethernet: arp: extend error log
If a gateway is not set for a interface, also log the destination address. Also print the interface index instead of the interface pointer. Signed-off-by: Fin Maaß <[email protected]>
1 parent 23fb3b7 commit a5e6aea

File tree

1 file changed

+4
-2
lines changed
  • subsys/net/l2/ethernet

1 file changed

+4
-2
lines changed

subsys/net/l2/ethernet/arp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,10 @@ struct net_pkt *net_arp_prepare(struct net_pkt *pkt,
377377
if (ipv4) {
378378
addr = &ipv4->gw;
379379
if (net_ipv4_is_addr_unspecified(addr)) {
380-
NET_ERR("Gateway not set for iface %p",
381-
net_pkt_iface(pkt));
380+
NET_ERR("Gateway not set for iface %d, could not "
381+
"send ARP request for %s",
382+
net_if_get_by_iface(net_pkt_iface(pkt)),
383+
net_sprint_ipv4_addr(request_ip));
382384

383385
return NULL;
384386
}

0 commit comments

Comments
 (0)