removed 'ifndef ADVAPI' parts
Obtained from: KAME
This commit is contained in:
parent
67205a5041
commit
6da1b6ebda
@ -4,7 +4,7 @@
|
|||||||
PROG= route6d
|
PROG= route6d
|
||||||
MAN8= route6d.8
|
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
|
-DHAVE_GETIFADDRS
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -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/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#ifdef ADVAPI
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#endif
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||||
#include <net/if_var.h>
|
#include <net/if_var.h>
|
||||||
@ -516,10 +514,7 @@ ripalarm(sig)
|
|||||||
void
|
void
|
||||||
init()
|
init()
|
||||||
{
|
{
|
||||||
#ifdef ADVAPI
|
int i, int0, int255, error;
|
||||||
int i;
|
|
||||||
#endif
|
|
||||||
int int0, int255, error;
|
|
||||||
struct addrinfo hints, *res;
|
struct addrinfo hints, *res;
|
||||||
char port[10];
|
char port[10];
|
||||||
|
|
||||||
@ -551,7 +546,7 @@ init()
|
|||||||
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
|
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
|
||||||
&int0, sizeof(int0)) < 0)
|
&int0, sizeof(int0)) < 0)
|
||||||
fatal("rip IPV6_MULTICAST_LOOP");
|
fatal("rip IPV6_MULTICAST_LOOP");
|
||||||
#ifdef ADVAPI
|
|
||||||
i = 1;
|
i = 1;
|
||||||
#ifdef IPV6_RECVPKTINFO
|
#ifdef IPV6_RECVPKTINFO
|
||||||
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &i,
|
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &i,
|
||||||
@ -562,7 +557,6 @@ init()
|
|||||||
sizeof(i)) < 0)
|
sizeof(i)) < 0)
|
||||||
fatal("rip IPV6_PKTINFO");
|
fatal("rip IPV6_PKTINFO");
|
||||||
#endif
|
#endif
|
||||||
#endif /*ADVAPI*/
|
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_family = PF_INET6;
|
hints.ai_family = PF_INET6;
|
||||||
@ -831,7 +825,6 @@ sendpacket(sin, len)
|
|||||||
* RIP6_REQUEST message. SO_DONTROUTE has been specified to
|
* RIP6_REQUEST message. SO_DONTROUTE has been specified to
|
||||||
* other sockets.
|
* other sockets.
|
||||||
*/
|
*/
|
||||||
#ifdef ADVAPI
|
|
||||||
struct msghdr m;
|
struct msghdr m;
|
||||||
struct cmsghdr *cm;
|
struct cmsghdr *cm;
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
@ -878,13 +871,7 @@ sendpacket(sin, len)
|
|||||||
trace(1, "sendmsg: %s\n", strerror(errno));
|
trace(1, "sendmsg: %s\n", strerror(errno));
|
||||||
return 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -902,24 +889,19 @@ riprecv()
|
|||||||
struct netinfo6 *np, *nq;
|
struct netinfo6 *np, *nq;
|
||||||
struct riprt *rrt;
|
struct riprt *rrt;
|
||||||
int len, nn, need_trigger, index;
|
int len, nn, need_trigger, index;
|
||||||
#ifndef ADVAPI
|
|
||||||
int flen;
|
|
||||||
#endif
|
|
||||||
char buf[4 * RIP6_MAXMTU];
|
char buf[4 * RIP6_MAXMTU];
|
||||||
time_t t;
|
time_t t;
|
||||||
#ifdef ADVAPI
|
|
||||||
struct msghdr m;
|
struct msghdr m;
|
||||||
struct cmsghdr *cm;
|
struct cmsghdr *cm;
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
u_char cmsgbuf[256];
|
u_char cmsgbuf[256];
|
||||||
struct in6_pktinfo *pi;
|
struct in6_pktinfo *pi;
|
||||||
#endif /*ADVAPI*/
|
|
||||||
struct iff *iffp;
|
struct iff *iffp;
|
||||||
struct in6_addr ia;
|
struct in6_addr ia;
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
need_trigger = 0;
|
need_trigger = 0;
|
||||||
#ifdef ADVAPI
|
|
||||||
m.msg_name = (caddr_t)&fsock;
|
m.msg_name = (caddr_t)&fsock;
|
||||||
m.msg_namelen = sizeof(fsock);
|
m.msg_namelen = sizeof(fsock);
|
||||||
iov[0].iov_base = (caddr_t)buf;
|
iov[0].iov_base = (caddr_t)buf;
|
||||||
@ -944,16 +926,6 @@ riprecv()
|
|||||||
}
|
}
|
||||||
if (index && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
|
if (index && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
|
||||||
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, index);
|
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;
|
nh = fsock.sin6_addr;
|
||||||
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
||||||
|
Loading…
x
Reference in New Issue
Block a user