Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151314628
D24973.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D24973.diff
View Options
Index: head/sys/netinet6/ip6_output.c
===================================================================
--- head/sys/netinet6/ip6_output.c
+++ head/sys/netinet6/ip6_output.c
@@ -736,7 +736,7 @@
counter_u64_add(nh->nh_pksent, 1);
}
} else {
- struct nhop6_extended nh6;
+ struct nhop_object *nh;
struct in6_addr kdst;
uint32_t scopeid;
@@ -766,20 +766,19 @@
}
}
- error = fib6_lookup_nh_ext(fibnum, &kdst, scopeid, NHR_REF, 0,
- &nh6);
- if (error != 0) {
+ nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, 0);
+ if (nh == NULL) {
IP6STAT_INC(ip6s_noroute);
/* No ifp in6_ifstat_inc(ifp, ifs6_out_discard); */
error = EHOSTUNREACH;;
goto bad;
}
- ifp = nh6.nh_ifp;
- mtu = nh6.nh_mtu;
- dst->sin6_addr = nh6.nh_addr;
- ia = nh6.nh_ia;
- fib6_free_nh_ext(fibnum, &nh6);
+ ifp = nh->nh_ifp;
+ mtu = nh->nh_mtu;
+ ia = ifatoia6(nh->nh_ifa);
+ if (nh->nh_flags & NHF_GATEWAY)
+ dst->sin6_addr = nh->gw6_sa.sin6_addr;
nonh6lookup:
;
}
@@ -1449,23 +1448,22 @@
static int
ip6_getpmtu_ctl(u_int fibnum, const struct in6_addr *dst, u_long *mtup)
{
- struct nhop6_extended nh6;
+ struct epoch_tracker et;
+ struct nhop_object *nh;
struct in6_addr kdst;
uint32_t scopeid;
- struct ifnet *ifp;
- u_long mtu;
int error;
in6_splitscope(dst, &kdst, &scopeid);
- if (fib6_lookup_nh_ext(fibnum, &kdst, scopeid, NHR_REF, 0, &nh6) != 0)
- return (EHOSTUNREACH);
- ifp = nh6.nh_ifp;
- mtu = nh6.nh_mtu;
+ NET_EPOCH_ENTER(et);
+ nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, 0);
+ if (nh != NULL)
+ error = ip6_calcmtu(nh->nh_ifp, dst, nh->nh_mtu, mtup, NULL, 0);
+ else
+ error = EHOSTUNREACH;
+ NET_EPOCH_EXIT(et);
- error = ip6_calcmtu(ifp, dst, mtu, mtup, NULL, 0);
- fib6_free_nh_ext(fibnum, &nh6);
-
return (error);
}
@@ -1484,12 +1482,14 @@
struct ifnet *ifp, const struct in6_addr *dst, u_long *mtup,
int *alwaysfragp, u_int fibnum, u_int proto)
{
- struct nhop6_basic nh6;
+ struct nhop_object *nh;
struct in6_addr kdst;
uint32_t scopeid;
struct sockaddr_in6 *sa6_dst, sin6;
u_long mtu;
+ NET_EPOCH_ASSERT();
+
mtu = 0;
if (ro_pmtu == NULL || do_lookup) {
@@ -1512,9 +1512,9 @@
sa6_dst->sin6_addr = *dst;
in6_splitscope(dst, &kdst, &scopeid);
- if (fib6_lookup_nh_basic(fibnum, &kdst, scopeid, 0, 0,
- &nh6) == 0) {
- mtu = nh6.nh_mtu;
+ nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, 0);
+ if (nh != NULL) {
+ mtu = nh->nh_mtu;
if (ro_pmtu != NULL)
ro_pmtu->ro_mtu = mtu;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 1:09 PM (15 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31081252
Default Alt Text
D24973.diff (2 KB)
Attached To
Mode
D24973: Replace fib6_lookup_nh_<ext|basic> calls with fib6_lookup.
Attached
Detach File
Event Timeline
Log In to Comment