pathmtu/pathmtu.c: Check against UDP header length, not pointer size.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 14 Sep 2017 12:25:12 +0000 (13:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 28 Jun 2018 23:26:39 +0000 (00:26 +0100)
pathmtu/pathmtu.c

index 5570278..4e8f568 100644 (file)
@@ -616,7 +616,7 @@ static int raw_selproc(void *stv, fd_set *fd_in, struct probestate *ps)
     n -= sizeof(*ip);
 
     udp = (struct udphdr *)(ip + 1);
-    if (n < sizeof(udp) || udp->uh_sport != st->me.sin.sin_port ||
+    if (n < sizeof(*udp) || udp->uh_sport != st->me.sin.sin_port ||
        udp->uh_dport != st->a.sin.sin_port)
       goto skip_icmp;
     n -= sizeof(*udp);