Page MenuHomeFreeBSD

D25603.id74598.diff
No OneTemporary

D25603.id74598.diff

Index: usr.sbin/traceroute6/Makefile
===================================================================
--- usr.sbin/traceroute6/Makefile
+++ usr.sbin/traceroute6/Makefile
@@ -26,8 +26,8 @@
CFLAGS+= -DIPSEC -DHAVE_POLL
CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I.
-WARNS?= 3
-
LIBADD= ipsec
.include <bsd.prog.mk>
+
+CWARNFLAGS+= -Wno-cast-align
Index: usr.sbin/traceroute6/traceroute6.c
===================================================================
--- usr.sbin/traceroute6/traceroute6.c
+++ usr.sbin/traceroute6/traceroute6.c
@@ -294,8 +294,8 @@
#define freehostent(x)
#endif
-u_char packet[512]; /* last inbound (icmp) packet */
-char *outpacket; /* last output packet */
+static u_char packet[512]; /* last inbound (icmp) packet */
+static char *outpacket; /* last output packet */
int main(int, char *[]);
int wait_for_reply(int, struct msghdr *);
@@ -318,40 +318,40 @@
void *, u_int32_t);
void usage(void);
-int rcvsock; /* receive (icmp) socket file descriptor */
-int sndsock; /* send (raw/udp) socket file descriptor */
+static int rcvsock; /* receive (icmp) socket file descriptor */
+static int sndsock; /* send (raw/udp) socket file descriptor */
-struct msghdr rcvmhdr;
-struct iovec rcviov[2];
-int rcvhlim;
-struct in6_pktinfo *rcvpktinfo;
+static struct msghdr rcvmhdr;
+static struct iovec rcviov[2];
+static int rcvhlim;
+static struct in6_pktinfo *rcvpktinfo;
-struct sockaddr_in6 Src, Dst, Rcv;
-u_long datalen = 20; /* How much data */
+static struct sockaddr_in6 Src, Dst, Rcv;
+static u_long datalen = 20; /* How much data */
#define ICMP6ECHOLEN 8
/* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */
-char rtbuf[2064];
-struct ip6_rthdr *rth;
-struct cmsghdr *cmsg;
-
-char *source = NULL;
-char *hostname;
-
-u_long nprobes = 3;
-u_long first_hop = 1;
-u_long max_hops = 30;
-u_int16_t srcport;
-u_int16_t port = 32768+666; /* start udp dest port # for probe packets */
-u_int16_t ident;
-int options; /* socket options */
-int verbose;
-int waittime = 5; /* time to wait for response (in seconds) */
-int nflag; /* print addresses numerically */
-int useproto = IPPROTO_UDP; /* protocol to use to send packet */
-int lflag; /* print both numerical address & hostname */
-int as_path; /* print as numbers for each hop */
-char *as_server = NULL;
-void *asn;
+static char rtbuf[2064];
+static struct ip6_rthdr *rth;
+static struct cmsghdr *cmsg;
+
+static char *source = NULL;
+static char *hostname;
+
+static u_long nprobes = 3;
+static u_long first_hop = 1;
+static u_long max_hops = 30;
+static u_int16_t srcport;
+static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */
+static u_int16_t ident;
+static int options; /* socket options */
+static int verbose;
+static int waittime = 5; /* time to wait for response (in seconds) */
+static int nflag; /* print addresses numerically */
+static int useproto = IPPROTO_UDP; /* protocol to use to send packet */
+static int lflag; /* print both numerical address & hostname */
+static int as_path; /* print as numbers for each hop */
+static char *as_server = NULL;
+static void *asn;
int
main(int argc, char *argv[])
@@ -367,6 +367,11 @@
uid_t uid;
u_char type, code;
+ #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
+ char ipsec_inpolicy[] = "in bypass";
+ char ipsec_outpolicy[] = "out bypass";
+ #endif
+
/*
* Receive ICMP
*/
@@ -628,7 +633,7 @@
fprintf(stderr, "traceroute6: Warning: %s has multiple "
"addresses; using %s\n", hostname, hbuf);
}
-
+ freeaddrinfo(res);
if (*++argv) {
ep = NULL;
errno = 0;
@@ -711,9 +716,9 @@
* do not raise error even if setsockopt fails, kernel may have ipsec
* turned off.
*/
- if (setpolicy(rcvsock, "in bypass") < 0)
+ if (setpolicy(rcvsock, ipsec_inpolicy) < 0)
errx(1, "%s", ipsec_strerror());
- if (setpolicy(rcvsock, "out bypass") < 0)
+ if (setpolicy(rcvsock, ipsec_outpolicy) < 0)
errx(1, "%s", ipsec_strerror());
#else
{
@@ -769,9 +774,9 @@
* do not raise error even if setsockopt fails, kernel may have ipsec
* turned off.
*/
- if (setpolicy(sndsock, "in bypass") < 0)
+ if (setpolicy(sndsock, ipsec_inpolicy) < 0)
errx(1, "%s", ipsec_strerror());
- if (setpolicy(sndsock, "out bypass") < 0)
+ if (setpolicy(sndsock, ipsec_outpolicy) < 0)
errx(1, "%s", ipsec_strerror());
#else
{
@@ -801,9 +806,6 @@
*/
bzero(&Src, sizeof(Src));
if (source) {
- struct addrinfo hints, *res;
- int error;
-
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
@@ -1627,11 +1629,11 @@
};
u_int32_t
-sctp_crc32c(void *packet, u_int32_t len)
+sctp_crc32c(void *pack, u_int32_t len)
{
u_int32_t i, crc32c;
u_int8_t byte0, byte1, byte2, byte3;
- u_int8_t *buf = (u_int8_t *)packet;
+ u_int8_t *buf = (u_int8_t *)pack;
crc32c = ~0;
for (i = 0; i < len; i++)

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 6, 3:25 AM (9 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36068837
Default Alt Text
D25603.id74598.diff (4 KB)

Event Timeline