Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177909114
D61957.1795560151.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61957.1795560151.diff
View Options
diff --git a/sys/net/route.h b/sys/net/route.h
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -377,8 +377,8 @@
* referenced: it is looked up without NHR_REF and is dropped without being
* released. This is for a route on the stack that is only used in one
* network epoch section, never for a route that is cached, such as the
- * route of a PCB. Only ip_output() honors the flag when it stores a
- * nexthop; ip6_output() does not.
+ * route of a PCB. ip_output() and ip6_output() honor the flag when they
+ * store a nexthop.
*/
#define RO_NHFREE(_ro) do { \
if ((_ro)->ro_nh != NULL) { \
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -658,7 +658,9 @@
paddr = &unscoped_addr;
} else
paddr = &dst->sin6_addr;
- ro->ro_nh = fib6_lookup(fibnum, paddr, scopeid, NHR_REF, flowid);
+ ro->ro_nh = fib6_lookup(fibnum, paddr, scopeid,
+ (ro->ro_flags & RT_NH_NOREF) != 0 ? NHR_NONE : NHR_REF,
+ flowid);
}
return (ro->ro_nh);
}
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -83,6 +83,7 @@
#include <sys/ucred.h>
#include <machine/in_cksum.h>
+#include <machine/stack.h>
#include <net/if.h>
#include <net/if_var.h>
@@ -429,6 +430,9 @@
uint32_t optvalid;
NET_EPOCH_ASSERT();
+ /* A route with RT_NH_NOREF must be on the stack, see route.h. */
+ MPASS(ro == NULL || (ro->ro_flags & RT_NH_NOREF) == 0 ||
+ kstack_contains(curthread, (vm_offset_t)ro, sizeof(*ro)));
if (inp != NULL) {
INP_LOCK_ASSERT(inp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 10:42 PM (17 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41967616
Default Alt Text
D61957.1795560151.diff (1 KB)
Attached To
Mode
D61957: netinet6: Honor RT_NH_NOREF in ip6_output()
Attached
Detach File
Event Timeline