summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet6/ip6_mroute.c126
-rw-r--r--sys/netinet6/ip6_mroute.h8
2 files changed, 68 insertions, 66 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 5717aca1281..21e5e7dd1fa 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ip6_mroute.c,v 1.9 2001/02/08 14:51:22 itojun Exp $ */
-/* $KAME: ip6_mroute.c,v 1.37 2001/02/08 10:57:00 itojun Exp $ */
+/* $OpenBSD: ip6_mroute.c,v 1.10 2001/02/16 08:12:29 itojun Exp $ */
+/* $KAME: ip6_mroute.c,v 1.39 2001/02/10 02:13:13 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -167,7 +167,7 @@ static int pim6;
*/
#define MF6CFIND(o, g, rt) do { \
- register struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
+ struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \
rt = NULL; \
mrt6stat.mrt6s_mfc_lookups++; \
while (_rt) { \
@@ -189,7 +189,7 @@ static int pim6;
* Borrowed from Van Jacobson's scheduling code
*/
#define TV_DELTA(a, b, delta) do { \
- register int xxs; \
+ int xxs; \
\
delta = (a).tv_usec - (b).tv_usec; \
if ((xxs = (a).tv_sec - (b).tv_sec)) { \
@@ -304,9 +304,9 @@ mrt6_ioctl(cmd, data)
*/
static int
get_sg_cnt(req)
- register struct sioc_sg_req6 *req;
+ struct sioc_sg_req6 *req;
{
- register struct mf6c *rt;
+ struct mf6c *rt;
int s;
s = splnet();
@@ -331,9 +331,9 @@ get_sg_cnt(req)
*/
static int
get_mif6_cnt(req)
- register struct sioc_mif_req6 *req;
+ struct sioc_mif_req6 *req;
{
- register mifi_t mifi = req->mifi;
+ mifi_t mifi = req->mifi;
if (mifi >= nummifs)
return EINVAL;
@@ -526,9 +526,9 @@ static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 };
*/
static int
add_m6if(mifcp)
- register struct mif6ctl *mifcp;
+ struct mif6ctl *mifcp;
{
- register struct mif6 *mifp;
+ struct mif6 *mifp;
struct ifnet *ifp;
struct in6_ifreq ifr;
int error, s;
@@ -614,8 +614,8 @@ static int
del_m6if(mifip)
mifi_t *mifip;
{
- register struct mif6 *mifp = mif6table + *mifip;
- register mifi_t mifi;
+ struct mif6 *mifp = mif6table + *mifip;
+ mifi_t mifi;
struct ifnet *ifp;
struct in6_ifreq ifr;
int s;
@@ -671,7 +671,7 @@ add_m6fc(mfccp)
struct mf6c *rt;
u_long hash;
struct rtdetq *rte;
- register u_short nstl;
+ u_short nstl;
int s;
MF6CFIND(mfccp->mf6cc_origin.sin6_addr,
@@ -823,11 +823,11 @@ add_m6fc(mfccp)
*/
static void
collate(t)
- register struct timeval *t;
+ struct timeval *t;
{
- register u_long d;
- register struct timeval tp;
- register u_long delta;
+ u_long d;
+ struct timeval tp;
+ u_long delta;
GET_TIME(tp);
@@ -926,13 +926,13 @@ socket_send(s, mm, src)
int
ip6_mforward(ip6, ifp, m)
- register struct ip6_hdr *ip6;
+ struct ip6_hdr *ip6;
struct ifnet *ifp;
struct mbuf *m;
{
- register struct mf6c *rt;
- register struct mif6 *mifp;
- register struct mbuf *mm;
+ struct mf6c *rt;
+ struct mif6 *mifp;
+ struct mbuf *mm;
int s;
mifi_t mifi;
long time_second = time.tv_sec;
@@ -992,10 +992,10 @@ ip6_mforward(ip6, ifp, m)
* send message to routing daemon
*/
- register struct mbuf *mb0;
- register struct rtdetq *rte;
- register u_long hash;
-/* register int i, npkts;*/
+ struct mbuf *mb0;
+ struct rtdetq *rte;
+ u_long hash;
+/* int i, npkts;*/
#ifdef UPCALL_TIMING
struct timeval tp;
@@ -1159,7 +1159,7 @@ ip6_mforward(ip6, ifp, m)
} else {
/* determine if q has overflowed */
struct rtdetq **p;
- register int npkts = 0;
+ int npkts = 0;
for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next)
if (++npkts > MAX_UPQ6) {
@@ -1252,19 +1252,19 @@ expire_upcalls(unused)
*/
static int
ip6_mdq(m, ifp, rt)
- register struct mbuf *m;
- register struct ifnet *ifp;
- register struct mf6c *rt;
+ struct mbuf *m;
+ struct ifnet *ifp;
+ struct mf6c *rt;
{
- register struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
- register mifi_t mifi, iif;
- register struct mif6 *mifp;
- register int plen = m->m_pkthdr.len;
+ struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
+ mifi_t mifi, iif;
+ struct mif6 *mifp;
+ int plen = m->m_pkthdr.len;
/*
* Macro to send packet on mif. Since RSVP packets don't get counted on
* input, they shouldn't get counted on output, so statistics keeping is
- * separate.
+ * seperate.
*/
#define MC6_SEND(ip6, mifp, m) do { \
@@ -1306,7 +1306,7 @@ ip6_mdq(m, ifp, rt)
static struct sockaddr_in6 sin6 =
{ sizeof(sin6), AF_INET6 };
- register struct mbuf *mm;
+ struct mbuf *mm;
struct mrt6msg *im;
#ifdef MRT6_OINIT
struct omrt6msg *oim;
@@ -1335,6 +1335,7 @@ ip6_mdq(m, ifp, rt)
case MRT6_INIT:
im = mtod(mm, struct mrt6msg *);
im->im6_msgtype = MRT6MSG_WRONGMIF;
+ im->im6_mbz = 0;
break;
default:
m_freem(mm);
@@ -1424,12 +1425,13 @@ phyint_send(ip6, mifp, m)
struct mif6 *mifp;
struct mbuf *m;
{
- register struct mbuf *mb_copy;
+ struct mbuf *mb_copy;
struct ifnet *ifp = mifp->m6_ifp;
int error = 0;
int s = splnet();
- static struct route_in6 ro6;
+ static struct route_in6 ro;
struct in6_multi *in6m;
+ struct sockaddr_in6 *dst6;
/*
* Make a new reference to the packet; make sure that
@@ -1459,7 +1461,7 @@ phyint_send(ip6, mifp, m)
/* XXX: ip6_output will override ip6->ip6_hlim */
im6o.im6o_multicast_hlim = ip6->ip6_hlim;
im6o.im6o_multicast_loop = 1;
- error = ip6_output(mb_copy, NULL, &ro6,
+ error = ip6_output(mb_copy, NULL, &ro,
IPV6_FORWARDING, &im6o, NULL);
#ifdef MRT6DEBUG
@@ -1475,28 +1477,28 @@ phyint_send(ip6, mifp, m)
* If we belong to the destination multicast group
* on the outgoing interface, loop back a copy.
*/
+ dst6 = (struct sockaddr_in6 *)&ro.ro_dst;
IN6_LOOKUP_MULTI(ip6->ip6_dst, ifp, in6m);
if (in6m != NULL) {
- ro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6);
- ro6.ro_dst.sin6_family = AF_INET6;
- ro6.ro_dst.sin6_addr = ip6->ip6_dst;
- ip6_mloopback(ifp, m, &ro6.ro_dst);
+ dst6->sin6_len = sizeof(struct sockaddr_in6);
+ dst6->sin6_family = AF_INET6;
+ dst6->sin6_addr = ip6->ip6_dst;
+ ip6_mloopback(ifp, m, (struct sockaddr_in6 *)&ro.ro_dst);
}
/*
* Put the packet into the sending queue of the outgoing interface
* if it would fit in the MTU of the interface.
*/
if (mb_copy->m_pkthdr.len < ifp->if_mtu || ifp->if_mtu < IPV6_MMTU) {
- ro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6);
- ro6.ro_dst.sin6_family = AF_INET6;
- ro6.ro_dst.sin6_addr = ip6->ip6_dst;
+ dst6->sin6_len = sizeof(struct sockaddr_in6);
+ dst6->sin6_family = AF_INET6;
+ dst6->sin6_addr = ip6->ip6_dst;
/*
* We just call if_output instead of nd6_output here, since
* we need no ND for a multicast forwarded packet...right?
*/
error = (*ifp->if_output)(ifp, mb_copy,
- (struct sockaddr *)&ro6.ro_dst,
- NULL);
+ (struct sockaddr *)&ro.ro_dst, NULL);
#ifdef MRT6DEBUG
if (mrt6debug & DEBUG_XMIT)
log(LOG_DEBUG, "phyint_send on mif %d err %d\n",
@@ -1526,12 +1528,12 @@ phyint_send(ip6, mifp, m)
static int
register_send(ip6, mif, m)
- register struct ip6_hdr *ip6;
+ struct ip6_hdr *ip6;
struct mif6 *mif;
- register struct mbuf *m;
+ struct mbuf *m;
{
- register struct mbuf *mm;
- register int i, len = m->m_pkthdr.len;
+ struct mbuf *mm;
+ int i, len = m->m_pkthdr.len;
static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 };
struct mrt6msg *im6;
@@ -1584,8 +1586,8 @@ register_send(ip6, mif, m)
log(LOG_WARNING,
"register_send: ip_mrouter socket queue full\n");
#endif
- ++mrt6stat.mrt6s_upq_sockfull;
- return ENOBUFS;
+ ++mrt6stat.mrt6s_upq_sockfull;
+ return ENOBUFS;
}
return 0;
}
@@ -1602,21 +1604,21 @@ pim6_input(mp, offp, proto)
struct mbuf **mp;
int *offp, proto;
{
- register struct pim *pim; /* pointer to a pim struct */
- register struct ip6_hdr *ip6;
- register int pimlen;
+ struct pim *pim; /* pointer to a pim struct */
+ struct ip6_hdr *ip6;
+ int pimlen;
struct mbuf *m = *mp;
- int minlen;
+ int minlen;
int off = *offp;
++pim6stat.pim6s_rcv_total;
- ip6 = mtod(m, struct ip6_hdr *);
- pimlen = m->m_pkthdr.len - *offp;
+ ip6 = mtod(m, struct ip6_hdr *);
+ pimlen = m->m_pkthdr.len - *offp;
- /*
- * Validate lengths
- */
+ /*
+ * Validate lengths
+ */
if (pimlen < PIM_MINLEN) {
++pim6stat.pim6s_rcv_tooshort;
#ifdef MRT6DEBUG
diff --git a/sys/netinet6/ip6_mroute.h b/sys/netinet6/ip6_mroute.h
index 11540439467..45b9c0018f6 100644
--- a/sys/netinet6/ip6_mroute.h
+++ b/sys/netinet6/ip6_mroute.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: ip6_mroute.h,v 1.3 2000/05/19 13:11:34 itojun Exp $ */
-/* $KAME: ip6_mroute.h,v 1.10 2000/05/19 02:38:53 itojun Exp $ */
+/* $OpenBSD: ip6_mroute.h,v 1.4 2001/02/16 08:12:30 itojun Exp $ */
+/* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -79,7 +79,7 @@ typedef u_short mifi_t; /* type of a mif index */
#define IF_SETSIZE 256
#endif
-typedef long if_mask;
+typedef u_int32_t if_mask;
#define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */
#ifndef howmany
@@ -87,7 +87,7 @@ typedef long if_mask;
#endif
typedef struct if_set {
- fd_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)];
+ if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)];
} if_set;
#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))