From bb05dbe9ab050c420e0cba11f3224bd18dd9d642 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 17 Aug 2022 23:10:37 +0200 Subject: user/net: respond to pings --- src/user/app/ethdump/ether.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/user/app/ethdump/ether.c') diff --git a/src/user/app/ethdump/ether.c b/src/user/app/ethdump/ether.c index da21b49..32646e2 100644 --- a/src/user/app/ethdump/ether.c +++ b/src/user/app/ethdump/ether.c @@ -24,9 +24,16 @@ void ether_parse(const uint8_t *buf, size_t len) { uint16_t ethertype = nget16(buf + EtherType); printf("ethertype %u\n", ethertype); + + struct ethernet ether = (struct ethernet){ + .src = &smac, + .dst = &dmac, + .type = ethertype, + }; + switch (ethertype) { case ET_IPv4: - ipv4_parse(buf + Payload, len - Payload); + ipv4_parse(buf + Payload, len - Payload, ether); break; case ET_ARP: arp_parse(buf + Payload, len - Payload); -- cgit v1.2.3