Page MenuHomeFreeBSD

D1998.diff
No OneTemporary

D1998.diff

Index: head/sys/netinet6/nd6_nbr.c
===================================================================
--- head/sys/netinet6/nd6_nbr.c
+++ head/sys/netinet6/nd6_nbr.c
@@ -95,6 +95,8 @@
static void nd6_dad_na_input(struct ifaddr *);
static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *,
const struct in6_addr *, u_long, int, struct sockaddr *, u_int);
+static void nd6_ns_output_fib(struct ifnet *, const struct in6_addr *,
+ const struct in6_addr *, struct llentry *, uint8_t *, u_int);
static VNET_DEFINE(int, dad_enhanced) = 1;
#define V_dad_enhanced VNET(dad_enhanced)
@@ -394,9 +396,10 @@
* nonce - If non-NULL, NS is used for duplicate address detection and
* the value (length is ND_OPT_NONCE_LEN) is used as a random nonce.
*/
-void
-nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6,
- const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce)
+static void
+nd6_ns_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6,
+ const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce,
+ u_int fibnum)
{
struct mbuf *m;
struct m_tag *mtag;
@@ -416,8 +419,9 @@
maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7;
if (max_linkhdr + maxlen >= MCLBYTES) {
#ifdef DIAGNOSTIC
- printf("nd6_ns_output: max_linkhdr + maxlen >= MCLBYTES "
- "(%d + %d > %d)\n", max_linkhdr, maxlen, MCLBYTES);
+ printf("%s: max_linkhdr + maxlen >= MCLBYTES "
+ "(%d + %d > %d)\n", __func__, max_linkhdr, maxlen,
+ MCLBYTES);
#endif
return;
}
@@ -428,6 +432,7 @@
m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return;
+ M_SETFIB(m, fibnum);
bzero(&ro, sizeof(ro));
@@ -521,9 +526,8 @@
NULL, &ro, NULL, &oifp, &src_in);
if (error) {
char ip6buf[INET6_ADDRSTRLEN];
- nd6log((LOG_DEBUG,
- "nd6_ns_output: source can't be "
- "determined: dst=%s, error=%d\n",
+ nd6log((LOG_DEBUG, "%s: source can't be "
+ "determined: dst=%s, error=%d\n", __func__,
ip6_sprintf(ip6buf, &dst_sa.sin6_addr),
error));
goto bad;
@@ -626,6 +630,15 @@
return;
}
+#ifndef BURN_BRIDGES
+void
+nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6,
+ const struct in6_addr *taddr6, struct llentry *ln, uint8_t *nonce)
+{
+
+ nd6_ns_output_fib(ifp, daddr6, taddr6, ln, nonce, RT_DEFAULT_FIB);
+}
+#endif
/*
* Neighbor advertisement input handling.
*

File Metadata

Mime Type
text/plain
Expires
Sat, May 16, 5:08 PM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33139413
Default Alt Text
D1998.diff (2 KB)

Event Timeline