removed 'ifndef ADVAPI' parts

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2000-07-10 18:27:55 +00:00
parent 67205a5041
commit 6da1b6ebda
2 changed files with 5 additions and 33 deletions

View File

@ -4,7 +4,7 @@
PROG= route6d
MAN8= route6d.8
CFLAGS+= -Dss_len=__ss_len -Dss_family=__ss_family -DADVAPI -DINET6 \
CFLAGS+= -Dss_len=__ss_len -Dss_family=__ss_family -DINET6 \
-DHAVE_GETIFADDRS
.include <bsd.prog.mk>

View File

@ -57,9 +57,7 @@ static char _rcsid[] = "$KAME: route6d.c,v 1.30 2000/06/04 06:48:03 itojun Exp $
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
#ifdef ADVAPI
#include <sys/uio.h>
#endif
#include <net/if.h>
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
@ -516,10 +514,7 @@ ripalarm(sig)
void
init()
{
#ifdef ADVAPI
int i;
#endif
int int0, int255, error;
int i, int0, int255, error;
struct addrinfo hints, *res;
char port[10];
@ -551,7 +546,7 @@ init()
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
&int0, sizeof(int0)) < 0)
fatal("rip IPV6_MULTICAST_LOOP");
#ifdef ADVAPI
i = 1;
#ifdef IPV6_RECVPKTINFO
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &i,
@ -562,7 +557,6 @@ init()
sizeof(i)) < 0)
fatal("rip IPV6_PKTINFO");
#endif
#endif /*ADVAPI*/
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET6;
@ -831,7 +825,6 @@ sendpacket(sin, len)
* RIP6_REQUEST message. SO_DONTROUTE has been specified to
* other sockets.
*/
#ifdef ADVAPI
struct msghdr m;
struct cmsghdr *cm;
struct iovec iov[2];
@ -878,13 +871,7 @@ sendpacket(sin, len)
trace(1, "sendmsg: %s\n", strerror(errno));
return errno;
}
#else
if (sendto(ripsock, ripbuf, len, 0 /*MSG_DONTROUTE*/,
(struct sockaddr *)sin, sizeof(struct sockaddr_in6)) < 0) {
trace(1, "sendto: %s\n", strerror(errno));
return errno;
}
#endif
return 0;
}
@ -902,24 +889,19 @@ riprecv()
struct netinfo6 *np, *nq;
struct riprt *rrt;
int len, nn, need_trigger, index;
#ifndef ADVAPI
int flen;
#endif
char buf[4 * RIP6_MAXMTU];
time_t t;
#ifdef ADVAPI
struct msghdr m;
struct cmsghdr *cm;
struct iovec iov[2];
u_char cmsgbuf[256];
struct in6_pktinfo *pi;
#endif /*ADVAPI*/
struct iff *iffp;
struct in6_addr ia;
int ok;
need_trigger = 0;
#ifdef ADVAPI
m.msg_name = (caddr_t)&fsock;
m.msg_namelen = sizeof(fsock);
iov[0].iov_base = (caddr_t)buf;
@ -944,16 +926,6 @@ riprecv()
}
if (index && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, index);
#else
flen = sizeof(struct sockaddr_in6);
if ((len = recvfrom(ripsock, buf, sizeof(buf), 0,
(struct sockaddr *)&fsock, &flen)) < 0)
fatal("recvfrom");
if (IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
index = IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr);
else
index = 0;
#endif /*ADVAPI*/
nh = fsock.sin6_addr;
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /