From 05d86ed530c05ba3f8648ffd7e67f4a593ae58d8 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 27 Sep 2018 11:03:00 +0200 Subject: ntp --- net/ipv4.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'net/ipv4.c') diff --git a/net/ipv4.c b/net/ipv4.c index f1d4043..78db274 100644 --- a/net/ipv4.c +++ b/net/ipv4.c @@ -3,11 +3,12 @@ #include "inet.h" #include "eth.h" #include "icmp.h" +#include "udp.h" bool ipv4_incoming(struct netdev *dev,struct eth_hdr *hdr) { struct ipv4_hdr *ipv4=hdr->payload; -// klog("ipv4 incoming with checksum: 0x%04X",ntohs(ipv4->csum)); + //klog("ipv4 incoming with checksum: 0x%04X",ntohs(ipv4->csum)); ipv4->csum=0; // klog("expected checksum: 0x%04X",checksum(ipv4,ntohs(ipv4->len))); // klog("ipv4 header len=%d",ipv4->ihl); @@ -16,6 +17,11 @@ bool ipv4_incoming(struct netdev *dev,struct eth_hdr *hdr) { icmp_incoming(dev,hdr); } + + if(ipv4->proto==IPV4_P_UDP) + { + udp_incoming(hdr,ipv4+1); + } return true; } -- cgit v1.2.3