From owner-svn-src-stable-7@FreeBSD.ORG Sun Sep 4 14:30:22 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF1F3106566B; Sun, 4 Sep 2011 14:30:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADB648FC15; Sun, 4 Sep 2011 14:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p84EUM06095038; Sun, 4 Sep 2011 14:30:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p84EUMsT095035; Sun, 4 Sep 2011 14:30:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201109041430.p84EUMsT095035@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Sep 2011 14:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225375 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Sep 2011 14:30:22 -0000 Author: brueffer Date: Sun Sep 4 14:30:22 2011 New Revision: 225375 URL: http://svn.freebsd.org/changeset/base/225375 Log: MFC: r225228 Remove broken link to supported wifi cards. There doesn't appear to be an equivalent list anywhere else. Modified: stable/7/share/man/man4/ath.4 stable/7/share/man/man4/ath_hal.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/ath.4 ============================================================================== --- stable/7/share/man/man4/ath.4 Sun Sep 4 14:28:06 2011 (r225374) +++ stable/7/share/man/man4/ath.4 Sun Sep 4 14:30:22 2011 (r225375) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd December 7, 2006 +.Dd August 28, 2011 .Dt ATH 4 .Os .Sh NAME @@ -129,9 +129,6 @@ The .Nm driver supports all Atheros Cardbus or PCI cards, except those that are based on the AR5005VL chipset. -.Pp -A list of cards that are supported can be found at -.Pa http://customerproducts.atheros.com/customerproducts/default.asp . .Sh EXAMPLES Join an existing BSS network (ie: connect to an access point): .Pp Modified: stable/7/share/man/man4/ath_hal.4 ============================================================================== --- stable/7/share/man/man4/ath_hal.4 Sun Sep 4 14:28:06 2011 (r225374) +++ stable/7/share/man/man4/ath_hal.4 Sun Sep 4 14:30:22 2011 (r225375) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd August 26, 2004 +.Dd August 28, 2011 .Dt ATH_HAL 4 .Os .Sh NAME @@ -97,9 +97,6 @@ module: .It "Sony PCWA-C500 AR5210 Cardbus a" .It "3Com 3CRPAG175 AR5212 CardBus a/b/g" .El -.Pp -An up to date list can be found at -.Pa http://customerproducts.atheros.com/customerproducts . .Sh SEE ALSO .Xr ath 4 .Sh HISTORY From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 5 07:59:23 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9960106566C; Mon, 5 Sep 2011 07:59:23 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B79528FC15; Mon, 5 Sep 2011 07:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p857xN1i026852; Mon, 5 Sep 2011 07:59:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p857xNZv026850; Mon, 5 Sep 2011 07:59:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201109050759.p857xNZv026850@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 5 Sep 2011 07:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225387 - stable/7/lib/libmemstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 07:59:23 -0000 Author: pluknet Date: Mon Sep 5 07:59:23 2011 New Revision: 225387 URL: http://svn.freebsd.org/changeset/base/225387 Log: MFC r225330: Cosmetic cleanup: remove unused #define LIBMEMSTAT Modified: stable/7/lib/libmemstat/memstat_uma.c Directory Properties: stable/7/lib/libmemstat/ (props changed) Modified: stable/7/lib/libmemstat/memstat_uma.c ============================================================================== --- stable/7/lib/libmemstat/memstat_uma.c Mon Sep 5 07:57:56 2011 (r225386) +++ stable/7/lib/libmemstat/memstat_uma.c Mon Sep 5 07:59:23 2011 (r225387) @@ -29,7 +29,6 @@ #include #include -#define LIBMEMSTAT /* Cause vm_page.h not to include opt_vmpage.h */ #include #include From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 5 12:36:12 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB5A106564A; Mon, 5 Sep 2011 12:36:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E65608FC0A; Mon, 5 Sep 2011 12:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85CaBi4038052; Mon, 5 Sep 2011 12:36:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85CaBeL038050; Mon, 5 Sep 2011 12:36:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109051236.p85CaBeL038050@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Sep 2011 12:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225397 - stable/7/tools/tools/netrate/netsend X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 12:36:12 -0000 Author: marius Date: Mon Sep 5 12:36:11 2011 New Revision: 225397 URL: http://svn.freebsd.org/changeset/base/225397 Log: MFC: r198132 A small change to avoid calling gettimeofday() too often (hardwired to once every 20us at most). Modified: stable/7/tools/tools/netrate/netsend/netsend.c Directory Properties: stable/7/tools/tools/netrate/netsend/ (props changed) Modified: stable/7/tools/tools/netrate/netsend/netsend.c ============================================================================== --- stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 12:36:10 2011 (r225396) +++ stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 12:36:11 2011 (r225397) @@ -124,6 +124,9 @@ timing_loop(int s, struct timespec inter u_int32_t counter; long finishtime; long send_errors, send_calls; + /* do not call gettimeofday more than every 20us */ + long minres_ns = 20000; + int ic, gettimeofday_cycles; if (clock_getres(CLOCK_REALTIME, &tmptime) == -1) { perror("clock_getres"); @@ -132,8 +135,15 @@ timing_loop(int s, struct timespec inter if (timespec_ge(&tmptime, &interval)) fprintf(stderr, - "warning: interval less than resolution (%jd.%09ld)\n", + "warning: interval (%jd.%09ld) less than resolution (%jd.%09ld)\n", + (intmax_t)interval.tv_sec, interval.tv_nsec, (intmax_t)tmptime.tv_sec, tmptime.tv_nsec); + if (tmptime.tv_nsec < minres_ns) { + gettimeofday_cycles = minres_ns/(tmptime.tv_nsec + 1); + fprintf(stderr, + "calling time every %d cycles\n", gettimeofday_cycles); + } else + gettimeofday_cycles = 0; if (clock_gettime(CLOCK_REALTIME, &starttime) == -1) { perror("clock_gettime"); @@ -151,10 +161,14 @@ timing_loop(int s, struct timespec inter send_errors = send_calls = 0; counter = 0; waited = 0; + ic = gettimeofday_cycles; while (1) { timespec_add(&nexttime, &interval); - if (wait_time(nexttime, &tmptime, &waited) == -1) - return (-1); + if (--ic <= 0) { + ic = gettimeofday_cycles; + if (wait_time(nexttime, &tmptime, &waited) == -1) + return (-1); + } /* * We maintain and, if there's room, send a counter. Note * that even if the error is purely local, we still increment @@ -236,8 +250,9 @@ main(int argc, char *argv[]) /* * Specify an arbitrary limit. It's exactly that, not selected by - .* any particular strategy. '0' is a special value meaning "blast", + * any particular strategy. '0' is a special value meaning "blast", * and avoids the cost of a timing loop. + * XXX 0 is not actually implemented. */ rate = strtoul(argv[4], &dummy, 10); if (rate < 1 || *dummy != '\0') From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 5 12:39:16 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519261065670; Mon, 5 Sep 2011 12:39:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7D28FC18; Mon, 5 Sep 2011 12:39:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85CdGZK038234; Mon, 5 Sep 2011 12:39:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85CdGs4038232; Mon, 5 Sep 2011 12:39:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109051239.p85CdGs4038232@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Sep 2011 12:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225399 - stable/7/tools/tools/netrate/netsend X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 12:39:16 -0000 Author: marius Date: Mon Sep 5 12:39:15 2011 New Revision: 225399 URL: http://svn.freebsd.org/changeset/base/225399 Log: MFC: r198136 Support the specification of a range of destination ports e.g. netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration] Modified: stable/7/tools/tools/netrate/netsend/netsend.c Directory Properties: stable/7/tools/tools/netrate/netsend/ (props changed) Modified: stable/7/tools/tools/netrate/netsend/netsend.c ============================================================================== --- stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 12:39:14 2011 (r225398) +++ stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 12:39:15 2011 (r225399) @@ -39,12 +39,23 @@ #include #include +/* program arguments */ +struct _a { + int s; + struct timespec interval; + int port, port_max; + long duration; + struct sockaddr_in sin; + int packet_len; + void *packet; +}; + static void usage(void) { fprintf(stderr, - "netsend [ip] [port] [payloadsize] [rate] [duration]\n"); + "netsend [ip] [port[-port_max]] [payloadsize] [packet_rate] [duration]\n"); exit(-1); } @@ -114,10 +125,12 @@ wait_time(struct timespec ts, struct tim * Calculate a second-aligned starting time for the packet stream. Busy * wait between our calculated interval and dropping the provided packet * into the socket. If we hit our duration limit, bail. + * We sweep the ports from a->port to a->port_max included. + * If the two ports are the same we connect() the socket upfront, which + * almost halves the cost of the sendto() call. */ static int -timing_loop(int s, struct timespec interval, long duration, u_char *packet, - u_int packet_len) +timing_loop(struct _a *a) { struct timespec nexttime, starttime, tmptime; long long waited; @@ -127,18 +140,19 @@ timing_loop(int s, struct timespec inter /* do not call gettimeofday more than every 20us */ long minres_ns = 20000; int ic, gettimeofday_cycles; + int cur_port; if (clock_getres(CLOCK_REALTIME, &tmptime) == -1) { perror("clock_getres"); return (-1); } - if (timespec_ge(&tmptime, &interval)) + if (timespec_ge(&tmptime, &a->interval)) fprintf(stderr, "warning: interval (%jd.%09ld) less than resolution (%jd.%09ld)\n", - (intmax_t)interval.tv_sec, interval.tv_nsec, + (intmax_t)a->interval.tv_sec, a->interval.tv_nsec, (intmax_t)tmptime.tv_sec, tmptime.tv_nsec); - if (tmptime.tv_nsec < minres_ns) { + if (a->interval.tv_nsec < minres_ns) { gettimeofday_cycles = minres_ns/(tmptime.tv_nsec + 1); fprintf(stderr, "calling time every %d cycles\n", gettimeofday_cycles); @@ -156,14 +170,23 @@ timing_loop(int s, struct timespec inter if (wait_time(starttime, NULL, NULL) == -1) return (-1); nexttime = starttime; - finishtime = starttime.tv_sec + duration; + finishtime = starttime.tv_sec + a->duration; send_errors = send_calls = 0; counter = 0; waited = 0; ic = gettimeofday_cycles; + cur_port = a->port; + if (a->port == a->port_max) { + if (connect(a->s, (struct sockaddr *)&a->sin, sizeof(a->sin))) { + perror("connect"); + return (-1); + } + } while (1) { - timespec_add(&nexttime, &interval); + int ret; + + timespec_add(&nexttime, &a->interval); if (--ic <= 0) { ic = gettimeofday_cycles; if (wait_time(nexttime, &tmptime, &waited) == -1) @@ -178,17 +201,28 @@ timing_loop(int s, struct timespec inter * previous send, the error will turn up the current send * operation, causing the current sequence number also to be * skipped. + * The counter is incremented only on the initial port number, + * so all destinations will see the same set of packets. * * XXXRW: Note alignment assumption. */ - if (packet_len >= 4) { - *((u_int32_t *)packet) = htonl(counter); + if (cur_port == a->port && a->packet_len >= 4) { + *((u_int32_t *)a->packet) = htonl(counter); counter++; } - if (send(s, packet, packet_len, 0) < 0) + if (a->port == a->port_max) { /* socket already bound */ + ret = send(a->s, a->packet, a->packet_len, 0); + } else { + a->sin.sin_port = htons(cur_port++); + if (cur_port > a->port_max) + cur_port = a->port; + ret = sendto(a->s, a->packet, a->packet_len, 0, + (struct sockaddr *)&a->sin, sizeof(a->sin)); + } + if (ret < 0) send_errors++; send_calls++; - if (duration != 0 && tmptime.tv_sec >= finishtime) + if (a->duration != 0 && tmptime.tv_sec >= finishtime) goto done; } @@ -205,11 +239,11 @@ done: tmptime.tv_nsec); printf("send calls: %ld\n", send_calls); printf("send errors: %ld\n", send_errors); - printf("approx send rate: %ld\n", (send_calls - send_errors) / - duration); + printf("approx send rate: %ld pps\n", (send_calls - send_errors) / + a->duration); printf("approx error rate: %ld\n", (send_errors / send_calls)); printf("waited: %lld\n", waited); - printf("approx waits/sec: %lld\n", (long long)(waited / duration)); + printf("approx waits/sec: %lld\n", (long long)(waited / a->duration)); printf("approx wait rate: %lld\n", (long long)(waited / send_calls)); return (0); @@ -218,27 +252,35 @@ done: int main(int argc, char *argv[]) { - long rate, payloadsize, port, duration; - struct timespec interval; - struct sockaddr_in sin; - char *dummy, *packet; - int s; + long rate, payloadsize, port; + char *dummy; + struct _a a; /* arguments */ + + bzero(&a, sizeof(a)); if (argc != 6) usage(); - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - if (inet_aton(argv[1], &sin.sin_addr) == 0) { + a.sin.sin_len = sizeof(a.sin); + a.sin.sin_family = AF_INET; + if (inet_aton(argv[1], &a.sin.sin_addr) == 0) { perror(argv[1]); return (-1); } port = strtoul(argv[2], &dummy, 10); - if (port < 1 || port > 65535 || *dummy != '\0') + if (port < 1 || port > 65535) usage(); - sin.sin_port = htons(port); + if (*dummy != '\0' && *dummy != '-') + usage(); + a.sin.sin_port = htons(port); + a.port = a.port_max = port; + if (*dummy == '-') { /* set high port */ + port = strtoul(dummy + 1, &dummy, 10); + if (port < a.port || port > 65535) + usage(); + a.port_max = port; + } payloadsize = strtoul(argv[3], &dummy, 10); if (payloadsize < 0 || *dummy != '\0') @@ -247,56 +289,51 @@ main(int argc, char *argv[]) fprintf(stderr, "payloadsize > 32768\n"); return (-1); } + a.packet_len = payloadsize; /* * Specify an arbitrary limit. It's exactly that, not selected by * any particular strategy. '0' is a special value meaning "blast", * and avoids the cost of a timing loop. - * XXX 0 is not actually implemented. */ rate = strtoul(argv[4], &dummy, 10); - if (rate < 1 || *dummy != '\0') + if (rate < 0 || *dummy != '\0') usage(); if (rate > MAX_RATE) { - fprintf(stderr, "rate > %d\n", MAX_RATE); + fprintf(stderr, "packet rate at most %d\n", MAX_RATE); return (-1); } - duration = strtoul(argv[5], &dummy, 10); - if (duration < 0 || *dummy != '\0') + a.duration = strtoul(argv[5], &dummy, 10); + if (a.duration < 0 || *dummy != '\0') usage(); - packet = malloc(payloadsize); - if (packet == NULL) { + a.packet = malloc(payloadsize); + if (a.packet == NULL) { perror("malloc"); return (-1); } - bzero(packet, payloadsize); - + bzero(a.packet, payloadsize); if (rate == 0) { - interval.tv_sec = 0; - interval.tv_nsec = 0; + a.interval.tv_sec = 0; + a.interval.tv_nsec = 0; } else if (rate == 1) { - interval.tv_sec = 1; - interval.tv_nsec = 0; + a.interval.tv_sec = 1; + a.interval.tv_nsec = 0; } else { - interval.tv_sec = 0; - interval.tv_nsec = ((1 * 1000000000) / rate); + a.interval.tv_sec = 0; + a.interval.tv_nsec = ((1 * 1000000000) / rate); } + printf("Sending packet of payload size %ld every %jd.%09lds for %ld " - "seconds\n", payloadsize, (intmax_t)interval.tv_sec, - interval.tv_nsec, duration); + "seconds\n", payloadsize, (intmax_t)a.interval.tv_sec, + a.interval.tv_nsec, a.duration); - s = socket(PF_INET, SOCK_DGRAM, 0); - if (s == -1) { + a.s = socket(PF_INET, SOCK_DGRAM, 0); + if (a.s == -1) { perror("socket"); return (-1); } - if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("connect"); - return (-1); - } - - return (timing_loop(s, interval, duration, packet, payloadsize)); + return (timing_loop(&a)); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 5 17:45:24 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903D6106566B; Mon, 5 Sep 2011 17:45:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 656008FC08; Mon, 5 Sep 2011 17:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85HjOQ8047683; Mon, 5 Sep 2011 17:45:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85HjOhq047680; Mon, 5 Sep 2011 17:45:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109051745.p85HjOhq047680@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Sep 2011 17:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225404 - in stable/7/tools/tools/netrate: netblast netsend X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 17:45:24 -0000 Author: marius Date: Mon Sep 5 17:45:24 2011 New Revision: 225404 URL: http://svn.freebsd.org/changeset/base/225404 Log: MFC: r225334 Fix alignment assumptions. PR: 160289 Modified: stable/7/tools/tools/netrate/netblast/netblast.c stable/7/tools/tools/netrate/netsend/netsend.c Directory Properties: stable/7/tools/tools/netrate/netblast/ (props changed) stable/7/tools/tools/netrate/netsend/ (props changed) Modified: stable/7/tools/tools/netrate/netblast/netblast.c ============================================================================== --- stable/7/tools/tools/netrate/netblast/netblast.c Mon Sep 5 17:45:22 2011 (r225403) +++ stable/7/tools/tools/netrate/netblast/netblast.c Mon Sep 5 17:45:24 2011 (r225404) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -108,11 +109,9 @@ blast_loop(int s, long duration, u_char * previous send, the error will turn up the current send * operation, causing the current sequence number also to be * skipped. - * - * XXXRW: Note alignment assumption. */ if (packet_len >= 4) { - *((u_int32_t *)packet) = htonl(counter); + be32enc(packet, counter); counter++; } if (send(s, packet, packet_len, 0) < 0) Modified: stable/7/tools/tools/netrate/netsend/netsend.c ============================================================================== --- stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 17:45:22 2011 (r225403) +++ stable/7/tools/tools/netrate/netsend/netsend.c Mon Sep 5 17:45:24 2011 (r225404) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -203,11 +204,9 @@ timing_loop(struct _a *a) * skipped. * The counter is incremented only on the initial port number, * so all destinations will see the same set of packets. - * - * XXXRW: Note alignment assumption. */ if (cur_port == a->port && a->packet_len >= 4) { - *((u_int32_t *)a->packet) = htonl(counter); + be32enc(a->packet, counter); counter++; } if (a->port == a->port_max) { /* socket already bound */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Sep 8 16:22:59 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 043221065674; Thu, 8 Sep 2011 16:22:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53FC8FC1E; Thu, 8 Sep 2011 16:22:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p88GMwKx098108; Thu, 8 Sep 2011 16:22:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p88GMw8m098105; Thu, 8 Sep 2011 16:22:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201109081622.p88GMw8m098105@svn.freebsd.org> From: Xin LI Date: Thu, 8 Sep 2011 16:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225449 - in stable: 7/crypto/openssl/ssl 8/crypto/openssl/ssl X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2011 16:22:59 -0000 Author: delphij Date: Thu Sep 8 16:22:58 2011 New Revision: 225449 URL: http://svn.freebsd.org/changeset/base/225449 Log: MFC r225446: Fix SSL memory handlig for (EC)DH cipher suites, in particular for multi-threaded use of ECDH. Security: CVE-2011-3210 Reviewed by: stas Obtained from: OpenSSL CVS Modified: stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_srvr.c Directory Properties: stable/7/crypto/openssl/ (props changed) Changes in other areas also in this revision: Modified: stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_srvr.c Directory Properties: stable/8/crypto/openssl/ (props changed) Modified: stable/7/crypto/openssl/ssl/s3_lib.c ============================================================================== --- stable/7/crypto/openssl/ssl/s3_lib.c Thu Sep 8 12:56:26 2011 (r225448) +++ stable/7/crypto/openssl/ssl/s3_lib.c Thu Sep 8 16:22:58 2011 (r225449) @@ -1722,11 +1722,17 @@ void ssl3_clear(SSL *s) } #ifndef OPENSSL_NO_DH if (s->s3->tmp.dh != NULL) + { DH_free(s->s3->tmp.dh); + s->s3->tmp.dh = NULL; + } #endif #ifndef OPENSSL_NO_ECDH if (s->s3->tmp.ecdh != NULL) + { EC_KEY_free(s->s3->tmp.ecdh); + s->s3->tmp.ecdh = NULL; + } #endif rp = s->s3->rbuf.buf; Modified: stable/7/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- stable/7/crypto/openssl/ssl/s3_srvr.c Thu Sep 8 12:56:26 2011 (r225448) +++ stable/7/crypto/openssl/ssl/s3_srvr.c Thu Sep 8 16:22:58 2011 (r225449) @@ -710,9 +710,7 @@ int ssl3_check_client_hello(SSL *s) if (s->s3->tmp.message_type == SSL3_MT_CLIENT_HELLO) { /* Throw away what we have done so far in the current handshake, - * which will now be aborted. (A full SSL_clear would be too much.) - * I hope that tmp.dh is the only thing that may need to be cleared - * when a handshake is not completed ... */ + * which will now be aborted. (A full SSL_clear would be too much.) */ #ifndef OPENSSL_NO_DH if (s->s3->tmp.dh != NULL) { @@ -720,6 +718,13 @@ int ssl3_check_client_hello(SSL *s) s->s3->tmp.dh = NULL; } #endif +#ifndef OPENSSL_NO_ECDH + if (s->s3->tmp.ecdh != NULL) + { + EC_KEY_free(s->s3->tmp.ecdh); + s->s3->tmp.ecdh = NULL; + } +#endif return 2; } return 1; @@ -1329,7 +1334,6 @@ int ssl3_send_server_key_exchange(SSL *s if (s->s3->tmp.dh != NULL) { - DH_free(dh); SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto err; } @@ -1390,7 +1394,6 @@ int ssl3_send_server_key_exchange(SSL *s if (s->s3->tmp.ecdh != NULL) { - EC_KEY_free(s->s3->tmp.ecdh); SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto err; } @@ -1401,12 +1404,11 @@ int ssl3_send_server_key_exchange(SSL *s SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB); goto err; } - if (!EC_KEY_up_ref(ecdhp)) + if ((ecdh = EC_KEY_dup(ecdhp)) == NULL) { SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB); goto err; } - ecdh = ecdhp; s->s3->tmp.ecdh=ecdh; if ((EC_KEY_get0_public_key(ecdh) == NULL) || @@ -2262,6 +2264,12 @@ int ssl3_get_client_key_exchange(SSL *s) /* Get encoded point length */ i = *p; p += 1; + if (n != 1 + i) + { + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, + ERR_R_EC_LIB); + goto err; + } if (EC_POINT_oct2point(group, clnt_ecpoint, p, i, bn_ctx) == 0) {