diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-14 22:32:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-14 22:32:35 +0200 |
commit | a622565d06b0747458b59240c71f92b6925f562c (patch) | |
tree | f0c85ed8f501265f7ea7515f0c214a7992edc48b /net | |
parent | 5ed70d2fa244e9d680cb2f69153fcb2ea52ea57a (diff) | |
download | barebox-a622565d06b0747458b59240c71f92b6925f562c.tar.gz barebox-a622565d06b0747458b59240c71f92b6925f562c.tar.xz |
net: Pass network device to net_answer_arp()
The caller already has the correct network device, so pass it
to net_answer_arp() rather than using eth_get_current() there.
This is a step towards making a global current network device
unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -379,11 +379,10 @@ int net_icmp_send(struct net_connection *con, int len) return net_ip_send(con, sizeof(struct icmphdr) + len); } -static int net_answer_arp(unsigned char *pkt, int len) +static int net_answer_arp(struct eth_device *edev, unsigned char *pkt, int len) { struct arprequest *arp = (struct arprequest *)(pkt + ETHER_HDR_SIZE); struct ethernet *et = (struct ethernet *)pkt; - struct eth_device *edev = eth_get_current(); unsigned char *packet; int ret; @@ -453,7 +452,7 @@ static int net_handle_arp(struct eth_device *edev, unsigned char *pkt, int len) switch (ntohs(arp->ar_op)) { case ARPOP_REQUEST: - return net_answer_arp(pkt, len); + return net_answer_arp(edev, pkt, len); case ARPOP_REPLY: arp_handler(arp); return 1; |