summaryrefslogtreecommitdiff
path: root/src/user/app/ethdump/ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/app/ethdump/ipv4.c')
-rw-r--r--src/user/app/ethdump/ipv4.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/user/app/ethdump/ipv4.c b/src/user/app/ethdump/ipv4.c
index e8ab7ea..8b181f6 100644
--- a/src/user/app/ethdump/ipv4.c
+++ b/src/user/app/ethdump/ipv4.c
@@ -33,12 +33,17 @@ void ipv4_parse(const uint8_t *buf, size_t len, struct ethernet ether) {
.src = nget32(buf + SrcIP),
.dst = nget32(buf + DstIP),
.proto = buf[Proto],
+ .header = buf,
+ .hlen = headerlen,
};
switch (ip.proto) {
- case 1:
+ case 0x01:
icmp_parse(buf + headerlen, packetlen - headerlen, ip);
break;
+ case 0x11:
+ udp_parse(buf + headerlen, packetlen - headerlen, ip);
+ break;
}
}