summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_pcb.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-02-27 12:37:50 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-02-27 12:37:50 +0000
commitb6facfc99a2c5258f20a34f2f2bbdf637e9d114b (patch)
treec2be3d4baa6052554ed31eab32212a865d1906c6 /sys/netinet6/in6_pcb.c
parent4ceba286234c0960805961aba43f9187666a243f (diff)
Combine route_cache() and rtalloc_mpath() in new route_mpath().
Fill and check the cache and call rtalloc_mpath() together. Then the caller of route_mpath() does not have to care about the uint32_t *src pointer and just pass struct in_addr. All the conversions are done inside the functions. ro->ro_rt is either valid or NULL. Note that some places have a stricter rtisvalid() now compared to the previous NULL check. OK claudio@
Diffstat (limited to 'sys/netinet6/in6_pcb.c')
-rw-r--r--sys/netinet6/in6_pcb.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index cea4415c17d..c678bbf5696 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_pcb.c,v 1.139 2024/02/22 14:25:58 bluhm Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.140 2024/02/27 12:37:49 bluhm Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -561,16 +561,10 @@ in6_pcbnotify(struct inpcbtable *table, const struct sockaddr_in6 *dst,
struct rtentry *
in6_pcbrtentry(struct inpcb *inp)
{
- struct route *ro = &inp->inp_route;
-
if (IN6_IS_ADDR_UNSPECIFIED(&inp->inp_faddr6))
return (NULL);
- if (route6_cache(ro, &inp->inp_faddr6, &inp->inp_laddr6,
- inp->inp_rtableid)) {
- ro->ro_rt = rtalloc_mpath(&ro->ro_dstsa,
- &inp->inp_laddr6.s6_addr32[0], ro->ro_tableid);
- }
- return (ro->ro_rt);
+ return (route6_mpath(&inp->inp_route, &inp->inp_faddr6,
+ &inp->inp_laddr6, inp->inp_rtableid));
}
struct inpcb *