summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-09-06 02:40:43 +0000
committerjlemon <jlemon@FreeBSD.org>2001-09-06 02:40:43 +0000
commitf729fe0a4a07f77cf2a60a88614a01b6bd649256 (patch)
treec9d6ec3dbd785e910055574e19a85daa63dc23d6 /sys/netinet6/ip6_output.c
parent32d9aeaf2d0cb3d17941506155a2e52a94e50550 (diff)
downloadFreeBSD-src-f729fe0a4a07f77cf2a60a88614a01b6bd649256.zip
FreeBSD-src-f729fe0a4a07f77cf2a60a88614a01b6bd649256.tar.gz
Wrap array accesses in macros, which also happen to be lvalues:
ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r--sys/netinet6/ip6_output.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index fbe8821..41b25b6c 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -613,7 +613,7 @@ skip_ipsec2:;
* Boundary check for ifindex is assumed to be already done.
*/
if (opt && opt->ip6po_pktinfo && opt->ip6po_pktinfo->ipi6_ifindex)
- ifp = ifindex2ifnet[opt->ip6po_pktinfo->ipi6_ifindex];
+ ifp = ifnet_byindex(opt->ip6po_pktinfo->ipi6_ifindex);
/*
* If the destination is a node-local scope multicast,
@@ -795,9 +795,9 @@ skip_ipsec2:;
*/
origifp = NULL;
if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src))
- origifp = ifindex2ifnet[ntohs(ip6->ip6_src.s6_addr16[1])];
+ origifp = ifnet_byindex(ntohs(ip6->ip6_src.s6_addr16[1]));
else if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst))
- origifp = ifindex2ifnet[ntohs(ip6->ip6_dst.s6_addr16[1])];
+ origifp = ifnet_byindex(ntohs(ip6->ip6_dst.s6_addr16[1]));
/*
* XXX: origifp can be NULL even in those two cases above.
* For example, if we remove the (only) link-local address
@@ -1929,7 +1929,7 @@ ip6_setmoptions(optname, im6op, m)
error = ENXIO; /* XXX EINVAL? */
break;
}
- ifp = ifindex2ifnet[ifindex];
+ ifp = ifnet_byindex(ifindex);
if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) {
error = EADDRNOTAVAIL;
break;
@@ -2038,7 +2038,7 @@ ip6_setmoptions(optname, im6op, m)
rtfree(ro.ro_rt);
}
} else
- ifp = ifindex2ifnet[mreq->ipv6mr_interface];
+ ifp = ifnet_byindex(mreq->ipv6mr_interface);
/*
* See if we found an interface, and confirm that it
@@ -2114,7 +2114,7 @@ ip6_setmoptions(optname, im6op, m)
error = ENXIO; /* XXX EINVAL? */
break;
}
- ifp = ifindex2ifnet[mreq->ipv6mr_interface];
+ ifp = ifnet_byindex(mreq->ipv6mr_interface);
/*
* Put interface index into the multicast address,
* if the address has link-local scope.
OpenPOWER on IntegriCloud