summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-01-07 10:02:43 +0000
committershin <shin@FreeBSD.org>2000-01-07 10:02:43 +0000
commit5a9ffb7f5aae940fea91a0088b42469832041093 (patch)
tree130038b0831e28534570623df736f82b68c53204
parent315e3c41c25d28924f66c5834082cbc5a0fc31e8 (diff)
downloadFreeBSD-src-5a9ffb7f5aae940fea91a0088b42469832041093.zip
FreeBSD-src-5a9ffb7f5aae940fea91a0088b42469832041093.tar.gz
remove redundant ifdef's.
some part is specified by: phantom
-rw-r--r--usr.sbin/gifconfig/gifconfig.c2
-rw-r--r--usr.sbin/ifmcstat/ifmcstat.c226
-rw-r--r--usr.sbin/prefix/prefix.c2
-rw-r--r--usr.sbin/rip6query/rip6query.c2
-rw-r--r--usr.sbin/route6d/Makefile2
-rw-r--r--usr.sbin/route6d/route6d.c41
-rw-r--r--usr.sbin/rtsold/if.c32
-rw-r--r--usr.sbin/rtsold/probe.c2
-rw-r--r--usr.sbin/traceroute6/traceroute6.c71
9 files changed, 46 insertions, 334 deletions
diff --git a/usr.sbin/gifconfig/gifconfig.c b/usr.sbin/gifconfig/gifconfig.c
index 3f36b03..49d0ba0 100644
--- a/usr.sbin/gifconfig/gifconfig.c
+++ b/usr.sbin/gifconfig/gifconfig.c
@@ -57,9 +57,7 @@
#include <sys/sysctl.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/route.h>
diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c
index d5ffc13..9fe262f 100644
--- a/usr.sbin/ifmcstat/ifmcstat.c
+++ b/usr.sbin/ifmcstat/ifmcstat.c
@@ -40,23 +40,13 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-# include <net/if_var.h>
-#endif
+#include <net/if_var.h>
#include <net/if_types.h>
#include <net/if_dl.h>
#include <netinet/in.h>
-#ifndef __NetBSD__
-# ifdef __FreeBSD__
-# define _KERNEL
-# endif
-# include <netinet/if_ether.h>
-# ifdef __FreeBSD__
-# undef _KERNEL
-# endif
-#else
-# include <net/if_ether.h>
-#endif
+#define _KERNEL
+#include <netinet/if_ether.h>
+#undef _KERNEL
#include <netinet/in_var.h>
#include <arpa/inet.h>
@@ -72,21 +62,9 @@ const char *inet6_n2a __P((struct in6_addr *));
int main __P((void));
char *ifname __P((struct ifnet *));
void kread __P((u_long, void *, int));
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
-void acmc __P((struct ether_multi *));
-#endif
void if6_addrlist __P((struct ifaddr *));
void in6_multilist __P((struct in6_multi *));
-struct in6_multi * in6_multientry __P((struct in6_multi *));
-
-#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__)
-#ifdef __bsdi__
-struct ether_addr {
- u_int8_t ether_addr_octet[6];
-};
-#endif
-static char *ether_ntoa __P((struct ether_addr *));
-#endif
+void in6_multientry __P((struct in6_multi *));
#define KREAD(addr, buf, type) \
kread((u_long)addr, (void *)buf, sizeof(type))
@@ -105,12 +83,7 @@ int main()
{
char buf[_POSIX2_LINE_MAX], ifname[IFNAMSIZ];
struct ifnet *ifp, *nifp, ifnet;
-#ifndef __NetBSD__
struct arpcom arpcom;
-#else
- struct ethercom ec;
- struct sockaddr_dl sdl;
-#endif
if ((kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, buf)) == NULL) {
perror("kvm_openfiles");
@@ -128,47 +101,8 @@ int main()
while (ifp) {
KREAD(ifp, &ifnet, struct ifnet);
printf("%s:\n", if_indextoname(ifnet.if_index, ifname));
-
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- if6_addrlist(ifnet.if_addrlist.tqh_first);
- nifp = ifnet.if_list.tqe_next;
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
if6_addrlist(TAILQ_FIRST(&ifnet.if_addrhead));
- nifp = ifnet.if_link.tqe_next;
-#else
- if6_addrlist(ifnet.if_addrlist);
- nifp = ifnet.if_next;
-#endif
-
-#ifdef __NetBSD__
- KREAD(ifnet.if_sadl, &sdl, struct sockaddr_dl);
- if (sdl.sdl_type == IFT_ETHER) {
- printf("\tenaddr %s",
- ether_ntoa((struct ether_addr *)LLADDR(&sdl)));
- KREAD(ifp, &ec, struct ethercom);
- printf(" multicnt %d", ec.ec_multicnt);
- acmc(ec.ec_multiaddrs.lh_first);
- printf("\n");
- }
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
- /* not supported */
-#else
- if (ifnet.if_type == IFT_ETHER) {
- KREAD(ifp, &arpcom, struct arpcom);
- printf("\tenaddr %s",
- ether_ntoa((struct ether_addr *)arpcom.ac_enaddr));
- KREAD(ifp, &arpcom, struct arpcom);
- printf(" multicnt %d", arpcom.ac_multicnt);
-#ifdef __OpenBSD__
- acmc(arpcom.ac_multiaddrs.lh_first);
-#else
- acmc(arpcom.ac_multiaddrs);
-#endif
- printf("\n");
- }
-#endif
-
- ifp = nifp;
+ ifp = TAILQ_NEXT(&ifnet, if_link);
}
exit(0);
@@ -180,11 +114,7 @@ char *ifname(ifp)
{
static char buf[BUFSIZ];
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- KREAD(ifp->if_xname, buf, IFNAMSIZ);
-#else
KREAD(ifp->if_name, buf, IFNAMSIZ);
-#endif
return buf;
}
@@ -199,107 +129,64 @@ void kread(addr, buf, len)
}
}
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
-void acmc(am)
- struct ether_multi *am;
-{
- struct ether_multi em;
-
- while (am) {
- KREAD(am, &em, struct ether_multi);
-
- printf("\n\t\t");
- printf("%s -- ", ether_ntoa((struct ether_addr *)em.enm_addrlo));
- printf("%s ", ether_ntoa((struct ether_addr *)&em.enm_addrhi));
- printf("%d", em.enm_refcount);
-#if !defined(__NetBSD__) && !defined(__OpenBSD__)
- am = em.enm_next;
-#else
- am = em.enm_list.le_next;
-#endif
- }
-}
-#endif
-
void
if6_addrlist(ifap)
struct ifaddr *ifap;
{
static char in6buf[BUFSIZ];
+ struct ifnet ifnet;
struct ifaddr ifa;
- struct sockaddr sa;
- struct in6_ifaddr if6a;
- struct in6_multi *mc = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
struct ifaddr *ifap0;
-#endif /* __FreeBSD__ >= 3 */
+ struct ifmultiaddr ifm, *ifmp = 0;
+ struct in6_ifaddr if6a;
+ struct in6_multi *mc = 0, in6m;
+ int in6_multilist_done = 0;
+ struct sockaddr sa;
+ struct sockaddr_in6 sin6;
+ struct sockaddr_dl sdl;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+ if (ifap == NULL)
+ return;
ifap0 = ifap;
-#endif /* __FreeBSD__ >= 3 */
- while (ifap) {
+
+ do {
KREAD(ifap, &ifa, struct ifaddr);
if (ifa.ifa_addr == NULL)
- goto nextifap;
+ continue;
KREAD(ifa.ifa_addr, &sa, struct sockaddr);
if (sa.sa_family != PF_INET6)
- goto nextifap;
+ continue;
KREAD(ifap, &if6a, struct in6_ifaddr);
printf("\tinet6 %s\n",
inet_ntop(AF_INET6,
(const void *)&if6a.ia_addr.sin6_addr,
in6buf, sizeof(in6buf)));
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
- mc = mc ? mc : if6a.ia6_multiaddrs.lh_first;
-#endif
- nextifap:
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- ifap = ifa.ifa_list.tqe_next;
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
- ifap = ifa.ifa_link.tqe_next;
-#else
- ifap = ifa.ifa_next;
-#endif /* __FreeBSD__ >= 3 */
- }
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- if (ifap0) {
- struct ifnet ifnet;
- struct ifmultiaddr ifm, *ifmp = 0;
- struct sockaddr_in6 sin6;
- struct in6_multi in6m;
- struct sockaddr_dl sdl;
- int in6_multilist_done = 0;
-
- KREAD(ifap0, &ifa, struct ifaddr);
- KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
- if (ifnet.if_multiaddrs.lh_first)
- ifmp = ifnet.if_multiaddrs.lh_first;
- while (ifmp) {
- KREAD(ifmp, &ifm, struct ifmultiaddr);
- if (ifm.ifma_addr == NULL)
- goto nextmulti;
- KREAD(ifm.ifma_addr, &sa, struct sockaddr);
- if (sa.sa_family != AF_INET6)
- goto nextmulti;
- (void)in6_multientry((struct in6_multi *)
- ifm.ifma_protospec);
- if (ifm.ifma_lladdr == 0)
- goto nextmulti;
- KREAD(ifm.ifma_lladdr, &sdl, struct sockaddr_dl);
- printf("\t\t\tmcast-macaddr %s multicnt %d\n",
- ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
- ifm.ifma_refcount);
- nextmulti:
- ifmp = ifm.ifma_link.le_next;
- }
- }
-#else
- if (mc)
- in6_multilist(mc);
-#endif
+ } while ((ifap = TAILQ_NEXT(&ifa, ifa_link)) != NULL);
+
+ KREAD(ifap0, &ifa, struct ifaddr);
+ KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
+ if (ifnet.if_multiaddrs.lh_first)
+ ifmp = ifnet.if_multiaddrs.lh_first;
+ if (ifmp == NULL)
+ return;
+ do {
+ KREAD(ifmp, &ifm, struct ifmultiaddr);
+ if (ifm.ifma_addr == NULL)
+ continue;
+ KREAD(ifm.ifma_addr, &sa, struct sockaddr);
+ if (sa.sa_family != AF_INET6)
+ continue;
+ in6_multientry((struct in6_multi *)ifm.ifma_protospec);
+ if (ifm.ifma_lladdr == 0)
+ continue;
+ KREAD(ifm.ifma_lladdr, &sdl, struct sockaddr_dl);
+ printf("\t\t\tmcast-macaddr %s multicnt %d\n",
+ ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
+ ifm.ifma_refcount);
+ } while ((ifmp = LIST_NEXT(&ifm, ifma_link)) != NULL);
}
-struct in6_multi *
+void
in6_multientry(mc)
struct in6_multi *mc;
{
@@ -310,29 +197,4 @@ in6_multientry(mc)
printf("\t\tgroup %s\n", inet_ntop(AF_INET6,
(const void *)&multi.in6m_addr,
mcbuf, sizeof(mcbuf)));
- return(multi.in6m_entry.le_next);
-}
-
-void
-in6_multilist(mc)
- struct in6_multi *mc;
-{
- while (mc)
- mc = in6_multientry(mc);
-}
-
-#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__)
-static char *
-ether_ntoa(e)
- struct ether_addr *e;
-{
- static char buf[20];
- u_char *p;
-
- p = (u_char *)e;
-
- snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
- p[0], p[1], p[2], p[3], p[4], p[5]);
- return buf;
}
-#endif
diff --git a/usr.sbin/prefix/prefix.c b/usr.sbin/prefix/prefix.c
index 53c9546..04bd9a1 100644
--- a/usr.sbin/prefix/prefix.c
+++ b/usr.sbin/prefix/prefix.c
@@ -36,9 +36,7 @@
#include <sys/time.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/route.h>
diff --git a/usr.sbin/rip6query/rip6query.c b/usr.sbin/rip6query/rip6query.c
index 6c2fb5c..523b17f 100644
--- a/usr.sbin/rip6query/rip6query.c
+++ b/usr.sbin/rip6query/rip6query.c
@@ -41,9 +41,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <arpa/inet.h>
diff --git a/usr.sbin/route6d/Makefile b/usr.sbin/route6d/Makefile
index ed5354e..97b2d9d 100644
--- a/usr.sbin/route6d/Makefile
+++ b/usr.sbin/route6d/Makefile
@@ -4,6 +4,6 @@
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
.include <bsd.prog.mk>
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 857f5cb..2e8deac 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -60,16 +60,10 @@ static char _rcsid[] = "$Id: route6d.c,v 1.6 1999/09/10 08:20:59 itojun Exp $";
#include <sys/ioctl.h>
#include <sys/sysctl.h>
#include <sys/errno.h>
-#ifdef ADVAPI
#include <sys/uio.h>
-#endif
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
-#define KERNEL 1
#include <net/route.h>
-#undef KERNEL
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/ip6.h>
@@ -357,15 +351,8 @@ main(argc, argv)
ifrtdump(0);
if (dflag == 0) {
-#if 1
if (daemon(0, 0) < 0)
fatal("daemon");
-#else
- if (fork())
- exit(0);
- if (setsid() < 0)
- fatal("setid");
-#endif
}
pid = getpid();
if ((pidfile = fopen(ROUTE6D_PID, "w")) != NULL) {
@@ -509,9 +496,7 @@ ripalarm(sig)
void
init()
{
-#ifdef ADVAPI
int i;
-#endif
int int0, int255, error;
struct addrinfo hints, *res;
char port[10];
@@ -544,11 +529,9 @@ init()
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
&int0, sizeof(int0)) < 0)
fatal("rip IPV6_MULTICAST_LOOP");
-#ifdef ADVAPI
i = 1;
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_PKTINFO, &i, sizeof(i)) < 0)
fatal("rip IPV6_PKTINFO");
-#endif /*ADVAPI*/
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET6;
@@ -811,7 +794,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];
@@ -858,13 +840,6 @@ 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;
}
@@ -882,24 +857,18 @@ 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;
@@ -924,16 +893,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)) /
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index 4ac1d4b..66aaa55 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -35,23 +35,12 @@
#include <sys/ioctl.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
#include <net/if_types.h>
#include <net/route.h>
#include <net/if_dl.h>
#include <net/if_media.h>
-#ifdef __FreeBSD__
-# include <net/ethernet.h>
-#endif
-#ifdef __NetBSD__
-#include <net/if_ether.h>
-#endif
-#if defined(__bsdi__) || defined(__OpenBSD__)
-# include <netinet/in.h>
-# include <netinet/if_ether.h>
-#endif
+#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/icmp6.h>
@@ -359,13 +348,7 @@ getifa(char *name, struct in6_ifaddr *ifap)
KREAD(ifp, &ifnet, struct ifnet);
if (ifnet.if_index == index)
break;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- ifp = TAILQ_NEXT(&ifnet, if_list);
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
ifp = TAILQ_NEXT(&ifnet, if_link);
-#else
- ifp = ifnet.if_next;
-#endif
}
if (!ifp) {
warnmsg(LOG_ERR, __FUNCTION__, "interface \"%s\" not found",
@@ -373,13 +356,7 @@ getifa(char *name, struct in6_ifaddr *ifap)
goto bad;
}
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- ifa = (struct in6_ifaddr *)TAILQ_FIRST(&ifnet.if_addrlist);
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
ifa = (struct in6_ifaddr *)TAILQ_FIRST(&ifnet.if_addrhead);
-#else
- ifa = (struct in6_ifaddr *)ifnet.if_addrlist;
-#endif
while (ifa) {
KREAD(ifa, ifap, *ifap);
if (ifap->ia_addr.sin6_family == AF_INET6
@@ -388,15 +365,8 @@ getifa(char *name, struct in6_ifaddr *ifap)
return 0;
}
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- ifa = (struct in6_ifaddr *)
- TAILQ_NEXT((struct ifaddr *)ifap, ifa_list);
-#elif defined(__FreeBSD__) && __FreeBSD__ >= 3
ifa = (struct in6_ifaddr *)
TAILQ_NEXT((struct ifaddr *)ifap, ifa_link);
-#else
- ifa = (struct in6_ifaddr *)(((struct ifaddr *)ifap)->ifa_next);
-#endif
}
warnmsg(LOG_ERR, __FUNCTION__, "no IPv6 link-local address for %s",
name);
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c
index 4b42c21..824baeb 100644
--- a/usr.sbin/rtsold/probe.c
+++ b/usr.sbin/rtsold/probe.c
@@ -36,9 +36,7 @@
#include <sys/uio.h>
#include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
#include <net/if_var.h>
-#endif /* __FreeBSD__ >= 3 */
#include <netinet/in.h>
#include <netinet6/in6_var.h>
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index a1b665e..baef2b3 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -442,11 +442,7 @@ main(argc, argv)
if (argc < 1)
usage();
-#if 1
setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
-#else
- setlinebuf (stdout);
-#endif
(void) bzero((char *)dst, sizeof(Dst));
Dst.sin6_family = AF_INET6;
@@ -524,26 +520,6 @@ main(argc, argv)
errx(1, ipsec_strerror());
if (setpolicy(rcvsock, "out bypass") < 0)
errx(1, ipsec_strerror());
-#else
- {
- int level = IPSEC_LEVEL_NONE;
-
- (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_ESP_TRANS_LEVEL, &level,
- sizeof(level));
- (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_ESP_NETWORK_LEVEL, &level,
- sizeof(level));
-#ifdef IP_AUTH_TRANS_LEVEL
- (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_AUTH_TRANS_LEVEL, &level,
- sizeof(level));
-#else
- (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_AUTH_LEVEL, &level,
- sizeof(level));
-#endif
-#ifdef IP_AUTH_NETWORK_LEVEL
- (void)setsockopt(rcvsock, IPPROTO_IPV6, IPV6_AUTH_NETWORK_LEVEL, &level,
- sizeof(level));
-#endif
- }
#endif /*IPSEC_POLICY_IPSEC*/
#endif /*IPSEC*/
@@ -554,13 +530,11 @@ main(argc, argv)
perror("traceroute6: udp socket");
exit(5);
}
-#ifdef SO_SNDBUF
if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&datalen,
sizeof(datalen)) < 0) {
perror("traceroute6: SO_SNDBUF");
exit(6);
}
-#endif /* SO_SNDBUF */
if (options & SO_DEBUG)
(void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG,
(char *)&on, sizeof(on));
@@ -582,26 +556,6 @@ main(argc, argv)
errx(1, ipsec_strerror());
if (setpolicy(sndsock, "out bypass") < 0)
errx(1, ipsec_strerror());
-#else
- {
- int level = IPSEC_LEVEL_BYPASS;
-
- (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_ESP_TRANS_LEVEL, &level,
- sizeof(level));
- (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_ESP_NETWORK_LEVEL, &level,
- sizeof(level));
-#ifdef IP_AUTH_TRANS_LEVEL
- (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_AUTH_TRANS_LEVEL, &level,
- sizeof(level));
-#else
- (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_AUTH_LEVEL, &level,
- sizeof(level));
-#endif
-#ifdef IP_AUTH_NETWORK_LEVEL
- (void)setsockopt(sndsock, IPPROTO_IPV6, IPV6_AUTH_NETWORK_LEVEL, &level,
- sizeof(level));
-#endif
- }
#endif /*IPSEC_POLICY_IPSEC*/
#endif /*IPSEC*/
@@ -896,24 +850,6 @@ packet_ok(mhdr, cc, seq)
struct cmsghdr *cm;
int *hlimp;
-#ifdef OLDRAWSOCKET
- int hlen;
- struct ip6_hdr *ip;
-#endif
-
-#ifdef OLDRAWSOCKET
- ip = (struct ip6_hdr *) buf;
- hlen = sizeof(struct ip6_hdr);
- if (cc < hlen + sizeof(struct icmp6_hdr)) {
- if (verbose)
- Printf("packet too short (%d bytes) from %s\n", cc,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntop_buf, sizeof(ntop_buf)));
- return (0);
- }
- cc -= hlen;
- icp = (struct icmp6_hdr *)(buf + hlen);
-#else
if (cc < sizeof(struct icmp6_hdr)) {
if (verbose)
Printf("data too short (%d bytes) from %s\n", cc,
@@ -922,7 +858,6 @@ packet_ok(mhdr, cc, seq)
return(0);
}
icp = (struct icmp6_hdr *)buf;
-#endif
/* get optional information via advanced API */
rcvpktinfo = NULL;
hlimp = NULL;
@@ -1046,15 +981,9 @@ print(mhdr, cc)
}
if (verbose) {
-#ifdef OLDRAWSOCKET
- Printf(" %d bytes to %s", cc,
- inet_ntop(AF_INET6, &rcvpktinfo->ipi6_addr,
- ntop_buf, sizeof(ntop_buf)));
-#else
Printf(" %d bytes of data to %s", cc,
inet_ntop(AF_INET6, &rcvpktinfo->ipi6_addr,
ntop_buf, sizeof(ntop_buf)));
-#endif
}
}
OpenPOWER on IntegriCloud