From: John Crispin Date: Sat, 30 Aug 2014 11:17:02 +0000 (+0200) Subject: validate incoming interface X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=46e580b2eff6c60837bbbfd55e4a0178d0c9b10b;p=oweals%2Fmdnsd.git validate incoming interface Signed-off-by: John Crispin --- diff --git a/interface.c b/interface.c index 0d34e72..b875fd4 100644 --- a/interface.c +++ b/interface.c @@ -174,10 +174,10 @@ read_socket(struct uloop_fd *u, unsigned int events) else if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_PKTINFO) ifindex = ((struct in6_pktinfo *) c)->ipi6_ifindex; } - if (ifindex) + if (ifindex != iface->ifindex) + fprintf(stderr, "invalid iface index %d != %d\n", ifindex, iface->ifindex); + else dns_handle_packet(iface, buffer, len); - - printf("%d\n", ifindex); } static int