Page MenuHomeFreeBSD

D20938.id59687.diff
No OneTemporary

D20938.id59687.diff

Index: sbin/ping6/Makefile
===================================================================
--- sbin/ping6/Makefile
+++ sbin/ping6/Makefile
@@ -4,7 +4,7 @@
PROG= ping6
MAN= ping6.8
-CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS
+CFLAGS+=-DIPSEC -DKAME_SCOPEID
WARNS?= 3
BINOWN= root
Index: sbin/ping6/ping6.c
===================================================================
--- sbin/ping6/ping6.c
+++ sbin/ping6/ping6.c
@@ -307,9 +307,7 @@
#endif
int usepktinfo = 0;
struct in6_pktinfo *pktinfo = NULL;
-#ifdef USE_RFC2292BIS
struct ip6_rthdr *rthdr = NULL;
-#endif
#ifdef IPSEC_POLICY_IPSEC
char *policy_in = NULL;
char *policy_out = NULL;
@@ -902,11 +900,8 @@
if (argc > 1) { /* some intermediate addrs are specified */
int hops;
-#ifdef USE_RFC2292BIS
int rthdrlen;
-#endif
-#ifdef USE_RFC2292BIS
rthdrlen = inet6_rth_space(IPV6_RTHDR_TYPE_0, argc - 1);
scmsgp->cmsg_len = CMSG_LEN(rthdrlen);
scmsgp->cmsg_level = IPPROTO_IPV6;
@@ -916,11 +911,6 @@
IPV6_RTHDR_TYPE_0, argc - 1);
if (rthdr == NULL)
errx(1, "can't initialize rthdr");
-#else /* old advanced API */
- if ((scmsgp = (struct cmsghdr *)inet6_rthdr_init(scmsgp,
- IPV6_RTHDR_TYPE_0)) == NULL)
- errx(1, "can't initialize rthdr");
-#endif /* USE_RFC2292BIS */
for (hops = 0; hops < argc - 1; hops++) {
memset(&hints, 0, sizeof(hints));
@@ -933,22 +923,11 @@
errx(1,
"bad addr family of an intermediate addr");
sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr;
-#ifdef USE_RFC2292BIS
if (inet6_rth_add(rthdr, &sin6->sin6_addr))
errx(1, "can't add an intermediate node");
-#else /* old advanced API */
- if (inet6_rthdr_add(scmsg, &sin6->sin6_addr,
- IPV6_RTHDR_LOOSE))
- errx(1, "can't add an intermediate node");
-#endif /* USE_RFC2292BIS */
freeaddrinfo(res);
}
-#ifndef USE_RFC2292BIS
- if (inet6_rthdr_lasthop(scmsgp, IPV6_RTHDR_LOOSE))
- errx(1, "can't set the last flag");
-#endif
-
scmsgp = CMSG_NXTHDR(&smsghdr, scmsgp);
}
@@ -968,7 +947,6 @@
src.sin6_port = ntohs(DUMMY_PORT);
src.sin6_scope_id = dst.sin6_scope_id;
-#ifdef USE_RFC2292BIS
if (pktinfo &&
setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTINFO,
(void *)pktinfo, sizeof(*pktinfo)))
@@ -988,12 +966,6 @@
setsockopt(dummy, IPPROTO_IPV6, IPV6_RTHDR,
(void *)rthdr, (rthdr->ip6r_len + 1) << 3))
err(1, "UDP setsockopt(IPV6_RTHDR)");
-#else /* old advanced API */
- if (smsghdr.msg_control &&
- setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTOPTIONS,
- (void *)smsghdr.msg_control, smsghdr.msg_controllen))
- err(1, "UDP setsockopt(IPV6_PKTOPTIONS)");
-#endif
if (connect(dummy, (struct sockaddr *)&src, len) < 0)
err(1, "UDP connect");
@@ -1785,7 +1757,6 @@
}
}
-#ifdef USE_RFC2292BIS
static void
pr_ip6opt(void *extbuf, size_t bufsize)
{
@@ -1847,17 +1818,7 @@
}
return;
}
-#else /* !USE_RFC2292BIS */
-/* ARGSUSED */
-static void
-pr_ip6opt(void *extbuf, size_t bufsize __unused)
-{
- putchar('\n');
- return;
-}
-#endif /* USE_RFC2292BIS */
-#ifdef USE_RFC2292BIS
static void
pr_rthdr(void *extbuf, size_t bufsize)
{
@@ -1912,16 +1873,6 @@
return;
}
-
-#else /* !USE_RFC2292BIS */
-/* ARGSUSED */
-static void
-pr_rthdr(void *extbuf, size_t bufsize __unused)
-{
- putchar('\n');
- return;
-}
-#endif /* USE_RFC2292BIS */
static int
pr_bitrange(u_int32_t v, int soff, int ii)
Index: usr.sbin/mld6query/Makefile
===================================================================
--- usr.sbin/mld6query/Makefile
+++ usr.sbin/mld6query/Makefile
@@ -18,7 +18,7 @@
MAN= mld6query.8
SRCS= mld6.c
-CFLAGS+= -DIPSEC -DUSE_RFC2292BIS
+CFLAGS+= -DIPSEC
WARNS?= 2
Index: usr.sbin/mld6query/mld6.c
===================================================================
--- usr.sbin/mld6query/mld6.c
+++ usr.sbin/mld6query/mld6.c
@@ -203,12 +203,8 @@
static struct iovec iov[2];
static u_char *cmsgbuf;
int cmsglen, hbhlen = 0;
-#ifdef USE_RFC2292BIS
void *hbhbuf = NULL, *optp = NULL;
int currentlen;
-#else
- u_int8_t raopt[IP6OPT_RTALERT_LEN];
-#endif
struct in6_pktinfo *pi;
struct cmsghdr *cmsgp;
u_short rtalert_code = htons(IP6OPT_RTALERT_MLD);
@@ -253,7 +249,6 @@
src.s6_addr[2] = src.s6_addr[3] = 0;
#endif
-#ifdef USE_RFC2292BIS
if ((hbhlen = inet6_opt_init(NULL, 0)) == -1)
errx(1, "inet6_opt_init(0) failed");
if ((hbhlen = inet6_opt_append(NULL, 0, hbhlen, IP6OPT_ROUTER_ALERT, 2,
@@ -262,11 +257,6 @@
if ((hbhlen = inet6_opt_finish(NULL, 0, hbhlen)) == -1)
errx(1, "inet6_opt_finish(0) failed");
cmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(hbhlen);
-#else
- hbhlen = sizeof(raopt);
- cmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) +
- inet6_option_space(hbhlen);
-#endif
if ((cmsgbuf = malloc(cmsglen)) == NULL)
errx(1, "can't allocate enough memory for cmsg");
@@ -282,7 +272,6 @@
memcpy(&pi->ipi6_addr, &src, sizeof(pi->ipi6_addr));
/* specifiy to insert router alert option in a hop-by-hop opt hdr. */
cmsgp = CMSG_NXTHDR(&m, cmsgp);
-#ifdef USE_RFC2292BIS
cmsgp->cmsg_len = CMSG_LEN(hbhlen);
cmsgp->cmsg_level = IPPROTO_IPV6;
cmsgp->cmsg_type = IPV6_HOPOPTS;
@@ -297,15 +286,6 @@
(void)inet6_opt_set_val(optp, 0, &rtalert_code, sizeof(rtalert_code));
if ((currentlen = inet6_opt_finish(hbhbuf, hbhlen, currentlen)) == -1)
errx(1, "inet6_opt_finish(buf) failed");
-#else /* old advanced API */
- if (inet6_option_init((void *)cmsgp, &cmsgp, IPV6_HOPOPTS))
- errx(1, "inet6_option_init failed\n");
- raopt[0] = IP6OPT_ROUTER_ALERT;
- raopt[1] = IP6OPT_RTALERT_LEN - 2;
- memcpy(&raopt[2], (caddr_t)&rtalert_code, sizeof(u_short));
- if (inet6_option_append(cmsgp, raopt, 4, 0))
- errx(1, "inet6_option_append failed\n");
-#endif
}
void
Index: usr.sbin/traceroute6/Makefile
===================================================================
--- usr.sbin/traceroute6/Makefile
+++ usr.sbin/traceroute6/Makefile
@@ -22,7 +22,7 @@
BINOWN= root
BINMODE= 4555
-CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL
+CFLAGS+= -DIPSEC -DHAVE_POLL
CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I.
WARNS?= 3
Index: usr.sbin/traceroute6/traceroute6.c
===================================================================
--- usr.sbin/traceroute6/traceroute6.c
+++ usr.sbin/traceroute6/traceroute6.c
@@ -331,9 +331,7 @@
#define ICMP6ECHOLEN 8
/* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */
char rtbuf[2064];
-#ifdef USE_RFC2292BIS
struct ip6_rthdr *rth;
-#endif
struct cmsghdr *cmsg;
char *source = NULL;
@@ -434,7 +432,6 @@
"traceroute6: unknown host %s\n", optarg);
exit(1);
}
-#ifdef USE_RFC2292BIS
if (rth == NULL) {
/*
* XXX: We can't detect the number of
@@ -455,12 +452,6 @@
optarg);
exit(1);
}
-#else /* old advanced API */
- if (cmsg == NULL)
- cmsg = inet6_rthdr_init(rtbuf, IPV6_RTHDR_TYPE_0);
- inet6_rthdr_add(cmsg, (struct in6_addr *)hp->h_addr,
- IPV6_RTHDR_LOOSE);
-#endif
freehostent(hp);
break;
case 'I':
@@ -762,7 +753,6 @@
if (options & SO_DONTROUTE)
(void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE,
(char *)&on, sizeof(on));
-#ifdef USE_RFC2292BIS
if (rth) {/* XXX: there is no library to finalize the header... */
rth->ip6r_len = rth->ip6r_segleft * 2;
if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_RTHDR,
@@ -772,17 +762,6 @@
exit(1);
}
}
-#else /* old advanced API */
- if (cmsg != NULL) {
- inet6_rthdr_lasthop(cmsg, IPV6_RTHDR_LOOSE);
- if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_PKTOPTIONS,
- rtbuf, cmsg->cmsg_len) < 0) {
- fprintf(stderr, "setsockopt(IPV6_PKTOPTIONS): %s\n",
- strerror(errno));
- exit(1);
- }
- }
-#endif /* USE_RFC2292BIS */
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
/*

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 8, 5:24 PM (7 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16529628
Default Alt Text
D20938.id59687.diff (7 KB)

Event Timeline