summaryrefslogtreecommitdiff
path: root/src/user/app/ethdump/ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/app/ethdump/ether.c')
-rw-r--r--src/user/app/ethdump/ether.c9
1 files changed, 8 insertions, 1 deletions
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);