svn commit: r358575 - head/sys/netinet6
Bjoern A. Zeeb
bz at FreeBSD.org
Tue Mar 3 13:48:13 UTC 2020
Author: bz
Date: Tue Mar 3 13:48:12 2020
New Revision: 358575
URL: https://svnweb.freebsd.org/changeset/base/358575
Log:
ip6: retire in6_selectroute_fib() as promised 8 years ago
In r231852 I added in6_selectroute_fib() as a compat function with the
fibnum as an extra argument compared to in6_selectroute() to keep the
KPI stable.
Way too late retire this function again and add the fib to in6_selectroute()
which also only has a single consumer now and was an orphan function before.
Modified:
head/sys/netinet6/in6_src.c
head/sys/netinet6/ip6_output.c
head/sys/netinet6/ip6_var.h
Modified: head/sys/netinet6/in6_src.c
==============================================================================
--- head/sys/netinet6/in6_src.c Tue Mar 3 13:25:08 2020 (r358574)
+++ head/sys/netinet6/in6_src.c Tue Mar 3 13:48:12 2020 (r358575)
@@ -640,10 +640,10 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_p
if (dstsock->sin6_addr.s6_addr32[0] == 0 &&
dstsock->sin6_addr.s6_addr32[1] == 0 &&
!IN6_IS_ADDR_LOOPBACK(&dstsock->sin6_addr)) {
- printf("in6_selectroute: strange destination %s\n",
+ printf("%s: strange destination %s\n", __func__,
ip6_sprintf(ip6buf, &dstsock->sin6_addr));
} else {
- printf("in6_selectroute: destination = %s%%%d\n",
+ printf("%s: destination = %s%%%d\n", __func__,
ip6_sprintf(ip6buf, &dstsock->sin6_addr),
dstsock->sin6_scope_id); /* for debug */
}
@@ -895,33 +895,16 @@ in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_
return (0);
}
-/*
- * Public wrapper function to selectroute().
- *
- * XXX-BZ in6_selectroute() should and will grow the FIB argument. The
- * in6_selectroute_fib() function is only there for backward compat on stable.
- */
+/* Public wrapper function to selectroute(). */
int
in6_selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
struct ip6_moptions *mopts, struct route_in6 *ro,
- struct ifnet **retifp, struct rtentry **retrt)
-{
-
- return (selectroute(dstsock, opts, mopts, ro, retifp,
- retrt, 0, RT_DEFAULT_FIB));
-}
-
-#ifndef BURN_BRIDGES
-int
-in6_selectroute_fib(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
- struct ip6_moptions *mopts, struct route_in6 *ro,
struct ifnet **retifp, struct rtentry **retrt, u_int fibnum)
{
return (selectroute(dstsock, opts, mopts, ro, retifp,
retrt, 0, fibnum));
}
-#endif
/*
* Default hop limit selection. The precedence is as follows:
Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c Tue Mar 3 13:25:08 2020 (r358574)
+++ head/sys/netinet6/ip6_output.c Tue Mar 3 13:48:12 2020 (r358575)
@@ -709,7 +709,7 @@ again:
dst_sa.sin6_len = sizeof(dst_sa);
dst_sa.sin6_addr = ip6->ip6_dst;
}
- error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp,
+ error = in6_selectroute(&dst_sa, opt, im6o, ro, &ifp,
&rt, fibnum);
if (error != 0) {
IP6STAT_INC(ip6s_noroute);
Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h Tue Mar 3 13:25:08 2020 (r358574)
+++ head/sys/netinet6/ip6_var.h Tue Mar 3 13:48:12 2020 (r358575)
@@ -416,10 +416,7 @@ int in6_selectsrc_addr(uint32_t, const struct in6_addr
uint32_t, struct ifnet *, struct in6_addr *, int *);
int in6_selectroute(struct sockaddr_in6 *, struct ip6_pktopts *,
struct ip6_moptions *, struct route_in6 *, struct ifnet **,
- struct rtentry **);
-int in6_selectroute_fib(struct sockaddr_in6 *, struct ip6_pktopts *,
- struct ip6_moptions *, struct route_in6 *, struct ifnet **,
- struct rtentry **, u_int);
+ struct rtentry **, u_int);
u_int32_t ip6_randomid(void);
u_int32_t ip6_randomflowlabel(void);
void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset);
More information about the svn-src-all
mailing list