Clean up trailing whitespace
MFC after: 3 days
This commit is contained in:
parent
a22656f0b2
commit
b3b69d9980
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311711
@ -4,7 +4,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
@ -16,7 +16,7 @@
|
|||||||
* 3. Neither the name of the project nor the names of its contributors
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
@ -106,7 +106,7 @@ struct ifc { /* Configuration of an interface */
|
|||||||
};
|
};
|
||||||
TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head);
|
TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head);
|
||||||
|
|
||||||
struct ifac { /* Adddress associated to an interface */
|
struct ifac { /* Adddress associated to an interface */
|
||||||
TAILQ_ENTRY(ifac) ifac_next;
|
TAILQ_ENTRY(ifac) ifac_next;
|
||||||
|
|
||||||
struct ifc *ifac_ifc; /* back pointer */
|
struct ifc *ifac_ifc; /* back pointer */
|
||||||
@ -673,7 +673,7 @@ init(void)
|
|||||||
fatal("rip IPV6_PKTINFO");
|
fatal("rip IPV6_PKTINFO");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IPV6_RECVPKTINFO
|
#ifdef IPV6_RECVPKTINFO
|
||||||
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT,
|
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT,
|
||||||
@ -819,8 +819,8 @@ ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag)
|
|||||||
* Request from non-link local address is not
|
* Request from non-link local address is not
|
||||||
* a regular route6d update.
|
* a regular route6d update.
|
||||||
*/
|
*/
|
||||||
maxrte = (IFMINMTU - sizeof(struct ip6_hdr) -
|
maxrte = (IFMINMTU - sizeof(struct ip6_hdr) -
|
||||||
sizeof(struct udphdr) -
|
sizeof(struct udphdr) -
|
||||||
sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
||||||
sizeof(struct netinfo6);
|
sizeof(struct netinfo6);
|
||||||
nh = NULL;
|
nh = NULL;
|
||||||
@ -868,8 +868,8 @@ ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) -
|
maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) -
|
||||||
sizeof(struct udphdr) -
|
sizeof(struct udphdr) -
|
||||||
sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
||||||
sizeof(struct netinfo6);
|
sizeof(struct netinfo6);
|
||||||
|
|
||||||
@ -953,13 +953,13 @@ out_filter(struct riprt *rrt, struct ifc *ifcp)
|
|||||||
/*
|
/*
|
||||||
* -A: filter out less specific routes, if we have aggregated
|
* -A: filter out less specific routes, if we have aggregated
|
||||||
* route configured.
|
* route configured.
|
||||||
*/
|
*/
|
||||||
TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) {
|
TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) {
|
||||||
if (iffp->iff_type != 'A')
|
if (iffp->iff_type != 'A')
|
||||||
continue;
|
continue;
|
||||||
if (rrt->rrt_info.rip6_plen <= iffp->iff_plen)
|
if (rrt->rrt_info.rip6_plen <= iffp->iff_plen)
|
||||||
continue;
|
continue;
|
||||||
ia = rrt->rrt_info.rip6_dest;
|
ia = rrt->rrt_info.rip6_dest;
|
||||||
applyplen(&ia, iffp->iff_plen);
|
applyplen(&ia, iffp->iff_plen);
|
||||||
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr))
|
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr))
|
||||||
return 0;
|
return 0;
|
||||||
@ -995,7 +995,7 @@ out_filter(struct riprt *rrt, struct ifc *ifcp)
|
|||||||
continue;
|
continue;
|
||||||
if (rrt->rrt_info.rip6_plen < iffp->iff_plen)
|
if (rrt->rrt_info.rip6_plen < iffp->iff_plen)
|
||||||
continue;
|
continue;
|
||||||
ia = rrt->rrt_info.rip6_dest;
|
ia = rrt->rrt_info.rip6_dest;
|
||||||
applyplen(&ia, iffp->iff_plen);
|
applyplen(&ia, iffp->iff_plen);
|
||||||
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) {
|
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) {
|
||||||
ok = 1;
|
ok = 1;
|
||||||
@ -1195,8 +1195,8 @@ riprecv(void)
|
|||||||
} else {
|
} else {
|
||||||
riprequest(NULL, np, nn, &fsock);
|
riprequest(NULL, np, nn, &fsock);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) {
|
if (!IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) {
|
||||||
trace(1, "Response from non-ll addr: %s\n",
|
trace(1, "Response from non-ll addr: %s\n",
|
||||||
@ -1223,7 +1223,7 @@ riprecv(void)
|
|||||||
* source address to be forwarded to a different link.
|
* source address to be forwarded to a different link.
|
||||||
* So we also check whether the destination address is a link-local
|
* So we also check whether the destination address is a link-local
|
||||||
* address or the hop limit is 255. Note that RFC2080 does not require
|
* address or the hop limit is 255. Note that RFC2080 does not require
|
||||||
* the specific hop limit for a unicast response, so we cannot assume
|
* the specific hop limit for a unicast response, so we cannot assume
|
||||||
* the limitation.
|
* the limitation.
|
||||||
*/
|
*/
|
||||||
if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) {
|
if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr) && *hlimp != 255) {
|
||||||
@ -1245,7 +1245,7 @@ riprecv(void)
|
|||||||
return; /* The packet is from me; ignore */
|
return; /* The packet is from me; ignore */
|
||||||
if (rp->rip6_cmd != RIP6_RESPONSE) {
|
if (rp->rip6_cmd != RIP6_RESPONSE) {
|
||||||
trace(1, "Invalid command %d\n", rp->rip6_cmd);
|
trace(1, "Invalid command %d\n", rp->rip6_cmd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -N: no use */
|
/* -N: no use */
|
||||||
@ -1323,7 +1323,7 @@ riprecv(void)
|
|||||||
/* special rule: ::/0 means default, not "in /0" */
|
/* special rule: ::/0 means default, not "in /0" */
|
||||||
if (iffp->iff_plen == 0 && np->rip6_plen > 0)
|
if (iffp->iff_plen == 0 && np->rip6_plen > 0)
|
||||||
continue;
|
continue;
|
||||||
ia = np->rip6_dest;
|
ia = np->rip6_dest;
|
||||||
applyplen(&ia, iffp->iff_plen);
|
applyplen(&ia, iffp->iff_plen);
|
||||||
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) {
|
if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) {
|
||||||
ok = 1;
|
ok = 1;
|
||||||
@ -1374,7 +1374,7 @@ riprecv(void)
|
|||||||
} else if (nq->rip6_metric == np->rip6_metric &&
|
} else if (nq->rip6_metric == np->rip6_metric &&
|
||||||
np->rip6_metric < HOPCNT_INFINITY6) {
|
np->rip6_metric < HOPCNT_INFINITY6) {
|
||||||
if (rrt->rrt_index == ifcp->ifc_index &&
|
if (rrt->rrt_index == ifcp->ifc_index &&
|
||||||
IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) {
|
IN6_ARE_ADDR_EQUAL(&nh, &rrt->rrt_gw)) {
|
||||||
/* same metric, same route from same gw */
|
/* same metric, same route from same gw */
|
||||||
rrt->rrt_t = t;
|
rrt->rrt_t = t;
|
||||||
} else if (rrt->rrt_t < t_half_lifetime) {
|
} else if (rrt->rrt_t < t_half_lifetime) {
|
||||||
@ -1389,7 +1389,7 @@ riprecv(void)
|
|||||||
rrt->rrt_t = t;
|
rrt->rrt_t = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* if nq->rip6_metric == HOPCNT_INFINITY6 then
|
* if nq->rip6_metric == HOPCNT_INFINITY6 then
|
||||||
* do not update age value. Do nothing.
|
* do not update age value. Do nothing.
|
||||||
*/
|
*/
|
||||||
@ -1667,7 +1667,7 @@ ifremove(int ifindex)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ifcp == NULL)
|
if (ifcp == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name);
|
tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name);
|
||||||
TAILQ_REMOVE(&ifc_head, ifcp, ifc_next);
|
TAILQ_REMOVE(&ifc_head, ifcp, ifc_next);
|
||||||
@ -1824,7 +1824,7 @@ rtrecv(void)
|
|||||||
#if 0
|
#if 0
|
||||||
if (rta[RTAX_DST] == NULL) {
|
if (rta[RTAX_DST] == NULL) {
|
||||||
trace(1, "\tno destination, ignored\n");
|
trace(1, "\tno destination, ignored\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (rta[RTAX_DST]->sin6_family != AF_INET6) {
|
if (rta[RTAX_DST]->sin6_family != AF_INET6) {
|
||||||
trace(1, "\taf mismatch, ignored\n");
|
trace(1, "\taf mismatch, ignored\n");
|
||||||
@ -3238,7 +3238,7 @@ filterconfig(void)
|
|||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
* When the address has already been registered in the
|
* When the address has already been registered in the
|
||||||
* kernel routing table, it should be removed
|
* kernel routing table, it should be removed
|
||||||
*/
|
*/
|
||||||
delroute(&rrt->rrt_info, &gw);
|
delroute(&rrt->rrt_info, &gw);
|
||||||
#else
|
#else
|
||||||
@ -3319,7 +3319,7 @@ mask2len(const struct in6_addr *addr, int lenlim)
|
|||||||
{
|
{
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
const u_char *p = (const u_char *)addr;
|
const u_char *p = (const u_char *)addr;
|
||||||
|
|
||||||
for (j = 0; j < lenlim; j++, p++) {
|
for (j = 0; j < lenlim; j++, p++) {
|
||||||
if (*p != 0xff)
|
if (*p != 0xff)
|
||||||
break;
|
break;
|
||||||
@ -3446,7 +3446,7 @@ ripsuptrig(void)
|
|||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
double r = rand();
|
double r = rand();
|
||||||
t = (int)(RIP_TRIG_INT6_MIN +
|
t = (int)(RIP_TRIG_INT6_MIN +
|
||||||
(RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX));
|
(RIP_TRIG_INT6_MAX - RIP_TRIG_INT6_MIN) * (r / RAND_MAX));
|
||||||
sup_trig_update = time(NULL) + t;
|
sup_trig_update = time(NULL) + t;
|
||||||
return t;
|
return t;
|
||||||
|
Loading…
Reference in New Issue
Block a user