-/* $OpenBSD: frontend.c,v 1.68 2021/02/06 18:01:02 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.69 2021/11/16 16:45:23 kn Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
break;
rtdns = (struct sockaddr_rtdns*)rti_info[RTAX_DNS];
- switch (rtdns->sr_family) {
- case AF_INET:
- if ((rtdns->sr_len - 2) % sizeof(struct in_addr) != 0) {
- log_warnx("ignoring invalid RTM_PROPOSAL");
- return;
- }
- break;
- case AF_INET6:
- if ((rtdns->sr_len - 2) % sizeof(struct in6_addr) != 0) {
- log_warnx("ignoring invalid RTM_PROPOSAL");
- return;
- }
- break;
- default:
- log_warnx("ignoring invalid RTM_PROPOSAL");
- return;
- }
rdns_proposal.if_index = rtm->rtm_index;
rdns_proposal.src = rtm->rtm_priority;
memcpy(&rdns_proposal.rtdns, rtdns, sizeof(rdns_proposal.rtdns));
-/* $OpenBSD: resolver.c,v 1.152 2021/11/16 16:37:52 kn Exp $ */
+/* $OpenBSD: resolver.c,v 1.153 2021/11/16 16:45:23 kn Exp $ */
+
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
return;
}
+ if ((rdns_proposal->rtdns.sr_len - 2) % addrsz != 0) {
+ log_warnx("ignoring invalid RTM_PROPOSAL");
+ return;
+ }
rdns_count = (rdns_proposal->rtdns.sr_len -
offsetof(struct sockaddr_rtdns, sr_dns)) / addrsz;