summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-14 22:32:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-14 22:32:35 +0200
commita622565d06b0747458b59240c71f92b6925f562c (patch)
treef0c85ed8f501265f7ea7515f0c214a7992edc48b /net
parent5ed70d2fa244e9d680cb2f69153fcb2ea52ea57a (diff)
downloadbarebox-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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/net.c b/net/net.c
index e5bd9bbc78..df1d677ba6 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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;