Skip to content

Commit

Permalink
net: l2: Correct debug message and avoid unneeded assignment
Browse files Browse the repository at this point in the history
At the moment we print "Sending ARP packet" even if we found ARP entry
and send the packet directly.

Signed-off-by: Andrei Emeltchenko <[email protected]>
  • Loading branch information
finikorg authored and jukkar committed Sep 18, 2017
1 parent 70372f1 commit cc4d138
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions subsys/net/ip/l2/ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,20 @@ static enum net_verdict ethernet_send(struct net_if *iface,
return NET_DROP;
}

NET_DBG("Sending arp pkt %p (orig %p) to iface %p",
arp_pkt, pkt, iface);

if (pkt != arp_pkt) {
NET_DBG("Sending arp pkt %p (orig %p) to iface %p",
arp_pkt, pkt, iface);

/* Either pkt went to ARP pending queue
* or there was not space in the queue anymore
*/
net_pkt_unref(pkt);
}

pkt = arp_pkt;
pkt = arp_pkt;
} else {
NET_DBG("Found ARP entry, sending pkt %p to iface %p",
pkt, iface);
}

net_pkt_ll_src(pkt)->addr = (u8_t *)&NET_ETH_HDR(pkt)->src;
net_pkt_ll_src(pkt)->len = sizeof(struct net_eth_addr);
Expand Down

0 comments on commit cc4d138

Please sign in to comment.