summaryrefslogtreecommitdiffstats
path: root/app/ntp.c
diff options
context:
space:
mode:
authorroot <root@lab.panaceas.james.local>2019-02-19 23:00:23 +0000
committerroot <root@lab.panaceas.james.local>2019-02-19 23:00:23 +0000
commit971cc458aea21832a20b1b087185659d8e9ec2b3 (patch)
treef0cf4843a1b71c5860392c17ccc86a963d53b4e3 /app/ntp.c
parent379b0ec3e5eacdde822966c84062bea41da7ae89 (diff)
downloadclock-971cc458aea21832a20b1b087185659d8e9ec2b3.tar.gz
clock-971cc458aea21832a20b1b087185659d8e9ec2b3.tar.bz2
clock-971cc458aea21832a20b1b087185659d8e9ec2b3.zip
fix offsets
Diffstat (limited to 'app/ntp.c')
-rw-r--r--app/ntp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/ntp.c b/app/ntp.c
index 2aa33e4..f8ca357 100644
--- a/app/ntp.c
+++ b/app/ntp.c
@@ -78,6 +78,11 @@ static void ntp_rx (void *arg, struct udp_pcb *s, struct pbuf *p, struct ip_addr
if (p->len < sizeof (ntp_packet_t)) break;
+ if (!pll_valid) break;
+
+ if (!time_known) break;
+
+
memcpy (&pkt, p->payload, sizeof (ntp_packet_t));
pbuf_realloc (p, sizeof (ntp_packet_t));