summaryrefslogtreecommitdiff
path: root/src/user/app/ethdump/ether.c
diff options
context:
space:
mode:
authordzwdz2022-08-17 23:10:37 +0200
committerdzwdz2022-08-17 23:10:37 +0200
commitbb05dbe9ab050c420e0cba11f3224bd18dd9d642 (patch)
tree2aa17b0dd3eac398ac86203f87541932397f6e8b /src/user/app/ethdump/ether.c
parent6ffb06af70faa5657f2c6091fe23500007e2bd44 (diff)
user/net: respond to pings
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);