sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-13 19:37:16 +00:00
parent c151d49b7a
commit be76e7e421
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
96 changed files with 2153 additions and 617 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: route.c,v 1.431 2024/02/09 14:02:11 bluhm Exp $ */
/* $OpenBSD: route.c,v 1.432 2024/02/13 12:22:09 bluhm Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@ -212,8 +212,8 @@ route_cache(struct route *ro, struct in_addr addr, u_int rtableid)
if (rtisvalid(ro->ro_rt) &&
ro->ro_generation == gen &&
ro->ro_tableid == rtableid &&
ro->ro_dst.sa_family == AF_INET &&
satosin(&ro->ro_dst)->sin_addr.s_addr == addr.s_addr) {
ro->ro_dstsa.sa_family == AF_INET &&
ro->ro_dstsin.sin_addr.s_addr == addr.s_addr) {
ipstat_inc(ips_rtcachehit);
return (0);
}
@ -225,17 +225,16 @@ route_cache(struct route *ro, struct in_addr addr, u_int rtableid)
ro->ro_tableid = rtableid;
memset(&ro->ro_dst, 0, sizeof(ro->ro_dst));
satosin(&ro->ro_dst)->sin_family = AF_INET;
satosin(&ro->ro_dst)->sin_len = sizeof(struct sockaddr_in);
satosin(&ro->ro_dst)->sin_addr = addr;
ro->ro_dstsin.sin_family = AF_INET;
ro->ro_dstsin.sin_len = sizeof(struct sockaddr_in);
ro->ro_dstsin.sin_addr = addr;
return (ESRCH);
}
#ifdef INET6
int
route6_cache(struct route_in6 *ro, const struct in6_addr *addr,
u_int rtableid)
route6_cache(struct route *ro, const struct in6_addr *addr, u_int rtableid)
{
u_long gen;
@ -245,8 +244,8 @@ route6_cache(struct route_in6 *ro, const struct in6_addr *addr,
if (rtisvalid(ro->ro_rt) &&
ro->ro_generation == gen &&
ro->ro_tableid == rtableid &&
ro->ro_dst.sin6_family == AF_INET6 &&
IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, addr)) {
ro->ro_dstsa.sa_family == AF_INET6 &&
IN6_ARE_ADDR_EQUAL(&ro->ro_dstsin6.sin6_addr, addr)) {
ip6stat_inc(ip6s_rtcachehit);
return (0);
}
@ -258,9 +257,9 @@ route6_cache(struct route_in6 *ro, const struct in6_addr *addr,
ro->ro_tableid = rtableid;
memset(&ro->ro_dst, 0, sizeof(ro->ro_dst));
ro->ro_dst.sin6_family = AF_INET6;
ro->ro_dst.sin6_len = sizeof(struct sockaddr_in6);
ro->ro_dst.sin6_addr = *addr;
ro->ro_dstsin6.sin6_family = AF_INET6;
ro->ro_dstsin6.sin6_len = sizeof(struct sockaddr_in6);
ro->ro_dstsin6.sin6_addr = *addr;
return (ESRCH);
}