struct nd6_prproxy_prelist {
SLIST_ENTRY(nd6_prproxy_prelist) ndprl_le;
- struct nd_prefix *ndprl_pr; /* prefix */
- struct nd_prefix *ndprl_up; /* non-NULL for upstream */
- struct ifnet *ndprl_fwd_ifp; /* outgoing interface */
- boolean_t ndprl_sol; /* unicast solicitor? */
- struct in6_addr ndprl_sol_saddr; /* solicitor's address */
+ struct nd_prefix *ndprl_pr; /* prefix */
+ struct nd_prefix *ndprl_up; /* non-NULL for upstream */
+ struct ifnet *ndprl_fwd_ifp; /* outgoing interface */
+ boolean_t ndprl_sol; /* unicast solicitor? */
+ struct in6_addr ndprl_sol_saddr; /* solicitor's address */
};
/*
*/
struct nd6_prproxy_solsrc {
TAILQ_ENTRY(nd6_prproxy_solsrc) solsrc_tqe;
- struct in6_addr solsrc_saddr; /* soliciting (src) address */
- struct ifnet *solsrc_ifp; /* iface where NS arrived on */
+ struct in6_addr solsrc_saddr; /* soliciting (src) address */
+ struct ifnet *solsrc_ifp; /* iface where NS arrived on */
};
/*
struct nd6_prproxy_soltgt {
RB_ENTRY(nd6_prproxy_soltgt) soltgt_link; /* RB tree links */
struct soltgt_key_s {
- struct in6_addr taddr; /* solicited (tgt) address */
+ struct in6_addr taddr; /* solicited (tgt) address */
} soltgt_key;
- u_int64_t soltgt_expire; /* expiration time */
- u_int32_t soltgt_cnt; /* total # of solicitors */
+ u_int64_t soltgt_expire; /* expiration time */
+ u_int32_t soltgt_cnt; /* total # of solicitors */
TAILQ_HEAD(, nd6_prproxy_solsrc) soltgt_q;
};
/*
* Time (in seconds) before a target record expires (is idle).
*/
-#define ND6_TGT_SOLS_EXPIRE 5
+#define ND6_TGT_SOLS_EXPIRE 5
/*
* Maximum number of queued soliciting (source) records per target.
*/
-#define ND6_MAX_SRC_SOLS_DEFAULT 4
+#define ND6_MAX_SRC_SOLS_DEFAULT 4
/*
* Maximum number of queued solicited (target) records per prefix.
*/
-#define ND6_MAX_TGT_SOLS_DEFAULT 8
+#define ND6_MAX_TGT_SOLS_DEFAULT 8
static u_int32_t nd6_max_tgt_sols = ND6_MAX_TGT_SOLS_DEFAULT;
static u_int32_t nd6_max_src_sols = ND6_MAX_SRC_SOLS_DEFAULT;
-static unsigned int ndprl_size; /* size of zone element */
-static struct zone *ndprl_zone; /* nd6_prproxy_prelist zone */
+static unsigned int ndprl_size; /* size of zone element */
+static struct zone *ndprl_zone; /* nd6_prproxy_prelist zone */
-#define NDPRL_ZONE_MAX 256 /* maximum elements in zone */
-#define NDPRL_ZONE_NAME "nd6_prproxy_prelist" /* name for zone */
+#define NDPRL_ZONE_MAX 256 /* maximum elements in zone */
+#define NDPRL_ZONE_NAME "nd6_prproxy_prelist" /* name for zone */
-static unsigned int solsrc_size; /* size of zone element */
-static struct zone *solsrc_zone; /* nd6_prproxy_solsrc zone */
+static unsigned int solsrc_size; /* size of zone element */
+static struct zone *solsrc_zone; /* nd6_prproxy_solsrc zone */
-#define SOLSRC_ZONE_MAX 256 /* maximum elements in zone */
-#define SOLSRC_ZONE_NAME "nd6_prproxy_solsrc" /* name for zone */
+#define SOLSRC_ZONE_MAX 256 /* maximum elements in zone */
+#define SOLSRC_ZONE_NAME "nd6_prproxy_solsrc" /* name for zone */
-static unsigned int soltgt_size; /* size of zone element */
-static struct zone *soltgt_zone; /* nd6_prproxy_soltgt zone */
+static unsigned int soltgt_size; /* size of zone element */
+static struct zone *soltgt_zone; /* nd6_prproxy_soltgt zone */
-#define SOLTGT_ZONE_MAX 256 /* maximum elements in zone */
-#define SOLTGT_ZONE_NAME "nd6_prproxy_soltgt" /* name for zone */
+#define SOLTGT_ZONE_MAX 256 /* maximum elements in zone */
+#define SOLTGT_ZONE_NAME "nd6_prproxy_soltgt" /* name for zone */
/* The following is protected by ndpr_lock */
RB_GENERATE_PREV(prproxy_sols_tree, nd6_prproxy_soltgt,
void
nd6_prproxy_init(void)
{
- ndprl_size = sizeof (struct nd6_prproxy_prelist);
+ ndprl_size = sizeof(struct nd6_prproxy_prelist);
ndprl_zone = zinit(ndprl_size, NDPRL_ZONE_MAX * ndprl_size, 0,
NDPRL_ZONE_NAME);
- if (ndprl_zone == NULL)
+ if (ndprl_zone == NULL) {
panic("%s: failed allocating ndprl_zone", __func__);
+ }
zone_change(ndprl_zone, Z_EXPAND, TRUE);
zone_change(ndprl_zone, Z_CALLERACCT, FALSE);
- solsrc_size = sizeof (struct nd6_prproxy_solsrc);
+ solsrc_size = sizeof(struct nd6_prproxy_solsrc);
solsrc_zone = zinit(solsrc_size, SOLSRC_ZONE_MAX * solsrc_size, 0,
SOLSRC_ZONE_NAME);
- if (solsrc_zone == NULL)
+ if (solsrc_zone == NULL) {
panic("%s: failed allocating solsrc_zone", __func__);
+ }
zone_change(solsrc_zone, Z_EXPAND, TRUE);
zone_change(solsrc_zone, Z_CALLERACCT, FALSE);
- soltgt_size = sizeof (struct nd6_prproxy_soltgt);
+ soltgt_size = sizeof(struct nd6_prproxy_soltgt);
soltgt_zone = zinit(soltgt_size, SOLTGT_ZONE_MAX * soltgt_size, 0,
SOLTGT_ZONE_NAME);
- if (soltgt_zone == NULL)
+ if (soltgt_zone == NULL) {
panic("%s: failed allocating soltgt_zone", __func__);
+ }
zone_change(soltgt_zone, Z_EXPAND, TRUE);
zone_change(soltgt_zone, Z_CALLERACCT, FALSE);
ndprl = (how == M_WAITOK) ? zalloc(ndprl_zone) :
zalloc_noblock(ndprl_zone);
- if (ndprl != NULL)
+ if (ndprl != NULL) {
bzero(ndprl, ndprl_size);
+ }
- return (ndprl);
+ return ndprl;
}
static void
* Apply routing function on the affected upstream and downstream prefixes,
* i.e. either set or clear RTF_PROXY on the cloning prefix route; all route
* entries that were cloned off these prefixes will be blown away. Caller
- * must have acquried proxy6_lock and must not be holding nd6_mutex.
+ * must have acquired proxy6_lock and must not be holding nd6_mutex.
*/
static void
nd6_prproxy_prelist_setroute(boolean_t enable,
}
if ((rt = pr->ndpr_rt) != NULL) {
- if ((enable && prproxy) || (!enable && !prproxy))
+ if ((enable && prproxy) || (!enable && !prproxy)) {
RT_ADDREF(rt);
- else
+ } else {
rt = NULL;
+ }
NDPR_UNLOCK(pr);
} else {
NDPR_UNLOCK(pr);
}
- /* Call the following ioctl after releasing NDPR lock */
- if (set_allmulti && ifp != NULL)
+ /* Call the following ioctl after releasing NDPR lock */
+ if (set_allmulti && ifp != NULL) {
if_allmulti(ifp, allmulti_sw);
+ }
+
-
NDPR_REMREF(pr);
if (rt != NULL) {
rt_set_proxy(rt, enable);
}
if ((rt = pr->ndpr_rt) != NULL) {
- if ((enable && prproxy) || (!enable && !prproxy))
+ if ((enable && prproxy) || (!enable && !prproxy)) {
RT_ADDREF(rt);
- else
+ } else {
rt = NULL;
+ }
NDPR_UNLOCK(pr);
} else {
NDPR_UNLOCK(pr);
}
- if (set_allmulti && ifp != NULL)
+ if (set_allmulti && ifp != NULL) {
if_allmulti(ifp, allmulti_sw);
+ }
NDPR_REMREF(pr);
NDPR_REMREF(pr_up);
ifnet_lock_shared(ifp);
if (enable && (ifp->if_eflags & IFEF_IPV6_ROUTER)) {
ifnet_lock_done(ifp);
- return (EBUSY);
+ return EBUSY;
}
ifnet_lock_done(ifp);
NDPR_UNLOCK(pr);
} else {
NDPR_UNLOCK(pr);
- pr = NULL; /* don't go further */
+ pr = NULL; /* don't go further */
}
- if (pr == NULL)
+ if (pr == NULL) {
break;
+ }
up = nd6_ndprl_alloc(M_WAITOK);
if (up == NULL) {
continue;
}
- up->ndprl_pr = pr; /* keep reference from above */
+ up->ndprl_pr = pr; /* keep reference from above */
SLIST_INSERT_HEAD(&up_head, up, ndprl_le);
}
pr = up->ndprl_pr;
NDPR_LOCK(pr);
- bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof (pr_addr));
+ bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof(pr_addr));
pr_len = pr->ndpr_plen;
NDPR_UNLOCK(pr);
NDPR_UNLOCK(fwd);
down = nd6_ndprl_alloc(M_WAITOK);
- if (down == NULL)
+ if (down == NULL) {
continue;
+ }
NDPR_ADDREF(fwd);
down->ndprl_pr = fwd;
lck_mtx_unlock(&proxy6_lock);
- return (0);
+ return 0;
}
/*
struct rtentry *rt;
boolean_t ours = FALSE;
- if (ip6->ip6_hlim != IPV6_MAXHLIM || ip6->ip6_nxt != IPPROTO_ICMPV6)
+ if (ip6->ip6_hlim != IPV6_MAXHLIM || ip6->ip6_nxt != IPPROTO_ICMPV6) {
goto done;
+ }
if (IN6_IS_ADDR_MC_NODELOCAL(&ip6->ip6_dst) ||
IN6_IS_ADDR_MC_LINKLOCAL(&ip6->ip6_dst)) {
goto done;
}
- if (ro6 == NULL)
+ if (ro6 == NULL) {
goto done;
+ }
- if ((rt = ro6->ro_rt) != NULL)
+ if ((rt = ro6->ro_rt) != NULL) {
RT_LOCK(rt);
+ }
if (ROUTE_UNUSABLE(ro6)) {
- if (rt != NULL)
+ if (rt != NULL) {
RT_UNLOCK(rt);
+ }
ROUTE_RELEASE(ro6);
&ro6->ro_dst.sin6_addr));
rtalloc_scoped_ign((struct route *)ro6, RTF_PRCLONING, ifscope);
- if ((rt = ro6->ro_rt) == NULL)
+ if ((rt = ro6->ro_rt) == NULL) {
goto done;
+ }
RT_LOCK(rt);
}
RT_UNLOCK(rt);
done:
- if (ours)
+ if (ours) {
m->m_pkthdr.pkt_flags |= PKTF_PROXY_DST;
+ }
- return (ours);
+ return ours;
}
/*
if ((rt = ro6->ro_rt) != NULL) {
RT_LOCK(rt);
if (!(rt->rt_flags & RTF_PROXY) || rt->rt_ifp == ifp) {
- nd6log2((LOG_DEBUG, "%s: found incorrect prefix "
+ nd6log2(debug, "%s: found incorrect prefix "
"proxy route for dst %s on %s\n", if_name(ifp),
ip6_sprintf(dst6),
- if_name(rt->rt_ifp)));
+ if_name(rt->rt_ifp));
RT_UNLOCK(rt);
/* look it up below */
} else {
}
VERIFY(!(pr->ndpr_stateflags & NDPRF_IFSCOPE));
- bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof (pr_addr));
+ bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof(pr_addr));
pr_len = pr->ndpr_plen;
NDPR_UNLOCK(pr);
rtfree_locked(rt);
rt = NULL;
} else {
- nd6log2((LOG_DEBUG, "%s: found prefix proxy route "
+ nd6log2(debug, "%s: found prefix proxy route "
"for dst %s\n", if_name(rt->rt_ifp),
- ip6_sprintf(dst6)));
+ ip6_sprintf(dst6));
RT_UNLOCK(rt);
- ro6->ro_rt = rt; /* refcnt held by rtalloc1 */
+ ro6->ro_rt = rt; /* refcnt held by rtalloc1 */
lck_mtx_unlock(rnh_lock);
return;
}
rtfree_locked(rt);
rt = NULL;
} else {
- nd6log2((LOG_DEBUG, "%s: allocated prefix proxy "
+ nd6log2(debug, "%s: allocated prefix proxy "
"route for dst %s\n", if_name(rt->rt_ifp),
- ip6_sprintf(dst6)));
+ ip6_sprintf(dst6));
RT_UNLOCK(rt);
- ro6->ro_rt = rt; /* refcnt held by rtalloc1 */
+ ro6->ro_rt = rt; /* refcnt held by rtalloc1 */
}
}
VERIFY(rt != NULL || ro6->ro_rt == NULL);
if (fwd_ifp == NULL || rt == NULL) {
- nd6log2((LOG_ERR, "%s: failed to find forwarding prefix "
+ nd6log2(error, "%s: failed to find forwarding prefix "
"proxy entry for dst %s\n", if_name(ifp),
- ip6_sprintf(dst6)));
+ ip6_sprintf(dst6));
}
lck_mtx_unlock(rnh_lock);
}
if (pr_up == NULL) {
NDPR_LOCK(pr_cur);
bcopy(&pr_cur->ndpr_prefix.sin6_addr, &pr_addr,
- sizeof (pr_addr));
+ sizeof(pr_addr));
pr_len = pr_cur->ndpr_plen;
NDPR_UNLOCK(pr_cur);
} else {
NDPR_LOCK(pr_up);
bcopy(&pr_up->ndpr_prefix.sin6_addr, &pr_addr,
- sizeof (pr_addr));
+ sizeof(pr_addr));
pr_len = pr_up->ndpr_plen;
}
NDPR_LOCK_ASSERT_HELD(pr_up);
NDPR_UNLOCK(pr);
down = nd6_ndprl_alloc(M_WAITOK);
- if (down == NULL)
+ if (down == NULL) {
continue;
+ }
NDPR_ADDREF(pr);
down->ndprl_pr = pr;
LCK_MTX_ASSERT(nd6_mutex, LCK_MTX_ASSERT_NOTOWNED);
IFA_LOCK(&ia->ia_ifa);
- bcopy(&ia->ia_addr.sin6_addr, &addr, sizeof (addr));
- bcopy(&ia->ia_prefixmask.sin6_addr, &pr_mask, sizeof (pr_mask));
+ bcopy(&ia->ia_addr.sin6_addr, &addr, sizeof(addr));
+ bcopy(&ia->ia_prefixmask.sin6_addr, &pr_mask, sizeof(pr_mask));
pr_len = ia->ia_plen;
IFA_UNLOCK(&ia->ia_ifa);
}
lck_mtx_unlock(nd6_mutex);
- return (proxied);
+ return proxied;
}
/*
* Ignore excluded interface if it's the same as the original;
* we always send a NS on the original interface down below.
*/
- if (exclifp != NULL && exclifp == ifp)
+ if (exclifp != NULL && exclifp == ifp) {
exclifp = NULL;
+ }
- if (exclifp == NULL)
- nd6log2((LOG_DEBUG, "%s: sending NS who has %s on ALL\n",
- if_name(ifp), ip6_sprintf(taddr)));
- else
- nd6log2((LOG_DEBUG, "%s: sending NS who has %s on ALL "
+ if (exclifp == NULL) {
+ nd6log2(debug, "%s: sending NS who has %s on ALL\n",
+ if_name(ifp), ip6_sprintf(taddr));
+ } else {
+ nd6log2(debug, "%s: sending NS who has %s on ALL "
"(except %s)\n", if_name(ifp),
- ip6_sprintf(taddr), if_name(exclifp)));
+ ip6_sprintf(taddr), if_name(exclifp));
+ }
SLIST_INIT(&ndprl_head);
}
VERIFY(!(pr->ndpr_stateflags & NDPRF_IFSCOPE));
- bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof (pr_addr));
+ bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof(pr_addr));
pr_len = pr->ndpr_plen;
NDPR_UNLOCK(pr);
NDPR_UNLOCK(fwd);
ndprl = nd6_ndprl_alloc(M_WAITOK);
- if (ndprl == NULL)
+ if (ndprl == NULL) {
continue;
+ }
NDPR_ADDREF(fwd);
ndprl->ndprl_pr = fwd;
NDPR_LOCK(pr);
if (pr->ndpr_stateflags & NDPRF_ONLINK) {
NDPR_UNLOCK(pr);
- nd6log2((LOG_DEBUG,
+ nd6log2(debug,
"%s: Sending cloned NS who has %s, originally "
"on %s\n", if_name(fwd_ifp),
- ip6_sprintf(taddr), if_name(ifp)));
+ ip6_sprintf(taddr), if_name(ifp));
nd6_ns_output(fwd_ifp, daddr, taddr, NULL, NULL);
} else {
}
VERIFY(!(pr->ndpr_stateflags & NDPRF_IFSCOPE));
- bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof (pr_addr));
+ bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr, sizeof(pr_addr));
pr_len = pr->ndpr_plen;
/*
!nd6_solsrc_enq(pr, ifp, saddr, taddr)) {
NDPR_UNLOCK(pr);
solrec = FALSE;
- break; /* bail out */
+ break; /* bail out */
} else {
NDPR_UNLOCK(pr);
}
NDPR_UNLOCK(fwd);
ndprl = nd6_ndprl_alloc(M_WAITOK);
- if (ndprl == NULL)
+ if (ndprl == NULL) {
continue;
+ }
NDPR_ADDREF(fwd);
ndprl->ndprl_pr = fwd;
NDPR_LOCK(pr);
if (pr->ndpr_stateflags & NDPRF_ONLINK) {
NDPR_UNLOCK(pr);
- nd6log2((LOG_DEBUG,
+ nd6log2(debug,
"%s: Forwarding NS (%s) from %s to %s who "
"has %s, originally on %s\n", if_name(fwd_ifp),
ndprl->ndprl_sol ? "NUD/AR" :
"DAD", ip6_sprintf(saddr), ip6_sprintf(daddr),
- ip6_sprintf(taddr), if_name(ifp)));
+ ip6_sprintf(taddr), if_name(ifp));
nd6_ns_output(fwd_ifp, ndprl->ndprl_sol ? taddr : NULL,
taddr, NULL, nonce);
*/
if (!IN6_IS_ADDR_MULTICAST(daddr0)) {
fwd_ifp = NULL;
- bzero(&daddr, sizeof (daddr));
+ bzero(&daddr, sizeof(daddr));
if (!nd6_solsrc_deq(pr, taddr, &daddr, &fwd_ifp)) {
NDPR_UNLOCK(pr);
- break; /* bail out */
+ break; /* bail out */
}
VERIFY(!IN6_IS_ADDR_UNSPECIFIED(&daddr) && fwd_ifp);
NDPR_UNLOCK(pr);
ndprl = nd6_ndprl_alloc(M_WAITOK);
- if (ndprl == NULL)
- break; /* bail out */
-
+ if (ndprl == NULL) {
+ break; /* bail out */
+ }
ndprl->ndprl_fwd_ifp = fwd_ifp;
ndprl->ndprl_sol = TRUE;
ndprl->ndprl_sol_saddr = *(&daddr);
u_char pr_len;
bcopy(&pr->ndpr_prefix.sin6_addr, &pr_addr,
- sizeof (pr_addr));
+ sizeof(pr_addr));
pr_len = pr->ndpr_plen;
NDPR_UNLOCK(pr);
fwd->ndpr_ifp == ifp ||
fwd->ndpr_plen != pr_len ||
!in6_are_prefix_equal(
- &fwd->ndpr_prefix.sin6_addr,
- &pr_addr, pr_len)) {
+ &fwd->ndpr_prefix.sin6_addr,
+ &pr_addr, pr_len)) {
NDPR_UNLOCK(fwd);
continue;
}
NDPR_UNLOCK(fwd);
ndprl = nd6_ndprl_alloc(M_WAITOK);
- if (ndprl == NULL)
+ if (ndprl == NULL) {
continue;
+ }
NDPR_ADDREF(fwd);
ndprl->ndprl_pr = fwd;
if (send_na) {
if (!ndprl->ndprl_sol) {
- nd6log2((LOG_DEBUG,
+ nd6log2(debug,
"%s: Forwarding NA (DAD) from %s to %s "
"tgt is %s, originally on %s\n",
if_name(fwd_ifp),
ip6_sprintf(saddr), ip6_sprintf(&daddr),
- ip6_sprintf(taddr), if_name(ifp)));
+ ip6_sprintf(taddr), if_name(ifp));
} else {
- nd6log2((LOG_DEBUG,
+ nd6log2(debug,
"%s: Forwarding NA (NUD/AR) from %s to "
"%s (was %s) tgt is %s, originally on "
"%s\n", if_name(fwd_ifp),
ip6_sprintf(saddr),
ip6_sprintf(&daddr), ip6_sprintf(daddr0),
- ip6_sprintf(taddr), if_name(ifp)));
+ ip6_sprintf(taddr), if_name(ifp));
}
nd6_na_output(fwd_ifp, &daddr, taddr, flags, 1, NULL);
}
- if (pr != NULL)
+ if (pr != NULL) {
NDPR_REMREF(pr);
+ }
nd6_ndprl_free(ndprl);
}
ssrc = (how == M_WAITOK) ? zalloc(solsrc_zone) :
zalloc_noblock(solsrc_zone);
- if (ssrc != NULL)
+ if (ssrc != NULL) {
bzero(ssrc, solsrc_size);
+ }
- return (ssrc);
+ return ssrc;
}
static void
pr->ndpr_prproxy_sols_cnt--;
RB_REMOVE(prproxy_sols_tree, &pr->ndpr_prproxy_sols, soltgt);
nd6_soltgt_free(soltgt);
- if (pr->ndpr_prproxy_sols_cnt < max_stgt)
+ if (pr->ndpr_prproxy_sols_cnt < max_stgt) {
break;
+ }
}
}
NDPR_LOCK_ASSERT_HELD(pr);
VERIFY(!(pr->ndpr_stateflags & NDPRF_IFSCOPE));
- VERIFY((pr->ndpr_stateflags & (NDPRF_ONLINK|NDPRF_PRPROXY)) ==
- (NDPRF_ONLINK|NDPRF_PRPROXY));
+ VERIFY((pr->ndpr_stateflags & (NDPRF_ONLINK | NDPRF_PRPROXY)) ==
+ (NDPRF_ONLINK | NDPRF_PRPROXY));
VERIFY(!IN6_IS_ADDR_UNSPECIFIED(saddr));
ssrc = nd6_solsrc_alloc(M_WAITOK);
- if (ssrc == NULL)
- return (FALSE);
+ if (ssrc == NULL) {
+ return FALSE;
+ }
ssrc->solsrc_saddr = *saddr;
ssrc->solsrc_ifp = ifp;
- find.soltgt_key.taddr = *taddr; /* search key */
+ find.soltgt_key.taddr = *taddr; /* search key */
soltgt = RB_FIND(prproxy_sols_tree, &pr->ndpr_prproxy_sols, &find);
if (soltgt == NULL) {
soltgt = nd6_soltgt_alloc(M_WAITOK);
if (soltgt == NULL) {
nd6_solsrc_free(ssrc);
- return (FALSE);
+ return FALSE;
}
soltgt->soltgt_key.taddr = *taddr;
soltgt->soltgt_cnt++;
VERIFY(soltgt->soltgt_cnt != 0);
TAILQ_INSERT_TAIL(&soltgt->soltgt_q, ssrc, solsrc_tqe);
- if (soltgt->soltgt_cnt == 1)
+ if (soltgt->soltgt_cnt == 1) {
soltgt->soltgt_expire = net_uptime() + ND6_TGT_SOLS_EXPIRE;
+ }
- return (TRUE);
+ return TRUE;
}
/*
NDPR_LOCK_ASSERT_HELD(pr);
VERIFY(!(pr->ndpr_stateflags & NDPRF_IFSCOPE));
- VERIFY((pr->ndpr_stateflags & (NDPRF_ONLINK|NDPRF_PRPROXY)) ==
- (NDPRF_ONLINK|NDPRF_PRPROXY));
+ VERIFY((pr->ndpr_stateflags & (NDPRF_ONLINK | NDPRF_PRPROXY)) ==
+ (NDPRF_ONLINK | NDPRF_PRPROXY));
- bzero(daddr, sizeof (*daddr));
+ bzero(daddr, sizeof(*daddr));
*ifp = NULL;
- find.soltgt_key.taddr = *taddr; /* search key */
+ find.soltgt_key.taddr = *taddr; /* search key */
soltgt = RB_FIND(prproxy_sols_tree, &pr->ndpr_prproxy_sols, &find);
if (soltgt == NULL || soltgt->soltgt_cnt == 0) {
VERIFY(soltgt == NULL || TAILQ_EMPTY(&soltgt->soltgt_q));
- return (FALSE);
+ return FALSE;
}
VERIFY(soltgt->soltgt_cnt != 0);
*ifp = ssrc->solsrc_ifp;
nd6_solsrc_free(ssrc);
- return (TRUE);
+ return TRUE;
}
static struct nd6_prproxy_soltgt *
bzero(soltgt, soltgt_size);
TAILQ_INIT(&soltgt->soltgt_q);
}
- return (soltgt);
+ return soltgt;
}
static void
soltgt_cmp(const struct nd6_prproxy_soltgt *a,
const struct nd6_prproxy_soltgt *b)
{
- return (memcmp(&a->soltgt_key, &b->soltgt_key, sizeof (a->soltgt_key)));
+ return memcmp(&a->soltgt_key, &b->soltgt_key, sizeof(a->soltgt_key));
}