From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 15:51:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFA8106564A; Sun, 5 Feb 2012 15:51:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB43F8FC13; Sun, 5 Feb 2012 15:51:19 +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 q15FpJPR089434; Sun, 5 Feb 2012 15:51:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FpJJ7089415; Sun, 5 Feb 2012 15:51:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051551.q15FpJJ7089415@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231017 - in stable/9/sbin: hastctl hastd X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:51:20 -0000 Author: trociny Date: Sun Feb 5 15:51:19 2012 New Revision: 231017 URL: http://svn.freebsd.org/changeset/base/231017 Log: MFC r229699, r229744, r229778, r229944, r229945, r229946, r230092, r230395, r230396, r230436, r230457, r230515, r230976: r229744 (pjd): fork(2) returns -1 on failure, not some random negative number. r229699 (pjd): Constify argument. r229778 (uqs): Spelling fixes for sbin/ r229944 (pjd): Don't touch pidfiles when running in foreground. Before that change we would create an empty pidfile on start and check if it changed on SIGHUP. r229945 (pjd): For functions that return -1 on failure check exactly for -1 and not for any negative number. r229946 (pjd): - Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in configuration file. - Log the fact that pidfile has changed. r230092 (pjd): Style cleanups. r230395 (pjd): Remove unused token 'port'. r230396 (pjd): Remove another unused token. r230436 (pjd): Fix minor memory leak. r230457 (pjd): Free memory that won't be used in child. r230515 (pjd): - Fix documentation to note that /etc/hast.conf is the default configuration file for hastd(8) and hastctl(8) and not hast.conf. - In copyright statement correct that this file is documentation, not software. - Bump date. r230976 (pjd): Fix typo in comment. Modified: stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c stable/9/sbin/hastd/activemap.c stable/9/sbin/hastd/control.c stable/9/sbin/hastd/ebuf.c stable/9/sbin/hastd/event.c stable/9/sbin/hastd/hast.conf.5 stable/9/sbin/hastd/hast_compression.c stable/9/sbin/hastd/hast_proto.c stable/9/sbin/hastd/hastd.c stable/9/sbin/hastd/hooks.c stable/9/sbin/hastd/lzf.h stable/9/sbin/hastd/metadata.c stable/9/sbin/hastd/nv.c stable/9/sbin/hastd/parse.y stable/9/sbin/hastd/primary.c stable/9/sbin/hastd/proto.c stable/9/sbin/hastd/proto_common.c stable/9/sbin/hastd/proto_socketpair.c stable/9/sbin/hastd/proto_tcp.c stable/9/sbin/hastd/proto_uds.c stable/9/sbin/hastd/secondary.c stable/9/sbin/hastd/subr.c stable/9/sbin/hastd/subr.h stable/9/sbin/hastd/token.l Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastctl/hastctl.8 Sun Feb 5 15:51:19 2012 (r231017) @@ -97,7 +97,7 @@ If extent size is too small, there will related to dirty map updates, which will degrade performance of the given resource. If extent size is too large, synchronization, even in case of short -outage, can take a long time increasing the risk of loosing up-to-date +outage, can take a long time increasing the risk of losing up-to-date node before synchronization process is completed. The default extent size is .Va 2MB . Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastctl/hastctl.c Sun Feb 5 15:51:19 2012 (r231017) @@ -104,7 +104,7 @@ create_one(struct hast_resource *res, in ec = 0; pjdlog_prefix_set("[%s] ", res->hr_name); - if (provinfo(res, true) < 0) { + if (provinfo(res, true) == -1) { ec = EX_NOINPUT; goto end; } @@ -146,7 +146,7 @@ create_one(struct hast_resource *res, in res->hr_localoff = METADATA_SIZE + mapsize; - if (metadata_write(res) < 0) { + if (metadata_write(res) == -1) { ec = EX_IOERR; goto end; } @@ -401,15 +401,15 @@ main(int argc, char *argv[]) debug++; break; case 'e': - if (expand_number(optarg, &extentsize) < 0) + if (expand_number(optarg, &extentsize) == -1) errx(EX_USAGE, "Invalid extentsize"); break; case 'k': - if (expand_number(optarg, &keepdirty) < 0) + if (expand_number(optarg, &keepdirty) == -1) errx(EX_USAGE, "Invalid keepdirty"); break; case 'm': - if (expand_number(optarg, &mediasize) < 0) + if (expand_number(optarg, &mediasize) == -1) errx(EX_USAGE, "Invalid mediasize"); break; case 'h': @@ -479,13 +479,13 @@ main(int argc, char *argv[]) } /* Setup control connection... */ - if (proto_client(NULL, cfg->hc_controladdr, &controlconn) < 0) { + if (proto_client(NULL, cfg->hc_controladdr, &controlconn) == -1) { pjdlog_exit(EX_OSERR, "Unable to setup control connection to %s", cfg->hc_controladdr); } /* ...and connect to hastd. */ - if (proto_connect(controlconn, HAST_TIMEOUT) < 0) { + if (proto_connect(controlconn, HAST_TIMEOUT) == -1) { pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", cfg->hc_controladdr); } @@ -494,14 +494,14 @@ main(int argc, char *argv[]) exit(EX_CONFIG); /* Send the command to the server... */ - if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) == -1) { pjdlog_exit(EX_UNAVAILABLE, "Unable to send command to hastd via %s", cfg->hc_controladdr); } nv_free(nv); /* ...and receive reply. */ - if (hast_proto_recv_hdr(controlconn, &nv) < 0) { + if (hast_proto_recv_hdr(controlconn, &nv) == -1) { pjdlog_exit(EX_UNAVAILABLE, "cannot receive reply from hastd via %s", cfg->hc_controladdr); Modified: stable/9/sbin/hastd/activemap.c ============================================================================== --- stable/9/sbin/hastd/activemap.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/activemap.c Sun Feb 5 15:51:19 2012 (r231017) @@ -219,7 +219,7 @@ keepdirty_add(struct activemap *amp, int kd = keepdirty_find(amp, extent); if (kd != NULL) { /* - * Only move element at the begining. + * Only move element at the beginning. */ TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); @@ -573,7 +573,7 @@ activemap_sync_rewind(struct activemap * return; } /* - * Mark that we want to start synchronization from the begining. + * Mark that we want to start synchronization from the beginning. */ amp->am_syncoff = -1; } Modified: stable/9/sbin/hastd/control.c ============================================================================== --- stable/9/sbin/hastd/control.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/control.c Sun Feb 5 15:51:19 2012 (r231017) @@ -115,7 +115,7 @@ control_set_role_common(struct hastd_con * doing that work. */ if (res->hr_workerpid != 0) { - if (kill(res->hr_workerpid, SIGTERM) < 0) { + if (kill(res->hr_workerpid, SIGTERM) == -1) { pjdlog_errno(LOG_WARNING, "Unable to kill worker process %u", (unsigned int)res->hr_workerpid); @@ -167,7 +167,7 @@ control_status_worker(struct hast_resour "Unable to prepare control header"); goto end; } - if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to send control header"); goto end; @@ -176,7 +176,7 @@ control_status_worker(struct hast_resour /* * Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to receive control header"); goto end; @@ -293,7 +293,7 @@ control_handle(struct hastd_config *cfg) uint8_t cmd, role; int error; - if (proto_accept(cfg->hc_controlconn, &conn) < 0) { + if (proto_accept(cfg->hc_controlconn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept control connection"); return; } @@ -302,7 +302,7 @@ control_handle(struct hastd_config *cfg) nvin = nvout = NULL; role = HAST_ROLE_UNDEF; - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive control header"); nvin = NULL; goto close; @@ -395,7 +395,7 @@ fail: if (error != 0) nv_add_int16(nvout, error, "error"); - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) pjdlog_errno(LOG_ERR, "Unable to send control response"); close: if (nvin != NULL) @@ -417,7 +417,7 @@ ctrl_thread(void *arg) uint8_t cmd; for (;;) { - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { if (sigexit_received) pthread_exit(NULL); pjdlog_errno(LOG_ERR, @@ -481,7 +481,7 @@ ctrl_thread(void *arg) nv_free(nvout); continue; } - if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reply to control message"); } Modified: stable/9/sbin/hastd/ebuf.c ============================================================================== --- stable/9/sbin/hastd/ebuf.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/ebuf.c Sun Feb 5 15:51:19 2012 (r231017) @@ -116,7 +116,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extend(eb, size) < 0) + if (ebuf_head_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -143,7 +143,7 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extend(eb, size) < 0) + if (ebuf_tail_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= Modified: stable/9/sbin/hastd/event.c ============================================================================== --- stable/9/sbin/hastd/event.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/event.c Sun Feb 5 15:51:19 2012 (r231017) @@ -61,11 +61,11 @@ event_send(const struct hast_resource *r "Unable to prepare event header"); goto done; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto done; } - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive event header"); goto done; } @@ -92,7 +92,7 @@ event_recv(const struct hast_resource *r nvin = nvout = NULL; - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { /* * First error log as debug. This is because worker process * most likely exited. @@ -145,7 +145,7 @@ event_recv(const struct hast_resource *r "Unable to prepare event header"); goto fail; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto fail; } Modified: stable/9/sbin/hastd/hast.conf.5 ============================================================================== --- stable/9/sbin/hastd/hast.conf.5 Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast.conf.5 Sun Feb 5 15:51:19 2012 (r231017) @@ -1,8 +1,8 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" Copyright (c) 2010-2011 Pawel Jakub Dawidek +.\" Copyright (c) 2010-2012 Pawel Jakub Dawidek .\" All rights reserved. .\" -.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2011 +.Dd January 25, 2012 .Dt HAST.CONF 5 .Os .Sh NAME @@ -389,7 +389,9 @@ statement. .Bl -tag -width ".Pa /var/run/hastctl" -compact .It Pa /etc/hast.conf The default -.Nm +.Xr hastctl 8 +and +.Xr hastd 8 configuration file. .It Pa /var/run/hastctl Control socket used by the Modified: stable/9/sbin/hastd/hast_compression.c ============================================================================== --- stable/9/sbin/hastd/hast_compression.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast_compression.c Sun Feb 5 15:51:19 2012 (r231017) @@ -55,7 +55,7 @@ allzeros(const void *data, size_t size) * Because inside the loop we don't check at every step, we would * get an answer only after walking through entire buffer. * To return early if the buffer doesn't contain all zeros, we probe - * 8 bytes at the begining, in the middle and at the end of the buffer + * 8 bytes at the beginning, in the middle and at the end of the buffer * first. */ Modified: stable/9/sbin/hastd/hast_proto.c ============================================================================== --- stable/9/sbin/hastd/hast_proto.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast_proto.c Sun Feb 5 15:51:19 2012 (r231017) @@ -114,13 +114,13 @@ hast_proto_send(const struct hast_resour hdr.version = HAST_PROTO_VERSION; hdr.size = htole32((uint32_t)ebuf_size(eb)); - if (ebuf_add_head(eb, &hdr, sizeof(hdr)) < 0) + if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1) goto end; hptr = ebuf_data(eb, &hsize); - if (proto_send(conn, hptr, hsize) < 0) + if (proto_send(conn, hptr, hsize) == -1) goto end; - if (data != NULL && proto_send(conn, dptr, size) < 0) + if (data != NULL && proto_send(conn, dptr, size) == -1) goto end; ret = 0; @@ -141,7 +141,7 @@ hast_proto_recv_hdr(const struct proto_c eb = NULL; nv = NULL; - if (proto_recv(conn, &hdr, sizeof(hdr)) < 0) + if (proto_recv(conn, &hdr, sizeof(hdr)) == -1) goto fail; if (hdr.version != HAST_PROTO_VERSION) { @@ -154,11 +154,11 @@ hast_proto_recv_hdr(const struct proto_c eb = ebuf_alloc(hdr.size); if (eb == NULL) goto fail; - if (ebuf_add_tail(eb, NULL, hdr.size) < 0) + if (ebuf_add_tail(eb, NULL, hdr.size) == -1) goto fail; hptr = ebuf_data(eb, NULL); PJDLOG_ASSERT(hptr != NULL); - if (proto_recv(conn, hptr, hdr.size) < 0) + if (proto_recv(conn, hptr, hdr.size) == -1) goto fail; nv = nv_ntoh(eb); if (nv == NULL) @@ -196,7 +196,7 @@ hast_proto_recv_data(const struct hast_r } else if (dsize == 0) { (void)nv_set_error(nv, 0); } else { - if (proto_recv(conn, data, dsize) < 0) + if (proto_recv(conn, data, dsize) == -1) goto end; for (ii = sizeof(pipeline) / sizeof(pipeline[0]); ii > 0; ii--) { Modified: stable/9/sbin/hastd/hastd.c ============================================================================== --- stable/9/sbin/hastd/hastd.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hastd.c Sun Feb 5 15:51:19 2012 (r231017) @@ -68,6 +68,8 @@ static struct hastd_config *cfg; bool sigexit_received = false; /* PID file handle. */ struct pidfh *pfh; +/* Do we run in foreground? */ +static bool foreground; /* How often check for hooks running for too long. */ #define REPORT_INTERVAL 5 @@ -97,10 +99,10 @@ g_gate_load(void) void descriptors_cleanup(struct hast_resource *res) { - struct hast_resource *tres; + struct hast_resource *tres, *tmres; struct hastd_listen *lst; - TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { + TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) { if (tres == res) { PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY || (res->hr_remotein == NULL && @@ -117,13 +119,17 @@ descriptors_cleanup(struct hast_resource proto_close(tres->hr_event); if (tres->hr_conn != NULL) proto_close(tres->hr_conn); + TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next); + free(tres); } if (cfg->hc_controlin != NULL) proto_close(cfg->hc_controlin); proto_close(cfg->hc_controlconn); - TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) { + TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next); if (lst->hl_conn != NULL) proto_close(lst->hl_conn); + free(lst); } (void)pidfile_close(pfh); hook_fini(); @@ -172,7 +178,7 @@ descriptors_assert(const struct hast_res msg[0] = '\0'; maxfd = sysconf(_SC_OPEN_MAX); - if (maxfd < 0) { + if (maxfd == -1) { pjdlog_init(pjdlogmode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); @@ -450,7 +456,7 @@ resource_reload(const struct hast_resour pjdlog_error("Unable to allocate header for reload message."); return; } - if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reload message"); nv_free(nvout); return; @@ -458,7 +464,7 @@ resource_reload(const struct hast_resour nv_free(nvout); /* Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive reload reply"); return; } @@ -494,7 +500,7 @@ hastd_reload(void) */ if (strcmp(cfg->hc_controladdr, newcfg->hc_controladdr) != 0) { if (proto_server(newcfg->hc_controladdr, - &newcfg->hc_controlconn) < 0) { + &newcfg->hc_controlconn) == -1) { pjdlog_errno(LOG_ERR, "Unable to listen on control address %s", newcfg->hc_controladdr); @@ -531,7 +537,7 @@ hastd_reload(void) /* * Check if pidfile's path has changed. */ - if (strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { + if (!foreground && strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { newpfh = pidfile_open(newcfg->hc_pidfile, 0600, &otherpid); if (newpfh == NULL) { if (errno == EEXIST) { @@ -543,7 +549,7 @@ hastd_reload(void) "Unable to open or create pidfile %s", newcfg->hc_pidfile); } - } else if (pidfile_write(newpfh) < 0) { + } else if (pidfile_write(newpfh) == -1) { /* Write PID to a file. */ pjdlog_errno(LOG_WARNING, "Unable to write PID to file %s", @@ -571,10 +577,14 @@ hastd_reload(void) /* * Switch to new pidfile. */ - (void)pidfile_remove(pfh); - pfh = newpfh; - (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, - sizeof(cfg->hc_pidfile)); + if (newpfh != NULL) { + pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile, + newcfg->hc_pidfile); + (void)pidfile_remove(pfh); + pfh = newpfh; + (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, + sizeof(cfg->hc_pidfile)); + } /* * Switch to new listen addresses. Close all that were removed. */ @@ -742,7 +752,7 @@ listen_accept(struct hastd_listen *lst) proto_local_address(lst->hl_conn, laddr, sizeof(laddr)); pjdlog_debug(1, "Accepting connection to %s.", laddr); - if (proto_accept(lst->hl_conn, &conn) < 0) { + if (proto_accept(lst->hl_conn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept connection %s", laddr); return; } @@ -752,7 +762,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, HAST_TIMEOUT) < 0) + if (proto_timeout(conn, HAST_TIMEOUT) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvin = nvout = nverr = NULL; @@ -771,7 +781,7 @@ listen_accept(struct hastd_listen *lst) } /* Ok, remote host can access at least one resource. */ - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive header from %s", raddr); goto close; @@ -786,7 +796,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_debug(2, "%s: resource=%s", raddr, resname); token = nv_get_uint8_array(nvin, &size, "token"); /* - * NULL token means that this is first conection. + * NULL token means that this is first connection. */ if (token != NULL && size != sizeof(res->hr_token)) { pjdlog_error("Received token of invalid size from %s (expected %zu, got %zu).", @@ -859,7 +869,7 @@ listen_accept(struct hastd_listen *lst) "Worker process exists (pid=%u), stopping it.", (unsigned int)res->hr_workerpid); /* Stop child process. */ - if (kill(res->hr_workerpid, SIGINT) < 0) { + if (kill(res->hr_workerpid, SIGINT) == -1) { pjdlog_errno(LOG_ERR, "Unable to stop worker process (pid=%u)", (unsigned int)res->hr_workerpid); @@ -909,7 +919,7 @@ listen_accept(struct hastd_listen *lst) strerror(nv_error(nvout))); goto fail; } - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) { int error = errno; pjdlog_errno(LOG_ERR, "Unable to send response to %s", @@ -938,7 +948,7 @@ fail: "Unable to prepare error header for %s", raddr); goto close; } - if (hast_proto_send(NULL, conn, nverr, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nverr, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send error to %s", raddr); goto close; } @@ -963,20 +973,20 @@ connection_migrate(struct hast_resource PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive connection command"); return; } if (proto_client(res->hr_sourceaddr[0] != '\0' ? res->hr_sourceaddr : NULL, - res->hr_remoteaddr, &conn) < 0) { + res->hr_remoteaddr, &conn) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to create outgoing connection to %s", res->hr_remoteaddr); goto out; } - if (proto_connect(conn, -1) < 0) { + if (proto_connect(conn, -1) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); @@ -985,11 +995,11 @@ connection_migrate(struct hast_resource } val = 0; out: - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send reply to connection request"); } - if (val == 0 && proto_connection_send(res->hr_conn, conn) < 0) + if (val == 0 && proto_connection_send(res->hr_conn, conn) == -1) pjdlog_errno(LOG_WARNING, "Unable to send connection"); pjdlog_prefix_set("%s", ""); @@ -1155,7 +1165,6 @@ main(int argc, char *argv[]) struct hastd_listen *lst; const char *pidfile; pid_t otherpid; - bool foreground; int debuglevel; sigset_t mask; @@ -1220,16 +1229,23 @@ main(int argc, char *argv[]) pjdlog_exitx(EX_CONFIG, "Pidfile path is too long."); } } - pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - pjdlog_exitx(EX_TEMPFAIL, - "Another hastd is already running, pidfile: %s, pid: %jd.", - cfg->hc_pidfile, (intmax_t)otherpid); - } - /* If we cannot create pidfile for other reasons, only warn. */ - pjdlog_errno(LOG_WARNING, "Unable to open or create pidfile %s", - cfg->hc_pidfile); + + if (!foreground) { + pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + pjdlog_exitx(EX_TEMPFAIL, + "Another hastd is already running, pidfile: %s, pid: %jd.", + cfg->hc_pidfile, (intmax_t)otherpid); + } + /* + * If we cannot create pidfile for other reasons, + * only warn. + */ + pjdlog_errno(LOG_WARNING, + "Unable to open or create pidfile %s", + cfg->hc_pidfile); + } } /* @@ -1253,14 +1269,14 @@ main(int argc, char *argv[]) PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Listen on control address. */ - if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) < 0) { + if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on control address %s", cfg->hc_controladdr); } /* Listen for remote connections. */ TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { - if (proto_server(lst->hl_addr, &lst->hl_conn) < 0) { + if (proto_server(lst->hl_addr, &lst->hl_conn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on address %s", lst->hl_addr); @@ -1268,7 +1284,7 @@ main(int argc, char *argv[]) } if (!foreground) { - if (daemon(0, 0) < 0) { + if (daemon(0, 0) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to daemonize"); } @@ -1277,7 +1293,7 @@ main(int argc, char *argv[]) pjdlog_mode_set(PJDLOG_MODE_SYSLOG); /* Write PID to a file. */ - if (pidfile_write(pfh) < 0) { + if (pidfile_write(pfh) == -1) { pjdlog_errno(LOG_WARNING, "Unable to write PID to a file %s", cfg->hc_pidfile); Modified: stable/9/sbin/hastd/hooks.c ============================================================================== --- stable/9/sbin/hastd/hooks.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hooks.c Sun Feb 5 15:51:19 2012 (r231017) @@ -105,26 +105,26 @@ descriptors(void) * Redirect stdin, stdout and stderr to /dev/null. */ fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for reading", _PATH_DEVNULL); } else if (fd != STDIN_FILENO) { - if (dup2(fd, STDIN_FILENO) < 0) { + if (dup2(fd, STDIN_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdin"); } close(fd); } fd = open(_PATH_DEVNULL, O_WRONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for writing", _PATH_DEVNULL); } else { - if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) < 0) { + if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdout"); } - if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) < 0) { + if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stderr"); } Modified: stable/9/sbin/hastd/lzf.h ============================================================================== --- stable/9/sbin/hastd/lzf.h Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/lzf.h Sun Feb 5 15:51:19 2012 (r231017) @@ -146,7 +146,7 @@ lzf_decompress (const void *const in_dat /* * Avoid assigning values to errno variable? for some embedding purposes - * (linux kernel for example), this is neccessary. NOTE: this breaks + * (linux kernel for example), this is necessary. NOTE: this breaks * the documentation in lzf.h. */ #ifndef AVOID_ERRNO @@ -167,7 +167,7 @@ lzf_decompress (const void *const in_dat * and return EINVAL if the input stream has been corrupted. This * only shields against overflowing the input buffer and will not * detect most corrupted streams. - * This check is not normally noticable on modern hardware + * This check is not normally noticeable on modern hardware * (<1% slowdown), but might slow down older cpus considerably. */ #ifndef CHECK_INPUT Modified: stable/9/sbin/hastd/metadata.c ============================================================================== --- stable/9/sbin/hastd/metadata.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/metadata.c Sun Feb 5 15:51:19 2012 (r231017) @@ -61,14 +61,14 @@ metadata_read(struct hast_resource *res, * Is this first metadata_read() call for this resource? */ if (res->hr_localfd == -1) { - if (provinfo(res, openrw) < 0) { + if (provinfo(res, openrw) == -1) { rerrno = errno; goto fail; } opened_here = true; pjdlog_debug(1, "Obtained info about %s.", res->hr_localpath); if (openrw) { - if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) < 0) { + if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) == -1) { rerrno = errno; if (errno == EOPNOTSUPP) { pjdlog_warning("Unable to lock %s (operation not supported), but continuing.", @@ -91,7 +91,7 @@ metadata_read(struct hast_resource *res, "Unable to allocate memory to read metadata"); goto fail; } - if (ebuf_add_tail(eb, NULL, METADATA_SIZE) < 0) { + if (ebuf_add_tail(eb, NULL, METADATA_SIZE) == -1) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); @@ -101,7 +101,7 @@ metadata_read(struct hast_resource *res, buf = ebuf_data(eb, NULL); PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to read metadata"); ebuf_free(eb); @@ -213,7 +213,7 @@ metadata_write(struct hast_resource *res PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); goto end; } Modified: stable/9/sbin/hastd/nv.c ============================================================================== --- stable/9/sbin/hastd/nv.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/nv.c Sun Feb 5 15:51:19 2012 (r231017) @@ -385,7 +385,7 @@ nv_ntoh(struct ebuf *eb) nv->nv_ebuf = eb; nv->nv_magic = NV_MAGIC; - if (nv_validate(nv, &extra) < 0) { + if (nv_validate(nv, &extra) == -1) { rerrno = errno; nv->nv_magic = 0; free(nv); @@ -480,7 +480,7 @@ nv_add_stringv(struct nv *nv, const char ssize_t size; size = vasprintf(&value, valuefmt, valueap); - if (size < 0) { + if (size == -1) { if (nv->nv_error == 0) nv->nv_error = ENOMEM; return; @@ -627,7 +627,7 @@ nv_dump(struct nv *nv) unsigned int ii; bool swap; - if (nv_validate(nv, NULL) < 0) { + if (nv_validate(nv, NULL) == -1) { printf("error: %d\n", errno); return; } @@ -784,7 +784,7 @@ nv_add(struct nv *nv, const unsigned cha bcopy(name, nvh->nvh_name, namesize); /* Add header first. */ - if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -793,7 +793,7 @@ nv_add(struct nv *nv, const unsigned cha } free(nvh); /* Add the actual data. */ - if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, value, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -804,7 +804,7 @@ nv_add(struct nv *nv, const unsigned cha if (vsize == 0) return; PJDLOG_ASSERT(vsize > 0 && vsize <= sizeof(align)); - if (ebuf_add_tail(nv->nv_ebuf, align, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, align, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; Modified: stable/9/sbin/hastd/parse.y ============================================================================== --- stable/9/sbin/hastd/parse.y Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/parse.y Sun Feb 5 15:51:19 2012 (r231017) @@ -85,7 +85,7 @@ isitme(const char *name) size_t bufsize; /* - * First check if the give name matches our full hostname. + * First check if the given name matches our full hostname. */ if (gethostname(buf, sizeof(buf)) < 0) { pjdlog_errno(LOG_ERR, "gethostname() failed"); @@ -369,8 +369,8 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL PIDFILE LISTEN PORT REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB @@ -812,6 +812,7 @@ resource_start: STR sizeof(curres->hr_name)) >= sizeof(curres->hr_name)) { pjdlog_error("Resource name is too long."); + free(curres); free($1); return (1); } Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/primary.c Sun Feb 5 15:51:19 2012 (r231017) @@ -254,7 +254,7 @@ cleanup(struct hast_resource *res) ggiod.gctl_version = G_GATE_VERSION; ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) == -1) { pjdlog_errno(LOG_WARNING, "Unable to destroy hast/%s device", res->hr_provname); @@ -451,7 +451,7 @@ init_resuid(struct hast_resource *res) /* Initialize unique resource identifier. */ arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); mtx_unlock(&metadata_lock); - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); return (true); } @@ -463,19 +463,19 @@ init_local(struct hast_resource *res) unsigned char *buf; size_t mapsize; - if (metadata_read(res, true) < 0) + if (metadata_read(res, true) == -1) exit(EX_NOINPUT); mtx_init(&res->hr_amp_lock); if (activemap_init(&res->hr_amp, res->hr_datasize, res->hr_extentsize, - res->hr_local_sectorsize, res->hr_keepdirty) < 0) { + res->hr_local_sectorsize, res->hr_keepdirty) == -1) { primary_exit(EX_TEMPFAIL, "Unable to create activemap"); } mtx_init(&range_lock); cv_init(&range_regular_cond); - if (rangelock_init(&range_regular) < 0) + if (rangelock_init(&range_regular) == -1) primary_exit(EX_TEMPFAIL, "Unable to create regular range lock"); cv_init(&range_sync_cond); - if (rangelock_init(&range_sync) < 0) + if (rangelock_init(&range_sync) == -1) primary_exit(EX_TEMPFAIL, "Unable to create sync range lock"); mapsize = activemap_ondisk_size(res->hr_amp); buf = calloc(1, mapsize); @@ -500,7 +500,7 @@ init_local(struct hast_resource *res) */ res->hr_primary_localcnt = 0; res->hr_primary_remotecnt = 0; - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); } @@ -511,11 +511,11 @@ primary_connect(struct hast_resource *re int16_t val; val = 1; - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to send connection request to parent"); } - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive reply to connection request from parent"); } @@ -525,18 +525,18 @@ primary_connect(struct hast_resource *re res->hr_remoteaddr); return (-1); } - if (proto_connection_recv(res->hr_conn, true, &conn) < 0) { + if (proto_connection_recv(res->hr_conn, true, &conn) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive connection from parent"); } - if (proto_connect_wait(conn, res->hr_timeout) < 0) { + if (proto_connect_wait(conn, res->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); proto_close(conn); return (-1); } /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, res->hr_timeout) < 0) + if (proto_timeout(conn, res->hr_timeout) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); *connp = conn; @@ -583,7 +583,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -591,7 +591,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -655,7 +655,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -663,7 +663,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -726,7 +726,7 @@ init_remote(struct hast_resource *res, s * download its activemap. */ if (hast_proto_recv_data(res, out, nvin, map, - mapsize) < 0) { + mapsize) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); nv_free(nvin); @@ -801,7 +801,7 @@ init_ggate(struct hast_resource *res) * We communicate with ggate via /dev/ggctl. Open it. */ res->hr_ggatefd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); - if (res->hr_ggatefd < 0) + if (res->hr_ggatefd == -1) primary_exit(EX_OSFILE, "Unable to open /dev/" G_GATE_CTL_NAME); /* * Create provider before trying to connect, as connection failure @@ -859,7 +859,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending control commands from * parent to child. */ - if (proto_client(NULL, "socketpair://", &res->hr_ctrl) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_ctrl) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -868,7 +868,7 @@ hastd_primary(struct hast_resource *res) /* * Create communication channel for sending events from child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_event) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_event) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -878,7 +878,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending connection requests from * child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_conn) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_conn) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res) } pid = fork(); - if (pid < 0) { + if (pid == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); @@ -933,7 +933,7 @@ hastd_primary(struct hast_resource *res) /* * Create the guard thread first, so we can handle signals from the - * very begining. + * very beginning. */ error = pthread_create(&td, NULL, guard_thread, res); PJDLOG_ASSERT(error == 0); @@ -1095,7 +1095,7 @@ write_complete(struct hast_resource *res mtx_unlock(&metadata_lock); } rw_unlock(&hio_remote_lock[ncomp]); - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) < 0) + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) == -1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 16:08:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C13106566C; Sun, 5 Feb 2012 16:08:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5058FC08; Sun, 5 Feb 2012 16:08:46 +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 q15G8jeZ090307; Sun, 5 Feb 2012 16:08:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15G8jqp090305; Sun, 5 Feb 2012 16:08:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051608.q15G8jqp090305@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231020 - stable/9/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:08:46 -0000 Author: nwhitehorn Date: Sun Feb 5 16:08:45 2012 New Revision: 231020 URL: http://svn.freebsd.org/changeset/base/231020 Log: MFC r230309: Warn if trying to install over an existing partition, which usually fails anyway due to libarchive not being able to overwrite schg flags. PR: bin/164278 Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/partedit/partedit.c Sun Feb 5 15:59:18 2012 (r231019) +++ stable/9/usr.sbin/bsdinstall/partedit/partedit.c Sun Feb 5 16:08:45 2012 (r231020) @@ -240,23 +240,41 @@ delete_part_metadata(const char *name) static int validate_setup(void) { - struct partition_metadata *md; - int root_found = FALSE; + struct partition_metadata *md, *root = NULL; + int cancel; TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) - root_found = TRUE; + root = md; /* XXX: Check for duplicate mountpoints */ } - if (!root_found) { + if (root == NULL) { dialog_msgbox("Error", "No root partition was found. " "The root FreeBSD partition must have a mountpoint of '/'.", 0, 0, TRUE); return (FALSE); } + /* + * Check for root partitions that we aren't formatting, which is + * usually a mistake + */ + if (root->newfs == NULL) { + dialog_vars.defaultno = TRUE; + cancel = dialog_yesno("Warning", "The chosen root partition " + "has a preexisting filesystem. If it contains an existing " + "FreeBSD system, please update it with freebsd-update " + "instead of installing a new system on it. The partition " + "can also be erased by pressing \"No\" and then deleting " + "and recreating it. Are you sure you want to proceed?", + 0, 0); + dialog_vars.defaultno = FALSE; + if (cancel) + return (FALSE); + } + return (TRUE); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 16:14:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB882106564A; Sun, 5 Feb 2012 16:14:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE1B8FC12; Sun, 5 Feb 2012 16:14: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 q15GENrq090541; Sun, 5 Feb 2012 16:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GENlt090538; Sun, 5 Feb 2012 16:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051614.q15GENlt090538@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231021 - in stable/9/sys/powerpc: ofw powermac X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:14:23 -0000 Author: nwhitehorn Date: Sun Feb 5 16:14:23 2012 New Revision: 231021 URL: http://svn.freebsd.org/changeset/base/231021 Log: MFC r230398: Prevent an error resulting from signed/unsigned comparison on systems that do not comply with the OF spec. Submitted by: Anders Gavare Modified: stable/9/sys/powerpc/ofw/ofw_machdep.c stable/9/sys/powerpc/powermac/macio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_machdep.c Sun Feb 5 16:08:45 2012 (r231020) +++ stable/9/sys/powerpc/ofw/ofw_machdep.c Sun Feb 5 16:14:23 2012 (r231021) @@ -171,10 +171,10 @@ parse_ofw_memory(phandle_t node, const c */ phandle = OF_finddevice("/"); if (OF_getprop(phandle, "#address-cells", &address_cells, - sizeof(address_cells)) < sizeof(address_cells)) + sizeof(address_cells)) < (ssize_t)sizeof(address_cells)) address_cells = 1; if (OF_getprop(phandle, "#size-cells", &size_cells, - sizeof(size_cells)) < sizeof(size_cells)) + sizeof(size_cells)) < (ssize_t)sizeof(size_cells)) size_cells = 1; /* Modified: stable/9/sys/powerpc/powermac/macio.c ============================================================================== --- stable/9/sys/powerpc/powermac/macio.c Sun Feb 5 16:08:45 2012 (r231020) +++ stable/9/sys/powerpc/powermac/macio.c Sun Feb 5 16:14:23 2012 (r231021) @@ -293,7 +293,7 @@ macio_attach(device_t dev) * Locate the device node and it's base address */ if (OF_getprop(root, "assigned-addresses", - reg, sizeof(reg)) < sizeof(reg)) { + reg, sizeof(reg)) < (ssize_t)sizeof(reg)) { return (ENXIO); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 16:17:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F8D1065690; Sun, 5 Feb 2012 16:17:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46B698FC0C; Sun, 5 Feb 2012 16:17:15 +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 q15GHFEo090699; Sun, 5 Feb 2012 16:17:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GHF6Q090697; Sun, 5 Feb 2012 16:17:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051617.q15GHF6Q090697@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231022 - stable/9/sys/powerpc/ps3 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:17:15 -0000 Author: nwhitehorn Date: Sun Feb 5 16:17:14 2012 New Revision: 231022 URL: http://svn.freebsd.org/changeset/base/231022 Log: Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be usefully loaded and unloaded as modules. Submitted by: geoffrey dot levand at mail dot ru Modified: stable/9/sys/powerpc/ps3/ps3pic.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/powerpc/ps3/ps3pic.c ============================================================================== --- stable/9/sys/powerpc/ps3/ps3pic.c Sun Feb 5 16:14:23 2012 (r231021) +++ stable/9/sys/powerpc/ps3/ps3pic.c Sun Feb 5 16:17:14 2012 (r231022) @@ -62,6 +62,7 @@ struct ps3pic_softc { volatile uint64_t *mask_thread1; uint64_t sc_ipi_outlet[2]; + uint64_t sc_ipi_virq; int sc_vector[64]; }; @@ -131,20 +132,23 @@ ps3pic_attach(device_t dev) thread = 32 - fls(mfctrl()); lv1_configure_irq_state_bitmap(ppe, thread, vtophys(sc->bitmap_thread0)); + + sc->sc_ipi_virq = 63; + #ifdef SMP lv1_configure_irq_state_bitmap(ppe, !thread, vtophys(sc->bitmap_thread1)); /* Map both IPIs to the same VIRQ to avoid changes in intr_machdep */ lv1_construct_event_receive_port(&sc->sc_ipi_outlet[0]); - lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[0], 0); lv1_construct_event_receive_port(&sc->sc_ipi_outlet[1]); - lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[1], 0); #endif - powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE); + powerpc_register_pic(dev, 0, sc->sc_ipi_virq, 1, FALSE); return (0); } @@ -216,7 +220,7 @@ ps3pic_mask(device_t dev, u_int irq) sc = device_get_softc(dev); /* Do not mask IPIs! */ - if (irq == sc->sc_ipi_outlet[0]) + if (irq == sc->sc_ipi_virq) return; atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq)); From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 16:23:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37F55106564A; Sun, 5 Feb 2012 16:23:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264D98FC12; Sun, 5 Feb 2012 16:23:56 +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 q15GNuOw090978; Sun, 5 Feb 2012 16:23:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GNtZP090976; Sun, 5 Feb 2012 16:23:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051623.q15GNtZP090976@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231023 - stable/9/sys/vm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:23:56 -0000 Author: nwhitehorn Date: Sun Feb 5 16:23:55 2012 New Revision: 231023 URL: http://svn.freebsd.org/changeset/base/231023 Log: MFC r230247: Revert r212360 now that PowerPC can handle large sparse arguments to pmap_remove() (changed in r228412). Modified: stable/9/sys/vm/vm_pageout.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/vm/vm_pageout.c ============================================================================== --- stable/9/sys/vm/vm_pageout.c Sun Feb 5 16:17:14 2012 (r231022) +++ stable/9/sys/vm/vm_pageout.c Sun Feb 5 16:23:55 2012 (r231023) @@ -714,11 +714,8 @@ vm_pageout_map_deactivate_pages(map, des * table pages. */ if (desired == 0 && nothingwired) { - tmpe = map->header.next; - while (tmpe != &map->header) { - pmap_remove(vm_map_pmap(map), tmpe->start, tmpe->end); - tmpe = tmpe->next; - } + pmap_remove(vm_map_pmap(map), vm_map_min(map), + vm_map_max(map)); } vm_map_unlock(map); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 18:16:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B540106566C; Sun, 5 Feb 2012 18:16:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399C08FC08; Sun, 5 Feb 2012 18:16:39 +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 q15IGd2C094704; Sun, 5 Feb 2012 18:16:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IGdUY094702; Sun, 5 Feb 2012 18:16:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051816.q15IGdUY094702@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 18:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231028 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:16:39 -0000 Author: tuexen Date: Sun Feb 5 18:16:38 2012 New Revision: 231028 URL: http://svn.freebsd.org/changeset/base/231028 Log: MFC r228102: Remove debug code. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Feb 5 17:37:26 2012 (r231027) +++ stable/9/sys/netinet/sctp_pcb.c Sun Feb 5 18:16:38 2012 (r231028) @@ -6918,11 +6918,6 @@ skip_vtag_check: return (1); } - -static sctp_assoc_t reneged_asoc_ids[256]; -static uint8_t reneged_at = 0; - - static void sctp_drain_mbufs(struct sctp_inpcb *inp, struct sctp_tcb *stcb) { @@ -7027,8 +7022,6 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* sa_ignore NO_NULL_CHK */ sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN, SCTP_SO_NOT_LOCKED); - reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); - reneged_at++; } /* * Another issue, in un-setting the TSN's in the mapping array we From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 18:21:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99081106564A; Sun, 5 Feb 2012 18:21:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 874798FC14; Sun, 5 Feb 2012 18:21:04 +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 q15IL4lS094889; Sun, 5 Feb 2012 18:21:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IL4TS094886; Sun, 5 Feb 2012 18:21:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051821.q15IL4TS094886@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 18:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231029 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:21:04 -0000 Author: tuexen Date: Sun Feb 5 18:21:03 2012 New Revision: 231029 URL: http://svn.freebsd.org/changeset/base/231029 Log: MFC r228391: Fix a bug reported by Irene Ruengeler which resulted in not sending out HEARTBEATs when requested by the user. The HEARTBEATs were only queued, but not actually sent out. Modified: stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 18:16:38 2012 (r231028) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 18:21:03 2012 (r231029) @@ -391,6 +391,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_OUTPUT_FROM_COOKIE_ACK 14 #define SCTP_OUTPUT_FROM_DRAIN 15 #define SCTP_OUTPUT_FROM_CLOSING 16 +#define SCTP_OUTPUT_FROM_SOCKOPT 17 + /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 18:16:38 2012 (r231028) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 18:21:03 2012 (r231029) @@ -4642,6 +4642,7 @@ sctp_setopt(struct socket *so, int optna if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ sctp_send_hb(stcb, net, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 18:39:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F61106566B; Sun, 5 Feb 2012 18:39:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB228FC0C; Sun, 5 Feb 2012 18:39: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 q15IdBcK095554; Sun, 5 Feb 2012 18:39:11 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IdBLH095551; Sun, 5 Feb 2012 18:39:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051839.q15IdBLH095551@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 18:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231030 - in stable/9: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:39:12 -0000 Author: sbruno Date: Sun Feb 5 18:39:11 2012 New Revision: 231030 URL: http://svn.freebsd.org/changeset/base/231030 Log: MFC r230313, r230316, r230323, r230588 Support new raid controllers Modified: stable/9/share/man/man4/ciss.4 stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/share/man/man4/ciss.4 ============================================================================== --- stable/9/share/man/man4/ciss.4 Sun Feb 5 18:21:03 2012 (r231029) +++ stable/9/share/man/man4/ciss.4 Sun Feb 5 18:39:11 2012 (r231030) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 3, 2005 +.Dd January 26, 2012 .Dt CISS 4 .Os .Sh NAME @@ -121,6 +121,10 @@ HP Smart Array E200i .It HP Smart Array P212 .It +HP Smart Array P220i +.It +HP Smart Array P222 +.It HP Smart Array P400 .It HP Smart Array P400i @@ -131,8 +135,16 @@ HP Smart Array P410i .It HP Smart Array P411 .It +HP Smart Array P420 +.It +HP Smart Array P420i +.It +HP Smart Array P421 +.It HP Smart Array P600 .It +HP Smart Array P721m +.It HP Smart Array P800 .It HP Smart Array P812 Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Sun Feb 5 18:21:03 2012 (r231029) +++ stable/9/sys/dev/ciss/ciss.c Sun Feb 5 18:39:11 2012 (r231030) @@ -328,6 +328,13 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3350, CISS_BOARD_SA5, "HP Smart Array P222" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3352, CISS_BOARD_SA5, "HP Smart Array P421" }, + { 0x103C, 0x3353, CISS_BOARD_SA5, "HP Smart Array P822" }, + { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, + { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, + { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, { 0, 0, 0, NULL } }; @@ -4534,7 +4541,8 @@ ciss_ioctl(struct cdev *dev, u_long cmd, pis->bus = pci_get_bus(sc->ciss_dev); pis->dev_fn = pci_get_slot(sc->ciss_dev); - pis->board_id = pci_get_devid(sc->ciss_dev); + pis->board_id = (pci_get_subvendor(sc->ciss_dev) << 16) | + pci_get_subdevice(sc->ciss_dev); break; } From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:29:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B995D106566B; Sun, 5 Feb 2012 19:29:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3C538FC19; Sun, 5 Feb 2012 19:29:15 +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 q15JTF4F097330; Sun, 5 Feb 2012 19:29:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JTFLS097328; Sun, 5 Feb 2012 19:29:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051929.q15JTFLS097328@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231034 - stable/9/lib/libc/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:29:15 -0000 Author: tuexen Date: Sun Feb 5 19:29:14 2012 New Revision: 231034 URL: http://svn.freebsd.org/changeset/base/231034 Log: MFC 228531: Fix a bug where sctp_sendmdg() uses uninitialized memory. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:22:20 2012 (r231033) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:29:14 2012 (r231034) @@ -560,6 +560,7 @@ sctp_sendmsg(int s, #ifdef SYS_sctp_generic_sendmsg struct sctp_sndrcvinfo sinfo; + memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); sinfo.sinfo_ppid = ppid; sinfo.sinfo_flags = flags; sinfo.sinfo_stream = stream_no; From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:30:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 232CB106566C; Sun, 5 Feb 2012 19:30:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D94D8FC15; Sun, 5 Feb 2012 19:30:19 +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 q15JUIrh097405; Sun, 5 Feb 2012 19:30:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JUIZY097403; Sun, 5 Feb 2012 19:30:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051930.q15JUIZY097403@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231035 - stable/9/sys/boot/i386/libi386 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:30:19 -0000 Author: sbruno Date: Sun Feb 5 19:30:18 2012 New Revision: 231035 URL: http://svn.freebsd.org/changeset/base/231035 Log: MFC r230325 Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT Modified: stable/9/sys/boot/i386/libi386/pxe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/pxe.c ============================================================================== --- stable/9/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:29:14 2012 (r231034) +++ stable/9/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:30:18 2012 (r231035) @@ -405,6 +405,7 @@ pxe_perror(int err) return; } +#ifdef LOADER_NFS_SUPPORT /* * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. @@ -515,6 +516,7 @@ pxe_setnfshandle(char *rootpath) setenv("boot.nfsroot.nfshandlelen", buf, 1); } #endif /* OLD_NFSV2 */ +#endif /* LOADER_NFS_SUPPORT */ void pxenv_call(int func) From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:33:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397861065673; Sun, 5 Feb 2012 19:33:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFE68FC13; Sun, 5 Feb 2012 19:33:54 +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 q15JXr08097588; Sun, 5 Feb 2012 19:33:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JXrrS097586; Sun, 5 Feb 2012 19:33:53 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051933.q15JXrrS097586@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231036 - stable/9/lib/libc/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:33:54 -0000 Author: tuexen Date: Sun Feb 5 19:33:53 2012 New Revision: 231036 URL: http://svn.freebsd.org/changeset/base/231036 Log: MFC r228630: Address warnings found by clang. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:30:18 2012 (r231035) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:33:53 2012 (r231036) @@ -245,7 +245,8 @@ sctp_bindx(int sd, struct sockaddr *addr struct sockaddr *sa; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; - int i, sz, argsz; + int i; + size_t argsz; uint16_t sport = 0; /* validate the flags */ @@ -269,7 +270,6 @@ sctp_bindx(int sd, struct sockaddr *addr /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -307,7 +307,7 @@ sctp_bindx(int sd, struct sockaddr *addr goto out_error; } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } sa = addrs; /* @@ -319,7 +319,6 @@ sctp_bindx(int sd, struct sockaddr *addr sin->sin_port = sport; } for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -335,13 +334,13 @@ sctp_bindx(int sd, struct sockaddr *addr } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; - memcpy(gaddrs->addr, sa, sz); + memcpy(gaddrs->addr, sa, sa->sa_len); if (setsockopt(sd, IPPROTO_SCTP, flags, gaddrs, (socklen_t) argsz) != 0) { free(gaddrs); return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } free(gaddrs); return (0); @@ -427,10 +426,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, { struct sctp_getaddresses *addrs; struct sockaddr *sa; - struct sockaddr *re; sctp_assoc_t asoc; caddr_t lim; - socklen_t siz; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -438,30 +436,28 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, return (-1); } asoc = id; - siz = sizeof(sctp_assoc_t); + opt_len = (socklen_t) sizeof(sctp_assoc_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, - &asoc, &siz) != 0) { + &asoc, &opt_len) != 0) { return (-1); } /* size required is returned in 'asoc' */ - siz = (size_t)asoc; - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { return (-1); } addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDRESSES, - addrs, &siz) != 0) { + addrs, &opt_len) != 0) { free(addrs); return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -484,11 +480,10 @@ int sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) { struct sctp_getaddresses *addrs; - struct sockaddr *re; caddr_t lim; struct sockaddr *sa; - int size_of_addresses; - socklen_t siz; + size_t size_of_addresses; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -496,9 +491,9 @@ sctp_getladdrs(int sd, sctp_assoc_t id, return (-1); } size_of_addresses = 0; - siz = sizeof(int); + opt_len = (socklen_t) sizeof(int); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE, - &size_of_addresses, &siz) != 0) { + &size_of_addresses, &opt_len) != 0) { errno = ENOMEM; return (-1); } @@ -506,9 +501,10 @@ sctp_getladdrs(int sd, sctp_assoc_t id, errno = ENOTCONN; return (-1); } - siz = size_of_addresses + sizeof(struct sockaddr_storage); - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) (size_of_addresses + + sizeof(struct sockaddr_storage) + + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; return (-1); @@ -516,16 +512,15 @@ sctp_getladdrs(int sd, sctp_assoc_t id, addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs, - &siz) != 0) { + &opt_len) != 0) { free(addrs); errno = ENOMEM; return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -732,7 +727,8 @@ sctp_sendx(int sd, const void *msg, size ssize_t ret; int i, cnt, *aa, saved_errno; char *buf; - int add_len, len, no_end_cx = 0; + int no_end_cx = 0; + size_t len, add_len; struct sockaddr *at; if (addrs == NULL) { @@ -782,7 +778,7 @@ sctp_sendx(int sd, const void *msg, size aa = (int *)buf; *aa = cnt; aa++; - memcpy((caddr_t)aa, addrs, (len - sizeof(int))); + memcpy((caddr_t)aa, addrs, (size_t)(len - sizeof(int))); ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_DELAYED, (void *)buf, (socklen_t) len); @@ -859,7 +855,6 @@ sctp_recvmsg(int s, #else struct sctp_sndrcvinfo *s_info; ssize_t sz; - int sinfo_found = 0; struct msghdr msg; struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; @@ -888,7 +883,6 @@ sctp_recvmsg(int s, return (sz); } s_info = NULL; - len = sz; if (sinfo) { sinfo->sinfo_assoc_id = 0; } @@ -909,7 +903,6 @@ sctp_recvmsg(int s, /* Copy it to the user */ if (sinfo) *sinfo = *s_info; - sinfo_found = 1; break; } else if (cmsg->cmsg_type == SCTP_EXTRCV) { /* @@ -922,7 +915,6 @@ sctp_recvmsg(int s, if (sinfo) { memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); } - sinfo_found = 1; break; } @@ -1055,7 +1047,7 @@ sctp_sendv(int sd, cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) + CMSG_SPACE(sizeof(struct sctp_prinfo)) + CMSG_SPACE(sizeof(struct sctp_authinfo)) + - addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { errno = ENOBUFS; return (-1); From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:49:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 838EC106564A; Sun, 5 Feb 2012 19:49:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31D8D8FC13; Sun, 5 Feb 2012 19:49:35 +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 q15JnZIE098214; Sun, 5 Feb 2012 19:49:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JnYbT098196; Sun, 5 Feb 2012 19:49:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051949.q15JnYbT098196@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231038 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:49:35 -0000 Author: tuexen Date: Sun Feb 5 19:49:34 2012 New Revision: 231038 URL: http://svn.freebsd.org/changeset/base/231038 Log: MFC 228653: Fix unused parameter warnings. While there, fix some whitespace issues. Modified: stable/9/sys/netinet/sctp.h stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_asconf.h stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_auth.h stable/9/sys/netinet/sctp_bsd_addr.c stable/9/sys/netinet/sctp_bsd_addr.h stable/9/sys/netinet/sctp_cc_functions.c stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_crc32.h stable/9/sys/netinet/sctp_dtrace_declare.h stable/9/sys/netinet/sctp_dtrace_define.h stable/9/sys/netinet/sctp_header.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_os.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_peeloff.c stable/9/sys/netinet/sctp_peeloff.h stable/9/sys/netinet/sctp_ss_functions.c stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctp_timer.h stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp.h ============================================================================== --- stable/9/sys/netinet/sctp.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1261,8 +1261,7 @@ sctp_path_check_and_react(struct sctp_tc * flag: 1=success, 0=failure. */ static void -sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, - uint16_t type, uint32_t flag) +sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, uint32_t flag) { /* * do the necessary asoc list work- if we get a failure indication, @@ -1712,7 +1711,7 @@ sctp_asconf_process_param_ack(struct sct case SCTP_ADD_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, "process_param_ack: added IP address\n"); - sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, param_type, flag); + sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, flag); break; case SCTP_DEL_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, @@ -2102,7 +2101,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int -sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2150,7 +2149,7 @@ sctp_asconf_iterator_ep(struct sctp_inpc } static int -sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_ifa *ifa; struct sctp_asconf_iterator *asc; @@ -2182,7 +2181,7 @@ sctp_asconf_iterator_ep_end(struct sctp_ void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - void *ptr, uint32_t val) + void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2350,7 +2349,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } void -sctp_asconf_iterator_end(void *ptr, uint32_t val) +sctp_asconf_iterator_end(void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -3009,8 +3008,7 @@ next_addr: * 1 if found, 0 if not */ static uint32_t -sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, uint32_t offset, - uint32_t length, struct sockaddr *sa) +sctp_addr_in_initack(struct mbuf *m, uint32_t offset, uint32_t length, struct sockaddr *sa) { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; @@ -3155,8 +3153,7 @@ sctp_check_address_list_ep(struct sctp_t continue; } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &laddr->ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &laddr->ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, laddr->ifa, SCTP_ADD_IP_ADDRESS, SCTP_ADDR_NOT_LOCKED); @@ -3179,6 +3176,15 @@ sctp_check_address_list_all(struct sctp_ struct sctp_ifa *sctp_ifa; uint32_t vrf_id; +#ifdef INET + struct sockaddr_in *sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; + +#endif + if (stcb) { vrf_id = stcb->asoc.vrf_id; } else { @@ -3202,9 +3208,35 @@ sctp_check_address_list_all(struct sctp_ if (sctp_cmpaddr(&sctp_ifa->address.sa, init_addr)) { continue; } + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + if ((ipv4_scope == 0) && + (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { + /* private address not in scope */ + continue; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + if ((local_scope == 0) && + (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { + continue; + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + break; +#endif + default: + break; + } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &sctp_ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &sctp_ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, sctp_ifa, SCTP_ADD_IP_ADDRESS, Modified: stable/9/sys/netinet/sctp_asconf.h ============================================================================== --- stable/9/sys/netinet/sctp_asconf.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_asconf.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_auth.c ============================================================================== --- stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1891,7 +1891,7 @@ sctp_notify_authentication(struct sctp_t /* append to socket */ control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, - 0, 0, 0, 0, 0, 0, m_notify); + 0, 0, stcb->asoc.context, 0, 0, 0, m_notify); if (control == NULL) { /* no memory */ sctp_m_freem(m_notify); Modified: stable/9/sys/netinet/sctp_auth.h ============================================================================== --- stable/9/sys/netinet/sctp_auth.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_auth.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_bsd_addr.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -83,11 +83,11 @@ sctp_wakeup_iterator(void) } static void -sctp_iterator_thread(void *v) +sctp_iterator_thread(void *v SCTP_UNUSED) { SCTP_IPI_ITERATOR_WQ_LOCK(); /* In FreeBSD this thread never terminates. */ - while (1) { + for (;;) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); Modified: stable/9/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_bsd_addr.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -508,8 +508,7 @@ out_decision: } static int -cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, - uint64_t vtag, uint8_t inst_ind) +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t vtag) { uint64_t oth, probepoint; @@ -643,7 +642,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc } bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - ret = cc_bw_increase(stcb, net, nbw, vtag, inst_ind); + ret = cc_bw_increase(stcb, net, nbw, vtag); goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); @@ -664,7 +663,7 @@ out: static void sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit, int use_rtcc) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -1301,7 +1300,7 @@ sctp_cwnd_update_rtcc_tsn_acknowledged(s } static void -sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set > 0) { @@ -1473,7 +1472,7 @@ sctp_cwnd_rtcc_socket_option(struct sctp } static void -sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set == 0) { @@ -1492,8 +1491,9 @@ sctp_cwnd_update_rtcc_after_sack(struct } static void -sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, - struct sctp_nets *net, struct timeval *now) +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb SCTP_UNUSED, + struct sctp_nets *net, + struct timeval *now SCTP_UNUSED) { net->cc_mod.rtcc.rtt_set_this_sack = 1; } @@ -1731,7 +1731,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp static void sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -1879,7 +1879,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st #endif static inline void -measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_rtt(struct sctp_nets *net) { uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; @@ -1897,7 +1897,7 @@ measure_rtt(struct sctp_tcb *stcb, struc } static void -measure_achieved_throughput(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_achieved_throughput(struct sctp_nets *net) { uint32_t now = sctp_get_tick_count(); @@ -1997,7 +1997,7 @@ htcp_alpha_update(struct htcp *ca) * were getting just too full now). */ static void -htcp_param_update(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_param_update(struct sctp_nets *net) { uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; @@ -2014,9 +2014,9 @@ htcp_param_update(struct sctp_tcb *stcb, } static uint32_t -htcp_recalc_ssthresh(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_recalc_ssthresh(struct sctp_nets *net) { - htcp_param_update(stcb, net); + htcp_param_update(net); return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); } @@ -2051,7 +2051,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s } } } else { - measure_rtt(stcb, net); + measure_rtt(net); /* * In dangerous area, increase slowly. In theory this is @@ -2093,7 +2093,7 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str #endif static void -htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_init(struct sctp_nets *net) { memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); net->cc_mod.htcp_ca.alpha = ALPHA_BASE; @@ -2111,7 +2111,7 @@ sctp_htcp_set_initial_cc_param(struct sc */ net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); net->ssthresh = stcb->asoc.peers_rwnd; - htcp_init(stcb, net); + htcp_init(net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); @@ -2121,7 +2121,7 @@ sctp_htcp_set_initial_cc_param(struct sc static void sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -2176,7 +2176,7 @@ sctp_htcp_cwnd_update_after_sack(struct if (accum_moved || ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); - measure_achieved_throughput(stcb, net); + measure_achieved_throughput(net); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, @@ -2212,7 +2212,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc /* JRS - reset as if state were changed */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->ssthresh; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), @@ -2266,7 +2266,7 @@ sctp_htcp_cwnd_update_after_timeout(stru /* JRS - reset as if the state were being changed to timeout */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->mtu; net->partial_bytes_acked = 0; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -2276,7 +2276,7 @@ sctp_htcp_cwnd_update_after_timeout(stru static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, - struct sctp_nets *net, int in_window, int num_pkt_lost) + struct sctp_nets *net, int in_window, int num_pkt_lost SCTP_UNUSED) { int old_cwnd; @@ -2286,7 +2286,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str if (in_window == 0) { htcp_reset(&net->cc_mod.htcp_ca); SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); if (net->ssthresh < net->mtu) { net->ssthresh = net->mtu; /* here back off the timer as well, to slow us down */ Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1017,20 +1017,9 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) - -#define SCTP_GETTIME_TIMESPEC(x) (getnanouptime(x)) -#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) -#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) +#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) +#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) #endif -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ -/*#define SCTP_GETTIME_TIMEVAL(x) { \*/ -/* (x)->tv_sec = ticks / 1000; \*/ -/* (x)->tv_usec = (ticks % 1000) * 1000; \*/ -/*}*/ - -/*#else*/ -/*#define SCTP_GETTIME_TIMEVAL(x) (microtime(x))*/ -/*#endif __FreeBSD__ */ #if defined(_KERNEL) || defined(__Userspace__) #define sctp_sowwakeup(inp, so) \ Modified: stable/9/sys/netinet/sctp_crc32.h ============================================================================== --- stable/9/sys/netinet/sctp_crc32.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_crc32.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_declare.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_dtrace_declare.h Sun Feb 5 19:49:34 2012 (r231038) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_define.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_dtrace_define.h Sun Feb 5 19:49:34 2012 (r231038) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_header.h ============================================================================== --- stable/9/sys/netinet/sctp_header.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_header.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -137,7 +137,7 @@ sctp_build_readq_entry(struct sctp_tcb * read_queue_e->sinfo_ssn = stream_seq; read_queue_e->sinfo_flags = (flags << 8); read_queue_e->sinfo_ppid = ppid; - read_queue_e->sinfo_context = stcb->asoc.context; + read_queue_e->sinfo_context = context; read_queue_e->sinfo_timetolive = 0; read_queue_e->sinfo_tsn = tsn; read_queue_e->sinfo_cumtsn = tsn; @@ -846,7 +846,6 @@ sctp_queue_data_for_reasm(struct sctp_tc { struct mbuf *oper; uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; - u_char last_flags; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1033,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_flags = at->rec.data.rcv_flags; last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { @@ -1455,7 +1453,7 @@ sctp_process_a_data_chunk(struct sctp_tc struct sctp_tmit_chunk *chk; uint32_t tsn, gap; struct mbuf *dmbuf; - int indx, the_len; + int the_len; int need_reasm_check = 0; uint16_t strmno, strmseq; struct mbuf *oper; @@ -1587,7 +1585,6 @@ sctp_process_a_data_chunk(struct sctp_tc } else { SCTP_STAT_INCR(sctps_datadroprwnd); } - indx = *break_flag; *break_flag = 1; return (0); } @@ -2259,7 +2256,6 @@ sctp_slide_mapping_arrays(struct sctp_tc uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; - at = 0; old_cumack = asoc->cumulative_tsn; old_base = asoc->mapping_array_base_tsn; @@ -2408,7 +2404,7 @@ sctp_slide_mapping_arrays(struct sctp_tc } void -sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap, int *abort_flag) +sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) { struct sctp_association *asoc; uint32_t highest_tsn; @@ -2824,10 +2820,7 @@ sctp_process_data(struct mbuf **mm, int stcb->asoc.send_sack = 1; } /* Start a sack timer or QUEUE a SACK for sending */ - sctp_sack_check(stcb, was_a_gap, &abort_flag); - if (abort_flag) - return (2); - + sctp_sack_check(stcb, was_a_gap); return (0); } @@ -2837,7 +2830,7 @@ sctp_process_segment_range(struct sctp_t int *num_frs, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int *ecn_seg_sums, int *rto_ok) + int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -3059,8 +3052,7 @@ static int sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t last_tsn, uint32_t * biggest_tsn_acked, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int num_seg, int num_nr_seg, int *ecn_seg_sums, - int *rto_ok) + int num_seg, int num_nr_seg, int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3106,7 +3098,7 @@ sctp_handle_segments(struct mbuf *m, int } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, - this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { + this_sack_lowest_newack, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3761,7 +3753,6 @@ sctp_fs_audit(struct sctp_association *a static void sctp_window_probe_recovery(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_nets *net, struct sctp_tmit_chunk *tp1) { tp1->window_probe = 0; @@ -4029,7 +4020,7 @@ sctp_express_handle_sack(struct sctp_tcb SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { /* sa_ignore NO_NULL_CHK */ - sctp_wakeup_log(stcb, cumack, 1, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4050,7 +4041,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cumack, 1, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_NOWAKE_FROM_SACK); } } @@ -4136,7 +4127,7 @@ again: TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { /* move back to data send queue */ - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -4344,7 +4335,7 @@ again: void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen) @@ -4352,7 +4343,6 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_association *asoc; struct sctp_tmit_chunk *tp1, *tp2; uint32_t last_tsn, biggest_tsn_acked, biggest_tsn_newly_acked, this_sack_lowest_newack; - uint32_t sav_cum_ack; uint16_t wake_him = 0; uint32_t send_s = 0; long j; @@ -4362,7 +4352,6 @@ sctp_handle_sack(struct mbuf *m, int off int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int ecn_seg_sums = 0; int done_once; int rto_ok = 1; uint8_t reneged_all = 0; @@ -4392,7 +4381,6 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_TCB_LOCK_ASSERT(stcb); /* CMT DAC algo */ this_sack_lowest_newack = 0; - j = 0; SCTP_STAT_INCR(sctps_slowpath_sack); last_tsn = cum_ack; cmt_dac_flag = flags & SCTP_SACK_CMT_DAC; @@ -4492,8 +4480,6 @@ sctp_handle_sack(struct mbuf *m, int off /* acking something behind */ return; } - sav_cum_ack = asoc->last_acked_seq; - /* update the Rwnd of the peer */ if (TAILQ_EMPTY(&asoc->sent_queue) && TAILQ_EMPTY(&asoc->send_queue) && @@ -4690,8 +4676,7 @@ sctp_handle_sack(struct mbuf *m, int off */ if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, &biggest_tsn_newly_acked, &this_sack_lowest_newack, - num_seg, num_nr_seg, &ecn_seg_sums, - &rto_ok)) { + num_seg, num_nr_seg, &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { @@ -4788,7 +4773,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4809,7 +4794,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_NOWAKE_FROM_SACK); } } @@ -5112,7 +5097,7 @@ again: */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -5222,8 +5207,7 @@ again: } void -sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, - struct sctp_nets *netp, int *abort_flag) +sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, int *abort_flag) { /* Copy cum-ack */ uint32_t cum_ack, a_rwnd; @@ -5389,13 +5373,12 @@ sctp_handle_forward_tsn(struct sctp_tcb */ struct sctp_association *asoc; uint32_t new_cum_tsn, gap; - unsigned int i, fwd_sz, cumack_set_flag, m_size; + unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; - cumack_set_flag = 0; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { SCTPDBG(SCTP_DEBUG_INDATA1, Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_indata.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -94,7 +94,7 @@ sctp_express_handle_sack(struct sctp_tcb void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen); @@ -110,8 +110,7 @@ struct sctp_tmit_chunk * void sctp_service_queues(struct sctp_tcb *, struct sctp_association *); void -sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, - struct sctp_nets *, int *); + sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, @@ -120,7 +119,7 @@ sctp_process_data(struct mbuf **, int, i void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); -void sctp_sack_check(struct sctp_tcb *, int, int *); +void sctp_sack_check(struct sctp_tcb *, int); #endif #endif Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -84,7 +84,7 @@ sctp_stop_all_cookie_timers(struct sctp_ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id, uint16_t port) + int *abort_no_unlock, uint32_t vrf_id, uint16_t port) { struct sctp_init *init; struct mbuf *op_err; @@ -258,8 +258,7 @@ sctp_is_there_unsent_data(struct sctp_tc } static int -sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net) +sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb) { struct sctp_init *init; struct sctp_association *asoc; @@ -433,13 +432,13 @@ sctp_process_init_ack(struct mbuf *m, in asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t) nat_friendly; /* process the peer's parameters in the INIT-ACK */ - retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb, net); + retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); if (retval < 0) { return (retval); } initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ - if ((retval = sctp_load_addresses_from_init(stcb, m, iphlen, + if ((retval = sctp_load_addresses_from_init(stcb, m, (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, NULL))) { /* Huh, we should abort */ @@ -521,7 +520,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, 0, net->port); + sh, op_err, vrf_id, net->port); *abort_no_unlock = 1; } return (retval); @@ -871,7 +870,7 @@ sctp_handle_shutdown(struct sctp_shutdow /* Shutdown NOT the expected size */ return; } else { - sctp_update_acked(stcb, cp, net, abort_flag); + sctp_update_acked(stcb, cp, abort_flag); if (*abort_flag) { return; } @@ -953,7 +952,7 @@ sctp_handle_shutdown(struct sctp_shutdow } static void -sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp, +sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1410,7 +1409,7 @@ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, - struct sockaddr *init_src, int *notification, sctp_assoc_t * sac_assoc_id, + struct sockaddr *init_src, int *notification, uint32_t vrf_id, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, uint16_t port) { struct sctp_association *asoc; @@ -1526,7 +1525,7 @@ sctp_process_cookie_existing(struct mbuf * the right seq no's. */ /* First we must process the INIT !! */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 3; @@ -1613,7 +1612,7 @@ sctp_process_cookie_existing(struct mbuf * somehow abort.. but we do have an existing asoc. This * really should not fail. */ - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1749,13 +1748,13 @@ sctp_process_cookie_existing(struct mbuf } /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 9; return (NULL); } - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1852,7 +1851,6 @@ sctp_process_cookie_existing(struct mbuf sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_15); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); - *sac_assoc_id = sctp_get_associd(stcb); /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); @@ -1928,7 +1926,7 @@ sctp_process_cookie_existing(struct mbuf SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:52:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F81065672; Sun, 5 Feb 2012 19:52:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF9E8FC08; Sun, 5 Feb 2012 19:52:56 +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 q15JqtrK098372; Sun, 5 Feb 2012 19:52:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Jqthi098363; Sun, 5 Feb 2012 19:52:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051952.q15Jqthi098363@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231039 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:52:56 -0000 Author: tuexen Date: Sun Feb 5 19:52:55 2012 New Revision: 231039 URL: http://svn.freebsd.org/changeset/base/231039 Log: MFC 228907: Address issues found by clang. While there, fix also some style issues. Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_cc_functions.c stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_ss_functions.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:52:55 2012 (r231039) @@ -138,7 +138,7 @@ sctp_asconf_success_response(uint32_t id if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_success_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); aph->correlation_id = id; @@ -147,7 +147,7 @@ sctp_asconf_success_response(uint32_t id SCTP_BUF_LEN(m_reply) = aph->ph.param_length; aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -166,7 +166,7 @@ sctp_asconf_error_response(uint32_t id, if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); error = (struct sctp_error_cause *)(aph + 1); @@ -183,7 +183,7 @@ sctp_asconf_error_response(uint32_t id, "asconf_error_response: tlv_length (%xh) too big\n", tlv_length); sctp_m_freem(m_reply); /* discard */ - return NULL; + return (NULL); } if (error_tlv != NULL) { tlv = (uint8_t *) (error + 1); @@ -193,7 +193,7 @@ sctp_asconf_error_response(uint32_t id, error->length = htons(error->length); aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -231,7 +231,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -254,7 +254,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -277,7 +277,7 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* end switch */ /* if 0.0.0.0/::0, add the source address instead */ @@ -314,7 +314,7 @@ sctp_process_asconf_add_ip(struct mbuf * sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); } } - return m_reply; + return (m_reply); } static int @@ -326,7 +326,7 @@ sctp_asconf_del_remote_addrs_except(stru src_net = sctp_findnet(stcb, src); if (src_net == NULL) { /* not found */ - return -1; + return (-1); } /* delete all destination addresses except the source */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -342,7 +342,7 @@ sctp_asconf_del_remote_addrs_except(stru (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED); } } - return 0; + return (0); } static struct mbuf * @@ -382,7 +382,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -402,7 +402,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -423,7 +423,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* make sure the source address is not being deleted */ @@ -433,7 +433,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { @@ -452,7 +452,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_success_response(aph->correlation_id); } - return m_reply; + return (m_reply); } /* delete the address */ result = sctp_del_remote_addr(stcb, sa); @@ -474,7 +474,7 @@ sctp_process_asconf_delete_ip(struct mbu /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); } - return m_reply; + return (m_reply); } static struct mbuf * @@ -511,7 +511,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -529,7 +529,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -548,7 +548,7 @@ sctp_process_asconf_set_primary(struct m m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if 0.0.0.0/::0, use the source address instead */ @@ -620,7 +620,7 @@ sctp_process_asconf_set_primary(struct m aparam_length); } - return m_reply; + return (m_reply); } /* @@ -2530,9 +2530,9 @@ sctp_is_addr_pending(struct sctp_tcb *st */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { - return 1; + return (1); } - return 0; + return (0); } static struct sockaddr * Modified: stable/9/sys/netinet/sctp_auth.c ============================================================================== --- stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:52:55 2012 (r231039) @@ -469,7 +469,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key2)) { bcopy(key2->key, key_ptr, key2->keylen); - key_ptr += key2->keylen; } } else { /* key is shared + key2 + key1 */ @@ -483,7 +482,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key1)) { bcopy(key1->key, key_ptr, key1->keylen); - key_ptr += key1->keylen; } } return (new_key); Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:52:55 2012 (r231039) @@ -80,7 +80,6 @@ sctp_set_initial_cc_param(struct sctp_tc } } net->ssthresh = assoc->peers_rwnd; - SDT_PROBE(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, 0, net->cwnd); @@ -339,7 +338,6 @@ cc_bw_same(struct sctp_tcb *stcb, struct ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { if (net->cc_mod.rtcc.last_step_state == 5) net->cc_mod.rtcc.step_cnt++; @@ -389,7 +387,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if (net->cc_mod.rtcc.ret_from_eq) { /* * Switch over to CA if we are less @@ -408,7 +405,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - /* Someone else - fight for more? */ if (net->cc_mod.rtcc.steady_step) { oth = net->cc_mod.rtcc.vol_reduce; @@ -553,7 +549,8 @@ cc_bw_increase(struct sctp_tcb *stcb, st static int cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) { - uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + uint64_t bw_offset, rtt_offset; + uint64_t probepoint, rtt, vtag; uint64_t bytes_for_this_rtt, inst_bw; uint64_t div, inst_off; int bw_shift; @@ -619,15 +616,15 @@ cc_bw_limit(struct sctp_tcb *stcb, struc inst_ind = SCTP_INST_NEUTRAL; probepoint |= ((0xb << 16) | inst_ind); } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xc << 16) | inst_ind); } } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt; /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xd << 16) | inst_ind); } SDT_PROBE(sctp, cwnd, net, rttvar, @@ -702,15 +699,18 @@ sctp_cwnd_update_after_sack_common(struc } } } - if (t_ucwnd_sbw == 0) { - t_ucwnd_sbw = 1; - } if (t_path_mptcp > 0) { mptcp_like_alpha = max_path / (t_path_mptcp * t_path_mptcp); } else { mptcp_like_alpha = 1; } } + if (t_ssthresh == 0) { + t_ssthresh = 1; + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -1012,6 +1012,9 @@ sctp_cwnd_update_after_timeout(struct sc t_ucwnd_sbw += (uint64_t) lnet->cwnd / (uint64_t) srtt; } } + if (t_ssthresh < 1) { + t_ssthresh = 1; + } if (t_ucwnd_sbw < 1) { t_ucwnd_sbw = 1; } @@ -1841,19 +1844,19 @@ static int use_bandwidth_switch = 1; static inline int between(uint32_t seq1, uint32_t seq2, uint32_t seq3) { - return seq3 - seq2 >= seq1 - seq2; + return (seq3 - seq2 >= seq1 - seq2); } static inline uint32_t htcp_cong_time(struct htcp *ca) { - return sctp_get_tick_count() - ca->last_cong; + return (sctp_get_tick_count() - ca->last_cong); } static inline uint32_t htcp_ccount(struct htcp *ca) { - return htcp_cong_time(ca) / ca->minRTT; + return (htcp_cong_time(ca) / ca->minRTT); } static inline void @@ -1873,7 +1876,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st net->cc_mod.htcp_ca.last_cong = net->cc_mod.htcp_ca.undo_last_cong; net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.undo_maxRTT; net->cc_mod.htcp_ca.old_maxB = net->cc_mod.htcp_ca.undo_old_maxB; - return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu); + return (max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu)); } #endif @@ -2017,7 +2020,7 @@ static uint32_t htcp_recalc_ssthresh(struct sctp_nets *net) { htcp_param_update(net); - return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); + return (max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu)); } static void @@ -2087,7 +2090,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s static uint32_t htcp_min_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net) { - return net->ssthresh; + return (net->ssthresh); } #endif Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:52:55 2012 (r231039) @@ -396,7 +396,7 @@ __FBSDID("$FreeBSD$"); /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ -#define SCTP_SIZE32(x) ((((x)+3) >> 2) << 2) +#define SCTP_SIZE32(x) ((((x) + 3) >> 2) << 2) #define IS_SCTP_CONTROL(a) ((a)->chunk_type != SCTP_DATA) #define IS_SCTP_DATA(a) ((a)->chunk_type == SCTP_DATA) @@ -933,7 +933,7 @@ __FBSDID("$FreeBSD$"); } else { \ gap = (MAX_TSN - mapping_tsn) + tsn + 1; \ } \ - } while(0) + } while (0) #define SCTP_RETRAN_DONE -1 Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:52:55 2012 (r231039) @@ -845,7 +845,7 @@ sctp_queue_data_for_reasm(struct sctp_tc struct sctp_tmit_chunk *chk, int *abort_flag) { struct mbuf *oper; - uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; + uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1032,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { /* @@ -1698,12 +1697,10 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; - mat = dmbuf; - while (mat) { + for (mat = dmbuf; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_ICOPY); } - mat = SCTP_BUF_NEXT(mat); } } #endif @@ -1724,10 +1721,8 @@ sctp_process_a_data_chunk(struct sctp_tc struct mbuf *lat; l_len = 0; - lat = dmbuf; - while (lat) { + for (lat = dmbuf; lat; lat = SCTP_BUF_NEXT(lat)) { l_len += SCTP_BUF_LEN(lat); - lat = SCTP_BUF_NEXT(lat); } } if (l_len > the_len) { @@ -1804,15 +1799,10 @@ failed_express_del: if (tsn == (control->sinfo_tsn + 1)) { /* Yep, we can add it on */ int end = 0; - uint32_t cumack; if (chunk_flags & SCTP_DATA_LAST_FRAG) { end = 1; } - cumack = asoc->cumulative_tsn; - if ((cumack + 1) == tsn) - cumack = tsn; - if (sctp_append_to_readq(stcb->sctp_ep, stcb, control, dmbuf, end, tsn, &stcb->sctp_socket->so_rcv)) { @@ -2634,7 +2624,7 @@ sctp_process_data(struct mbuf **mm, int if (length - *offset < chk_length) { /* all done, mutulated chunk */ stop_proc = 1; - break; + continue; } if (ch->ch.chunk_type == SCTP_DATA) { if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) { @@ -2690,7 +2680,7 @@ sctp_process_data(struct mbuf **mm, int * drop rep space left. */ stop_proc = 1; - break; + continue; } } else { /* not a data chunk in the data region */ @@ -2698,7 +2688,7 @@ sctp_process_data(struct mbuf **mm, int case SCTP_INITIATION: case SCTP_INITIATION_ACK: case SCTP_SELECTIVE_ACK: - case SCTP_NR_SELECTIVE_ACK: /* EY */ + case SCTP_NR_SELECTIVE_ACK: case SCTP_HEARTBEAT_REQUEST: case SCTP_HEARTBEAT_ACK: case SCTP_ABORT_ASSOCIATION: @@ -2772,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int } /* else skip this bad chunk and * continue... */ break; - }; /* switch of chunk type */ + } /* switch of chunk type */ } *offset += SCTP_SIZE32(chk_length); if ((*offset >= length) || stop_proc) { @@ -2785,10 +2775,9 @@ sctp_process_data(struct mbuf **mm, int if (ch == NULL) { *offset = length; stop_proc = 1; - break; - + continue; } - } /* while */ + } if (break_flag) { /* * we need to report rwnd overrun drops. @@ -3598,7 +3587,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this guy had a RTO calculation pending on * it, cancel it */ - if (tp1->whoTo->rto_needed == 0) { + if ((tp1->whoTo != NULL) && + (tp1->whoTo->rto_needed == 0)) { tp1->whoTo->rto_needed = 1; } tp1->do_rtt = 0; Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:52:55 2012 (r231039) @@ -1418,7 +1418,6 @@ sctp_process_cookie_existing(struct mbuf struct sctp_nets *net; struct mbuf *op_err; struct sctp_paramhdr *ph; - int chk_length; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1468,7 +1467,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull a INIT chunk in cookie */ return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { return (NULL); } @@ -1476,7 +1474,7 @@ sctp_process_cookie_existing(struct mbuf * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk */ - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); initack_cp = (struct sctp_init_ack_chunk *) sctp_m_getptr(m, initack_offset, sizeof(struct sctp_init_ack_chunk), (uint8_t *) & initack_buf); @@ -1484,7 +1482,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull INIT-ACK chunk in cookie */ return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -1984,11 +1981,9 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_storage sa_store; struct sockaddr *initack_src = (struct sockaddr *)&sa_store; struct sctp_association *asoc; - int chk_length; int init_offset, initack_offset, initack_limit; int retval; int error = 0; - uint32_t old_tag; uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE]; #ifdef INET @@ -2020,12 +2015,11 @@ sctp_process_cookie_new(struct mbuf *m, "process_cookie_new: could not pull INIT chunk hdr\n"); return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { SCTPDBG(SCTP_DEBUG_INPUT1, "HUH? process_cookie_new: could not find INIT chunk!\n"); return (NULL); } - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); /* * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk @@ -2038,7 +2032,6 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: could not pull INIT-ACK chunk hdr\n"); return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -2115,7 +2108,6 @@ sctp_process_cookie_new(struct mbuf *m, return (NULL); } /* process the INIT-ACK info (my info) */ - old_tag = asoc->my_vtag; asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); @@ -2702,10 +2694,9 @@ sctp_handle_cookie_echo(struct mbuf *m, */ if (netl == NULL) { /* TSNH! Huh, why do I need to add this address here? */ - int ret; - - ret = sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, - SCTP_IN_COOKIE_PROC); + if (sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { + return (NULL); + } netl = sctp_findnet(*stcb, to); } if (netl) { @@ -3003,7 +2994,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch struct sctp_nets *net; struct sctp_tmit_chunk *lchk; struct sctp_ecne_chunk bkup; - uint8_t override_bit = 0; + uint8_t override_bit; uint32_t tsn, window_data_tsn; int len; unsigned int pkt_cnt; @@ -3050,27 +3041,33 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (tsn == net->last_cwr_tsn) { /* Found him, send it off */ - goto out; + break; } } - /* - * If we reach here, we need to send a special CWR that says - * hey, we did this a long time ago and you lost the - * response. - */ - net = TAILQ_FIRST(&stcb->asoc.nets); - override_bit = SCTP_CWR_REDUCE_OVERRIDE; + if (net == NULL) { + /* + * If we reach here, we need to send a special CWR + * that says hey, we did this a long time ago and + * you lost the response. + */ + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + /* TSNH */ + return; + } + override_bit = SCTP_CWR_REDUCE_OVERRIDE; + } else { + override_bit = 0; + } + } else { + override_bit = 0; } -out: if (SCTP_TSN_GT(tsn, net->cwr_window_tsn) && ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* * JRS - Use the congestion control given in the pluggable * CC module */ - int ocwnd; - - ocwnd = net->cwnd; stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt); /* * We reduce once every RTT. So we will only lower cwnd at @@ -5074,7 +5071,6 @@ process_control_chunks: } SCTPDBG(SCTP_DEBUG_INPUT3, "GAK, null buffer\n"); - auth_skipped = 0; *offset = length; return (NULL); } @@ -5697,7 +5693,8 @@ sctp_common_input_processing(struct mbuf */ } /* take care of ecn */ - if ((stcb->asoc.ecn_allowed == 1) && + if ((data_processed == 1) && + (stcb->asoc.ecn_allowed == 1) && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); @@ -5807,12 +5804,10 @@ sctp_input_with_port(struct mbuf *i_pak, #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - mat = m; - while (mat) { + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_INPUT); } - mat = SCTP_BUF_NEXT(mat); } } #endif Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_output.c Sun Feb 5 19:52:55 2012 (r231039) @@ -2156,23 +2156,20 @@ skip_count: } cnt++; } - if (cnt > SCTP_ADDRESS_LIMIT) { - limit_out = 1; - } /* * To get through a NAT we only list addresses if we have * more than one. That way if you just bind a single address * we let the source of the init dictate our address. */ if (cnt > 1) { + cnt = cnt_inits_to; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { - cnt = 0; if (laddr->ifa == NULL) { continue; } - if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) + if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { continue; - + } if (sctp_is_address_in_scope(laddr->ifa, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -3758,7 +3755,6 @@ sctp_add_cookie(struct mbuf *init, int i /* tack the INIT and then the INIT-ACK onto the chain */ cookie_sz = 0; - m_at = mret; for (m_at = mret; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3766,7 +3762,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_init; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3774,7 +3769,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_initack; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -4792,7 +4786,6 @@ sctp_send_initiate(struct sctp_inpcb *in SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); } } - m_at = m; /* now the addresses */ { struct sctp_scoping scp; @@ -4801,9 +4794,10 @@ sctp_send_initiate(struct sctp_inpcb *in * To optimize this we could put the scoping stuff into a * structure and remove the individual uint8's from the * assoc structure. Then we could just sifa in the address - * within the stcb.. but for now this is a quick hack to get + * within the stcb. But for now this is a quick hack to get * the address stuff teased apart. */ + scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; scp.loopback_scope = stcb->asoc.loopback_scope; @@ -4811,7 +4805,7 @@ sctp_send_initiate(struct sctp_inpcb *in scp.local_scope = stcb->asoc.local_scope; scp.site_scope = stcb->asoc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); + sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -4841,7 +4835,6 @@ sctp_send_initiate(struct sctp_inpcb *in sctp_m_freem(m); return; } - p_len += padval; } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - calls lowlevel_output\n"); ret = sctp_lowlevel_chunk_output(inp, stcb, net, @@ -5062,7 +5055,6 @@ sctp_arethere_unrecognized_parameters(st return (NULL); } m_copyback(op_err, err_at, plen, (caddr_t)phdr); - err_at += plen; } return (op_err); break; @@ -5305,6 +5297,7 @@ sctp_are_there_new_addresses(struct sctp p4 = (struct sctp_ipv4addr_param *)phdr; sin4.sin_addr.s_addr = p4->addr; sa_touse = (struct sockaddr *)&sin4; + break; } #endif #ifdef INET6 @@ -5322,10 +5315,12 @@ sctp_are_there_new_addresses(struct sctp memcpy((caddr_t)&sin6.sin6_addr, p6->addr, sizeof(p6->addr)); sa_touse = (struct sockaddr *)&sin6; + break; } #endif default: sa_touse = NULL; + break; } if (sa_touse) { /* ok, sa_touse points to one to check */ @@ -5534,7 +5529,7 @@ do_a_abort: default: goto do_a_abort; break; - }; + } if (net == NULL) { to = (struct sockaddr *)&store; @@ -5954,6 +5949,7 @@ do_a_abort: llen = 0; ol = op_err; + while (ol) { llen += SCTP_BUF_LEN(ol); ol = SCTP_BUF_NEXT(ol); @@ -6023,15 +6019,11 @@ do_a_abort: padval = p_len % 4; if ((padval) && (mp_last)) { /* see my previous comments on mp_last */ - int ret; - - ret = sctp_add_pad_tombuf(mp_last, (4 - padval)); - if (ret) { + if (sctp_add_pad_tombuf(mp_last, (4 - padval))) { /* Houston we have a problem, no space */ sctp_m_freem(m); return; } - p_len += padval; } if (stc.loopback_scope) { over_addr = &store1; @@ -6230,7 +6222,7 @@ sctp_msg_append(struct sctp_tcb *stcb, struct mbuf *m, struct sctp_sndrcvinfo *srcv, int hold_stcb_lock) { - int error = 0, holds_lock; + int error = 0; struct mbuf *at; struct sctp_stream_queue_pending *sp = NULL; struct sctp_stream_out *strm; @@ -6239,7 +6231,6 @@ sctp_msg_append(struct sctp_tcb *stcb, * Given an mbuf chain, put it into the association send queue and * place it on the wheel */ - holds_lock = hold_stcb_lock; if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { /* Invalid stream number */ SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -6308,7 +6299,9 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } - SCTP_TCB_SEND_LOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); @@ -6318,7 +6311,9 @@ sctp_msg_append(struct sctp_tcb *stcb, } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; - SCTP_TCB_SEND_UNLOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } out_now: if (m) { sctp_m_freem(m); @@ -7585,7 +7580,6 @@ dont_do_it: out_of: if (send_lock_up) { SCTP_TCB_SEND_UNLOCK(stcb); - send_lock_up = 0; } return (to_move); } @@ -7600,7 +7594,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb ) { struct sctp_association *asoc; - struct sctp_stream_out *strq, *strqn; + struct sctp_stream_out *strq; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; @@ -7629,7 +7623,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } - strqn = strq; while ((goal_mtu > 0) && strq) { giveup = 0; bail = 0; @@ -7942,7 +7935,7 @@ again_one_more_time: */ continue; } - ctl_cnt = bundle_at = 0; + bundle_at = 0; endoutchain = outchain = NULL; no_fragmentflg = 1; one_chunk = 0; @@ -8640,7 +8633,6 @@ again_one_more_time: chk->window_probe = 0; data_list[bundle_at++] = chk; if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { - mtu = 0; break; } if (chk->sent == SCTP_DATAGRAM_UNSENT) { @@ -8757,7 +8749,7 @@ no_data_fill: } else { asoc->ifp_had_enobuf = 0; } - outchain = endoutchain = NULL; + endoutchain = NULL; auth = NULL; auth_offset = 0; if (bundle_at || hbflag) { @@ -9221,7 +9213,7 @@ sctp_send_asconf_ack(struct sctp_tcb *st */ struct sctp_tmit_chunk *chk; struct sctp_asconf_ack *ack, *latest_ack; - struct mbuf *m_ack, *m; + struct mbuf *m_ack; struct sctp_nets *net = NULL; SCTP_TCB_LOCK_ASSERT(stcb); @@ -9300,7 +9292,6 @@ sctp_send_asconf_ack(struct sctp_tcb *st chk->data = m_ack; chk->send_size = 0; /* Get size */ - m = m_ack; chk->send_size = ack->len; chk->rec.chunk_id.id = SCTP_ASCONF_ACK; chk->rec.chunk_id.can_take_data = 1; @@ -9393,7 +9384,6 @@ sctp_chunk_retransmission(struct sctp_in ctl_cnt++; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) { fwd_tsn = 1; - fwd = chk; } /* * Add an AUTH chunk, if chunk requires it save the @@ -9431,7 +9421,7 @@ sctp_chunk_retransmission(struct sctp_in SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* @@ -9601,16 +9591,13 @@ one_chunk_around: * now are there anymore forward from chk to pick * up? */ - fwd = TAILQ_NEXT(chk, sctp_next); - while (fwd) { + for (fwd = TAILQ_NEXT(chk, sctp_next); fwd != NULL; fwd = TAILQ_NEXT(fwd, sctp_next)) { if (fwd->sent != SCTP_DATAGRAM_RESEND) { /* Nope, not for retran */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (fwd->whoTo != net) { /* Nope, not the net in question */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (data_auth_reqd && (auth == NULL)) { @@ -9658,7 +9645,6 @@ one_chunk_around: if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { break; } - fwd = TAILQ_NEXT(fwd, sctp_next); } else { /* can't fit so we are done */ break; @@ -9690,7 +9676,7 @@ one_chunk_around: SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* For HB's */ @@ -10252,12 +10238,14 @@ sctp_fill_in_rest: * we report. */ at = TAILQ_FIRST(&asoc->sent_queue); - for (i = 0; i < cnt_of_skipped; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:56:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A899106567C; Sun, 5 Feb 2012 19:56:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0F78FC0A; Sun, 5 Feb 2012 19:56:07 +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 q15Ju7dq098533; Sun, 5 Feb 2012 19:56:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Ju7OD098531; Sun, 5 Feb 2012 19:56:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051956.q15Ju7OD098531@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231040 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:56:08 -0000 Author: tuexen Date: Sun Feb 5 19:56:07 2012 New Revision: 231040 URL: http://svn.freebsd.org/changeset/base/231040 Log: MFC r229729: Use NULL instead of 0. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 19:52:55 2012 (r231039) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 19:56:07 2012 (r231040) @@ -1459,7 +1459,7 @@ sctp_timeout_handler(void *t) type = tmr->type; if (inp) { SCTP_INP_INCR_REF(inp); - if ((inp->sctp_socket == 0) && + if ((inp->sctp_socket == NULL) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 19:59:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1FC11065677; Sun, 5 Feb 2012 19:59:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA548FC12; Sun, 5 Feb 2012 19:59:01 +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 q15Jx1b1098671; Sun, 5 Feb 2012 19:59:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Jx1No098669; Sun, 5 Feb 2012 19:59:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051959.q15Jx1No098669@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231041 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:59:02 -0000 Author: tuexen Date: Sun Feb 5 19:59:01 2012 New Revision: 231041 URL: http://svn.freebsd.org/changeset/base/231041 Log: MFC r229774: Improve the handling of received INITs. Send an ABORT when not accepting the connection. Also fix a crash, which could happen when the user closed the socket. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:56:07 2012 (r231040) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:59:01 2012 (r231041) @@ -88,43 +88,14 @@ sctp_handle_init(struct mbuf *m, int iph { struct sctp_init *init; struct mbuf *op_err; - uint32_t init_limit; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - goto outnow; - } - } - op_err = NULL; - init = &cp->init; - /* First are we accepting? */ - if ((inp->sctp_socket->so_qlimit == 0) && (stcb == NULL)) { - SCTPDBG(SCTP_DEBUG_INPUT2, - "sctp_handle_init: Abort, so_qlimit:%d\n", - inp->sctp_socket->so_qlimit); - /* - * FIX ME ?? What about TCP model and we have a - * match/restart case? Actually no fix is needed. the lookup - * will always find the existing assoc so stcb would not be - * NULL. It may be questionable to do this since we COULD - * just send back the INIT-ACK and hope that the app did - * accept()'s by the time the COOKIE was sent. But there is - * a price to pay for COOKIE generation and I don't want to - * pay it on the chance that the app will actually do some - * accepts(). The App just looses and should NOT be in this - * state :-) - */ - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; } + /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, vrf_id, port); @@ -133,6 +104,7 @@ sctp_handle_init(struct mbuf *m, int iph goto outnow; } /* validate parameters */ + init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); @@ -169,19 +141,49 @@ sctp_handle_init(struct mbuf *m, int iph *abort_no_unlock = 1; goto outnow; } - init_limit = offset + ntohs(cp->ch.chunk_length); if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), - init_limit)) { + offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; } - /* send an INIT-ACK w/cookie */ - SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + /* + * We are only accepting if we have a socket with positive + * so_qlimit. + */ + if ((stcb == NULL) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_socket == NULL) || + (inp->sctp_socket->so_qlimit == 0))) { + /* + * FIX ME ?? What about TCP model and we have a + * match/restart case? Actually no fix is needed. the lookup + * will always find the existing assoc so stcb would not be + * NULL. It may be questionable to do this since we COULD + * just send back the INIT-ACK and hope that the app did + * accept()'s by the time the COOKIE was sent. But there is + * a price to pay for COOKIE generation and I don't want to + * pay it on the chance that the app will actually do some + * accepts(). The App just looses and should NOT be in this + * state :-) + */ + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + vrf_id, port); + goto outnow; + } + if ((stcb != NULL) && + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); + sctp_send_shutdown_ack(stcb, NULL); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); + } else { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + } outnow: if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); @@ -1025,7 +1027,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* Set the connected flag to disconnected */ - stcb->sctp_ep->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -4499,7 +4501,6 @@ __attribute__((noinline)) * process all control chunks... */ if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || - /* EY */ (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { @@ -4613,54 +4614,30 @@ process_control_chunks: } switch (ch->chunk_type) { case SCTP_INITIATION: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore? */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { - /* - * collision case where we are - * sending to them too - */ - ; - } else { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - *offset = length; - return (NULL); - } - } - if ((chk_length > SCTP_LARGEST_INIT_ACCEPTED) || - (num_chunks > 1) || + /* The INIT chunk must be the only chunk. */ + if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + sctp_abort_association(inp, stcb, m, + iphlen, sh, NULL, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_SHUTDOWN_ACK_SENT)) { - sctp_send_shutdown_ack(stcb, NULL); + /* Honor our resource limit. */ + if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { + struct mbuf *op_err; + + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + sctp_abort_association(inp, stcb, m, + iphlen, sh, op_err, vrf_id, port); *offset = length; - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if (netp) { - sctp_handle_init(m, iphlen, *offset, sh, - (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); - } - if (abort_no_unlock) - return (NULL); - + sctp_handle_init(m, iphlen, *offset, sh, + (struct sctp_init_chunk *)ch, inp, + stcb, &abort_no_unlock, vrf_id, port); *offset = length; - if (locked_tcb) { + if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); } return (NULL); @@ -4668,7 +4645,6 @@ process_control_chunks: case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4697,6 +4673,7 @@ process_control_chunks: return (NULL); } } + /* The INIT-CK chunk must be the only chunk. */ if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { *offset = length; @@ -4711,16 +4688,17 @@ process_control_chunks: } else { ret = -1; } + *offset = length; + if (abort_no_unlock) { + return (NULL); + } /* * Special case, I must call the output routine to * get the cookie echoed */ - if (abort_no_unlock) - return (NULL); - - if ((stcb) && ret == 0) + if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - *offset = length; + } if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } @@ -4977,7 +4955,6 @@ process_control_chunks: case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { - *offset = length; return (NULL); } @@ -5009,23 +4986,11 @@ process_control_chunks: if ((stcb == NULL) && (inp->sctp_socket->so_qlen >= inp->sctp_socket->so_qlimit)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit))) { - struct mbuf *oper; - struct sctp_paramhdr *phdr; + struct mbuf *op_err; - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); - if (oper) { - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr); - phdr = mtod(oper, - struct sctp_paramhdr *); - phdr->param_type = - htons(SCTP_CAUSE_OUT_OF_RESC); - phdr->param_length = - htons(sizeof(struct sctp_paramhdr)); - } + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, oper, vrf_id, port); + iphlen, sh, op_err, vrf_id, port); } *offset = length; return (NULL); From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:04:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18FBF106566C; Sun, 5 Feb 2012 20:04:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8A58FC08; Sun, 5 Feb 2012 20:04:21 +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 q15K4LC8098984; Sun, 5 Feb 2012 20:04:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K4Luo098980; Sun, 5 Feb 2012 20:04:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052004.q15K4Luo098980@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231043 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:04:22 -0000 Author: tuexen Date: Sun Feb 5 20:04:21 2012 New Revision: 231043 URL: http://svn.freebsd.org/changeset/base/231043 Log: MFC 229775: Retire the SCTP sysctl "strict_init". We always perform the validation and there is no reason to make is configuarable. Discussed with rrs@. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:04:21 2012 (r231043) @@ -4617,7 +4617,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); *offset = length; @@ -4673,9 +4673,9 @@ process_control_chunks: return (NULL); } } - /* The INIT-CK chunk must be the only chunk. */ + /* The INIT-ACK chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:04:21 2012 (r231043) @@ -58,7 +58,6 @@ sctp_init_sysctls() #if !defined(SCTP_WITH_NO_CSUM) SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; #endif - SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -608,7 +607,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #if !defined(SCTP_WITH_NO_CSUM) RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); #endif - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -881,10 +879,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_INIT_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:04:21 2012 (r231043) @@ -50,7 +50,6 @@ struct sctp_sysctl { #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; #endif - uint32_t sctp_strict_init; uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; @@ -169,12 +168,6 @@ struct sctp_sysctl { #define SCTPCTL_LOOPBACK_NOCSUM_MAX 1 #define SCTPCTL_LOOPBACK_NOCSUM_DEFAULT 1 -/* strict_init: Enable strict INIT/INIT-ACK singleton enforcement */ -#define SCTPCTL_STRICT_INIT_DESC "Enable strict INIT/INIT-ACK singleton enforcement" -#define SCTPCTL_STRICT_INIT_MIN 0 -#define SCTPCTL_STRICT_INIT_MAX 1 -#define SCTPCTL_STRICT_INIT_DEFAULT 1 - /* peer_chkoh: Amount to debit peers rwnd per chunk sent */ #define SCTPCTL_PEER_CHKOH_DESC "Amount to debit peers rwnd per chunk sent" #define SCTPCTL_PEER_CHKOH_MIN 0 From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:06:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF201065673; Sun, 5 Feb 2012 20:06:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D427D8FC17; Sun, 5 Feb 2012 20:06:43 +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 q15K6hEC099158; Sun, 5 Feb 2012 20:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K6hd8099152; Sun, 5 Feb 2012 20:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052006.q15K6hd8099152@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231045 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:06:44 -0000 Author: tuexen Date: Sun Feb 5 20:06:43 2012 New Revision: 231045 URL: http://svn.freebsd.org/changeset/base/231045 Log: MFC r229805: Add an SCTP sysctl "blackhole", similar to the one for TCP. If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:06:43 2012 (r231045) @@ -170,8 +170,9 @@ sctp_handle_init(struct mbuf *m, int iph * accepts(). The App just looses and should NOT be in this * state :-) */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, - vrf_id, port); + if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } goto outnow; } if ((stcb != NULL) && @@ -5927,8 +5928,13 @@ sctp_skip_csum_4: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:06:43 2012 (r231045) @@ -117,6 +117,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); @@ -670,6 +671,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); @@ -1132,6 +1134,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_DCCCECN_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", + SCTPCTL_BLACKHOLE_DESC); + #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:06:43 2012 (r231045) @@ -115,6 +115,7 @@ struct sctp_sysctl { uint32_t sctp_vtag_time_wait; uint32_t sctp_buffer_splitting; uint32_t sctp_initial_cwnd; + uint32_t sctp_blackhole; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -526,6 +527,11 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing" +#define SCTPCTL_BLACKHOLE_MIN 0 +#define SCTPCTL_BLACKHOLE_MAX 2 +#define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output" Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 20:06:43 2012 (r231045) @@ -3800,6 +3800,7 @@ sctp_handle_ootb(struct mbuf *m, int iph { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; + int contains_init_chunk; SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ @@ -3809,6 +3810,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_CALLED_DIRECTLY_NOCMPSET); } } + contains_init_chunk = 0; ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); while (ch != NULL) { @@ -3818,6 +3820,9 @@ sctp_handle_ootb(struct mbuf *m, int iph break; } switch (ch->chunk_type) { + case SCTP_INIT: + contains_init_chunk = 1; + break; case SCTP_COOKIE_ECHO: /* We hit here only if the assoc is being freed */ return; @@ -3843,7 +3848,11 @@ sctp_handle_ootb(struct mbuf *m, int iph ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); } - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (contains_init_chunk == 0))) { + sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + } } /* Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sun Feb 5 20:06:43 2012 (r231045) @@ -236,8 +236,13 @@ sctp_skip_csum: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:09:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B24106564A; Sun, 5 Feb 2012 20:09:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9B08FC08; Sun, 5 Feb 2012 20:09:50 +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 q15K9ox5099343; Sun, 5 Feb 2012 20:09:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K9o4F099339; Sun, 5 Feb 2012 20:09:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202052009.q15K9o4F099339@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 5 Feb 2012 20:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231047 - in stable/9/sys: conf dev/sound/pci gnu/dev X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:09:51 -0000 Author: pfg Date: Sun Feb 5 20:09:50 2012 New Revision: 231047 URL: http://svn.freebsd.org/changeset/base/231047 Log: MFC: r230897 Use new OSS-based BSD-licensed header for cs sound driver. The cs driver requires a table with firmware values. An alternative firmware is available in a similar Open Sound System driver. This is actually a partial revert of Revision 77504. The csa driver is now free of the GPL. Tested by: joel Approved by: jhb (mentor) Added: stable/9/sys/dev/sound/pci/cs461x_dsp.h - copied unchanged from r230897, head/sys/dev/sound/pci/cs461x_dsp.h Deleted: stable/9/sys/gnu/dev/ Modified: stable/9/sys/conf/files stable/9/sys/dev/sound/pci/csa.c stable/9/sys/dev/sound/pci/csareg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sun Feb 5 20:07:45 2012 (r231046) +++ stable/9/sys/conf/files Sun Feb 5 20:09:50 2012 (r231047) @@ -1708,8 +1708,7 @@ dev/sound/pci/als4000.c optional snd_al dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci -dev/sound/pci/csa.c optional snd_csa pci \ - warning "kernel contains GPL contaminated csaimg.h header" +dev/sound/pci/csa.c optional snd_csa pci dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci Copied: stable/9/sys/dev/sound/pci/cs461x_dsp.h (from r230897, head/sys/dev/sound/pci/cs461x_dsp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/cs461x_dsp.h Sun Feb 5 20:09:50 2012 (r231047, copy of r230897, head/sys/dev/sound/pci/cs461x_dsp.h) @@ -0,0 +1,3497 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +/* + * This file is based on cs461x_dsp.h from the Open Sound System. + * Purpose: Firmware for cs461x/cs461x cards. + */ + +#ifndef _DEV_SOUND_PCI_CS461X_DSP_H +#define _DEV_SOUND_PCI_CS461X_DSP_H + +struct cs461x_firmware_struct cs461x_firmware = { + {{0x00000000, 0x00003000}, {0x00010000, 0x00003800}, + {0x00020000, 0x00007000}}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00200040, 0x00008010, 0x00000000, + 0x00000000, 0x80000001, 0x00000001, 0x00060000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00900080, 0x00000173, 0x00000000, + 0x00000000, 0x00000010, 0x00800000, 0x00900000, + 0xf2c0000f, 0x00000200, 0x00000000, 0x00010600, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x330300c2, + 0x06000000, 0x00000000, 0x80008000, 0x80008000, + 0x3fc0000f, 0x00000301, 0x00010400, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00b00000, 0x00d0806d, 0x330480c3, + 0x04800000, 0x00000001, 0x00800001, 0x0000ffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x066a0130, 0x06350070, 0x0000929d, 0x929d929d, + 0x00000000, 0x0000735a, 0x00000600, 0x00000000, + 0x929d735a, 0x00000000, 0x00010000, 0x735a735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000000f0, 0x0000804f, 0x000000c3, + 0x05000000, 0x00a00010, 0x00000000, 0x80008000, + 0x00000000, 0x00000000, 0x00000700, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000080, 0x00a00000, 0x0000809a, 0x000000c2, + 0x07400000, 0x00000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x000107a0, + 0x00c80028, 0x000000c2, 0x06800000, 0x00000000, + 0x06e00080, 0x00300000, 0x000080bb, 0x000000c9, + 0x07a00000, 0x04000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x00000780, + 0x00c80028, 0x000000c5, 0xff800000, 0x00000000, + 0x00640080, 0x00c00000, 0x00008197, 0x000000c9, + 0x07800000, 0x04000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x00800000, 0x80008000, 0x80008000, + 0x00020000, 0x0000ffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x07c00000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000018e, 0x000000c2, + 0x07c00000, 0x00000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00e00100, 0x00000173, 0x00000000, + 0x00000000, 0x00400010, 0x00800000, 0x00e00000, + 0x00000000, 0x00000000, 0x08400000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01100000, 0x0000018e, 0x000000c2, + 0x08400000, 0x00000000, 0x80008000, 0xffffffff, + 0x007fff80, 0x00280058, 0x01300000, 0x00000000, + 0x00000000, 0x2aab0000, 0x00000000, 0x00000000, + 0x00000000, 0x01200000, 0x0000026c, 0x000000c2, + 0x08c00000, 0x18000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x01000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000110, 0x00000000, 0x00000000, + 0x00000000, 0x00000082, 0x09000000, 0x00000000, + 0x00000000, 0x00000600, 0x013d0233, 0x20ff0040, + 0x00000000, 0x0000804c, 0x000101d8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x929d0600, 0x929d929d, 0x929d929d, 0x929d0000, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x00100635, 0x060b013f, 0x00000004, + 0x00000001, 0x007a0002, 0x00000000, 0x066e0610, + 0x0105929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0xa431ac75, 0x0001735a, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0x735a0051, + 0x00000000, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x00000000, 0x06400136, + 0x0000270f, 0x00010000, 0x007a0000, 0x00000000, + 0x068e0645, 0x0105929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0xa431ac75, 0x0001735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x735a0100, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:45:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E30106564A; Sun, 5 Feb 2012 20:45:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B287E8FC08; Sun, 5 Feb 2012 20:45:32 +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 q15KjWU6000731; Sun, 5 Feb 2012 20:45:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KjWbi000729; Sun, 5 Feb 2012 20:45:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052045.q15KjWbi000729@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231049 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:45:32 -0000 Author: tuexen Date: Sun Feb 5 20:45:32 2012 New Revision: 231049 URL: http://svn.freebsd.org/changeset/base/231049 Log: MFC r230104: Fix two bugs, which result in a panic when calling getsockopt() using SCTP_RECVINFO or SCTP_NXTINFO. Reported by Clement Lecigne and forwarded to us by zi@. Modified: stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 20:18:53 2012 (r231048) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 20:45:32 2012 (r231049) @@ -3019,7 +3019,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); SCTP_INP_RUNLOCK(inp); } @@ -3038,7 +3038,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); SCTP_INP_RUNLOCK(inp); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:47:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B1D1065674; Sun, 5 Feb 2012 20:47:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AFF38FC12; Sun, 5 Feb 2012 20:47:27 +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 q15KlR6e000847; Sun, 5 Feb 2012 20:47:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KlRI9000844; Sun, 5 Feb 2012 20:47:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052047.q15KlRI9000844@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231050 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:47:27 -0000 Author: tuexen Date: Sun Feb 5 20:47:26 2012 New Revision: 231050 URL: http://svn.freebsd.org/changeset/base/231050 Log: MFC r230136: Two cleanups. No functional change. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Feb 5 20:45:32 2012 (r231049) +++ stable/9/sys/netinet/sctp_output.c Sun Feb 5 20:47:26 2012 (r231050) @@ -12815,9 +12815,9 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } } - if ((SCTP_SO_IS_NBIO(so) + if (SCTP_SO_IS_NBIO(so) || (flags & MSG_NBIO) - )) { + ) { non_blocking = 1; } /* would we block? */ Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 20:45:32 2012 (r231049) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 20:47:26 2012 (r231050) @@ -6372,7 +6372,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#if defined(INET6) if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:49:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B669106566B; Sun, 5 Feb 2012 20:49:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E99FA8FC08; Sun, 5 Feb 2012 20:49:03 +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 q15Kn367000954; Sun, 5 Feb 2012 20:49:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kn35j000952; Sun, 5 Feb 2012 20:49:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052049.q15Kn35j000952@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231051 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:49:04 -0000 Author: tuexen Date: Sun Feb 5 20:49:03 2012 New Revision: 231051 URL: http://svn.freebsd.org/changeset/base/231051 Log: MFC r230138: Small cleanup, no functional change. Modified: stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/sctp6_var.h ============================================================================== --- stable/9/sys/netinet6/sctp6_var.h Sun Feb 5 20:47:26 2012 (r231050) +++ stable/9/sys/netinet6/sctp6_var.h Sun Feb 5 20:49:03 2012 (r231051) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -/* TODO __Userspace__ IPv6 stuff... */ #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:50:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBCB1065670; Sun, 5 Feb 2012 20:50:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 796AE8FC13; Sun, 5 Feb 2012 20:50:56 +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 q15Kou9p001065; Sun, 5 Feb 2012 20:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kousb001063; Sun, 5 Feb 2012 20:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052050.q15Kousb001063@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231052 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:50:56 -0000 Author: tuexen Date: Sun Feb 5 20:50:56 2012 New Revision: 231052 URL: http://svn.freebsd.org/changeset/base/231052 Log: MFC r230379: Fix a problem when using the CBAPI. While there, remove an old comment which does not apply anymore. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:49:03 2012 (r231051) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:50:56 2012 (r231052) @@ -1024,12 +1024,11 @@ sctp_handle_shutdown_ack(struct sctp_shu sctp_send_shutdown_complete(stcb, net, 0); /* notify upper layer protocol */ if (stcb->sctp_socket) { - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* Set the connected flag to disconnected */ stcb->sctp_socket->so_snd.sb_cc = 0; } + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 5 20:53:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F21106566C; Sun, 5 Feb 2012 20:53:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE1B8FC14; Sun, 5 Feb 2012 20:53:07 +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 q15Kr77M001190; Sun, 5 Feb 2012 20:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kr7WD001188; Sun, 5 Feb 2012 20:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052053.q15Kr7WD001188@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231053 - stable/9/usr.bin/netstat X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:53:07 -0000 Author: tuexen Date: Sun Feb 5 20:53:06 2012 New Revision: 231053 URL: http://svn.freebsd.org/changeset/base/231053 Log: MFC r230555: Don't print a warning when using netstat to print SCTP statistics when there is not SCTP in the kernel. This problem was reported by Sean Mahood. Modified: stable/9/usr.bin/netstat/sctp.c Directory Properties: stable/9/usr.bin/ (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/usr.bin/netstat/sctp.c ============================================================================== --- stable/9/usr.bin/netstat/sctp.c Sun Feb 5 20:50:56 2012 (r231052) +++ stable/9/usr.bin/netstat/sctp.c Sun Feb 5 20:53:06 2012 (r231053) @@ -611,7 +611,8 @@ sctp_stats(u_long off, const char *name, memset(&zerostat, 0, len); if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.sctp.stats"); + if (errno != ENOENT) + warn("sysctl: net.inet.sctp.stats"); return; } } else From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 10:14:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0EE0106564A; Mon, 6 Feb 2012 10:14:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F17C8FC16; Mon, 6 Feb 2012 10:14:07 +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 q16AE7D6030993; Mon, 6 Feb 2012 10:14:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AE7XQ030991; Mon, 6 Feb 2012 10:14:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061014.q16AE7XQ030991@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 10:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231068 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:14:07 -0000 Author: kib Date: Mon Feb 6 10:14:07 2012 New Revision: 231068 URL: http://svn.freebsd.org/changeset/base/231068 Log: MFC r230785: A debugger which requested PT_FOLLOW_FORK should get the notification about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE. If TDB_FORK flag is set, always issue a stop, the same as is done for TDB_EXEC. Modified: stable/9/sys/kern/subr_syscall.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Mon Feb 6 09:05:12 2012 (r231067) +++ stable/9/sys/kern/subr_syscall.c Mon Feb 6 10:14:07 2012 (r231068) @@ -212,7 +212,8 @@ syscallret(struct thread *td, int error, * executes. If debugger requested tracing of syscall * returns, do it now too. */ - if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 || + if (traced && + ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || (p->p_stops & S_PT_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 10:19:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40465106566C; Mon, 6 Feb 2012 10:19:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6388FC13; Mon, 6 Feb 2012 10:19:19 +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 q16AJJ4n031265; Mon, 6 Feb 2012 10:19:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AJImk031263; Mon, 6 Feb 2012 10:19:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061019.q16AJImk031263@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231069 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:19:19 -0000 Author: tuexen Date: Mon Feb 6 10:19:18 2012 New Revision: 231069 URL: http://svn.freebsd.org/changeset/base/231069 Log: MFC r227655: Cleanup comparison of interface names. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:14:07 2012 (r231068) +++ stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:19:18 2012 (r231069) @@ -331,19 +331,9 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { @@ -384,19 +374,9 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 10:22:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140A7106566C; Mon, 6 Feb 2012 10:22:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011C18FC08; Mon, 6 Feb 2012 10:22:51 +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 q16AMoZ7031445; Mon, 6 Feb 2012 10:22:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AMohM031434; Mon, 6 Feb 2012 10:22:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061022.q16AMohM031434@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231070 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:22:51 -0000 Author: tuexen Date: Mon Feb 6 10:22:50 2012 New Revision: 231070 URL: http://svn.freebsd.org/changeset/base/231070 Log: MFC r227755: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. Modified: stable/9/sys/netinet/sctp.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp.h ============================================================================== --- stable/9/sys/netinet/sctp.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp.h Mon Feb 6 10:22:50 2012 (r231070) @@ -120,6 +120,7 @@ struct sctp_paramhdr { #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 #define SCTP_PEER_ADDR_THLDS 0x00000023 +#define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 /* * read-only options Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_output.c Mon Feb 6 10:22:50 2012 (r231070) @@ -4054,6 +4054,12 @@ sctp_lowlevel_chunk_output(struct sctp_i } } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -4405,6 +4411,12 @@ sctp_lowlevel_chunk_output(struct sctp_i ip6h->ip6_src = lsa6->sin6_addr; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -10949,6 +10961,10 @@ sctp_send_shutdown_complete2(struct mbuf return; } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp = (struct udphdr *)comp_cp; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -11909,6 +11925,10 @@ sctp_send_abort(struct mbuf *m, int iphl udp = (struct udphdr *)abm; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ @@ -12170,6 +12190,10 @@ sctp_send_operr_to(struct mbuf *m, int i udp = (struct udphdr *)sh_out; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:22:50 2012 (r231070) @@ -2651,6 +2651,7 @@ sctp_inpcb_alloc(struct socket *so, uint #ifdef INET6 m->default_flowlabel = 0; #endif + m->port = 0; /* encapsulation disabled by default */ sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -3990,13 +3991,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; - *(&net->ref_count) = 1; + net->ref_count = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { - net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - } else { - net->port = 0; - } + net->port = stcb->asoc.port; net->dscp = stcb->asoc.default_dscp; #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; Modified: stable/9/sys/netinet/sctp_pcb.h ============================================================================== --- stable/9/sys/netinet/sctp_pcb.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_pcb.h Mon Feb 6 10:22:50 2012 (r231070) @@ -328,6 +328,7 @@ struct sctp_pcb { uint8_t default_dscp; char current_secret_number; char last_secret_number; + uint16_t port; /* remote UDP encapsulation port */ }; #ifndef SCTP_ALIGNMENT Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_structs.h Mon Feb 6 10:22:50 2012 (r231070) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used as a bit mask */ +/* The upper byte is used a a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { @@ -1213,6 +1213,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint32_t sctp_features; + uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_sysctl.c Mon Feb 6 10:22:50 2012 (r231070) @@ -122,7 +122,6 @@ sctp_init_sysctls() #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif - SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; @@ -665,10 +664,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); @@ -1085,10 +1080,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT /* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ #if !defined(__FreeBSD__) || defined(INET) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_sysctl.h Mon Feb 6 10:22:50 2012 (r231070) @@ -109,7 +109,6 @@ struct sctp_sysctl { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif - uint32_t sctp_udp_tunneling_for_client_enable; uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; @@ -458,12 +457,6 @@ struct sctp_sysctl { #define SCTPCTL_MOBILITY_FASTHANDOFF_MAX 1 #define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT SCTP_DEFAULT_MOBILITY_FASTHANDOFF -/* Enable SCTP/UDP tunneling for clients*/ -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC "Enable SCTP/UDP tunneling for client" -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN 0 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX 1 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN - /* Enable SCTP/UDP tunneling port */ #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:22:50 2012 (r231070) @@ -671,6 +671,12 @@ struct sctp_timeouts { uint32_t stimo_shutdownack; }; +struct sctp_udpencaps { + sctp_assoc_t sue_assoc_id; + struct sockaddr_storage sue_address; + uint16_t sue_port; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_usrreq.c Mon Feb 6 10:22:50 2012 (r231070) @@ -3204,6 +3204,92 @@ flags_out: } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + encaps->sue_port = net->port; + } else { + encaps->sue_port = stcb->asoc.port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + encaps->sue_port = inp->sctp_ep.port; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_paddrparams); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -4522,7 +4608,6 @@ sctp_setopt(struct socket *so, int optna break; } case SCTP_PEER_ADDR_PARAMS: - /* Applies to the specific association */ { struct sctp_paddrparams *paddrp; struct sctp_nets *net; @@ -5580,6 +5665,89 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + net->port = encaps->sue_port; + } else { + stcb->asoc.port = encaps->sue_port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.port = encaps->sue_port; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctputil.c Mon Feb 6 10:22:50 2012 (r231070) @@ -1105,6 +1105,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->authinfo.recv_keyid = 0; LIST_INIT(&asoc->shared_keys); asoc->marked_retrans = 0; + asoc->port = m->sctp_ep.port; asoc->timoinit = 0; asoc->timodata = 0; asoc->timosack = 0; From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 10:38:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C39106566B; Mon, 6 Feb 2012 10:38:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0FFE8FC17; Mon, 6 Feb 2012 10:38:20 +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 q16AcKnK032075; Mon, 6 Feb 2012 10:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AcKqg032073; Mon, 6 Feb 2012 10:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061038.q16AcKqg032073@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231073 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:38:21 -0000 Author: tuexen Date: Mon Feb 6 10:38:20 2012 New Revision: 231073 URL: http://svn.freebsd.org/changeset/base/231073 Log: MFC r227931: Move up the address to the top of the sctp_udencaps structure like in all other structures. This avoids alignment problems. Modified: stable/9/sys/netinet/sctp_uio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:35:21 2012 (r231072) +++ stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:38:20 2012 (r231073) @@ -672,8 +672,8 @@ struct sctp_timeouts { }; struct sctp_udpencaps { - sctp_assoc_t sue_assoc_id; struct sockaddr_storage sue_address; + sctp_assoc_t sue_assoc_id; uint16_t sue_port; }; From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 13:12:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49805106566B; Mon, 6 Feb 2012 13:12:31 +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 2D7D78FC0A; Mon, 6 Feb 2012 13:12:31 +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 q16DCVMS037146; Mon, 6 Feb 2012 13:12:31 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DCUep037142; Mon, 6 Feb 2012 13:12:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202061312.q16DCUep037142@svn.freebsd.org> From: Christian Brueffer Date: Mon, 6 Feb 2012 13:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231081 - stable/9/share/man/man9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:12:31 -0000 Author: brueffer Date: Mon Feb 6 13:12:30 2012 New Revision: 231081 URL: http://svn.freebsd.org/changeset/base/231081 Log: MFC: r230787 Manpages for the buf_ring and drbr interfaces. Added: stable/9/share/man/man9/buf_ring.9 - copied unchanged from r230787, head/share/man/man9/buf_ring.9 stable/9/share/man/man9/drbr.9 - copied unchanged from r230787, head/share/man/man9/drbr.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 6 12:08:41 2012 (r231080) +++ stable/9/share/man/man9/Makefile Mon Feb 6 13:12:30 2012 (r231081) @@ -12,6 +12,7 @@ MAN= accept_filter.9 \ boot.9 \ bpf.9 \ buf.9 \ + buf_ring.9 \ BUF_ISLOCKED.9 \ BUF_LOCK.9 \ BUF_LOCKFREE.9 \ @@ -99,6 +100,7 @@ MAN= accept_filter.9 \ devtoname.9 \ disk.9 \ domain.9 \ + drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ EVENTHANDLER.9 \ @@ -408,6 +410,16 @@ MLINKS+=bpf.9 bpfattach.9 \ bpf.9 bpf_tap.9 \ bpf.9 bpf_validate.9 MLINKS+=buf.9 bp.9 +MLINKS+=buf_ring.9 buf_ring_alloc.9 \ + buf_ring.9 buf_ring_free.9 \ + buf_ring.9 buf_ring_enqueue.9 \ + buf_ring.9 buf_ring_enqueue_bytes.9 \ + buf_ring.9 buf_ring_dequeue_mc.9 \ + buf_ring.9 buf_ring_dequeue_sc.9 \ + buf_ring.9 buf_ring_count.9 \ + buf_ring.9 buf_ring_empty.9 \ + buf_ring.9 buf_ring_full.9 \ + buf_ring.9 buf_ring_peek.9 MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 @@ -606,6 +618,14 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 +MLINKS+=drbr.9 drbr_free.9 \ + drbr.9 drbr_enqueue.9 \ + drbr.9 drbr_dequeue.9 \ + drbr.9 drbr_dequeue_cond.9 \ + drbr.9 drbr_flush.9 \ + drbr.9 drbr_empty.9 \ + drbr.9 drbr_inuse.9 \ + drbr.9 drbr_stats_update.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ Copied: stable/9/share/man/man9/buf_ring.9 (from r230787, head/share/man/man9/buf_ring.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/buf_ring.9 Mon Feb 6 13:12:30 2012 (r231081, copy of r230787, head/share/man/man9/buf_ring.9) @@ -0,0 +1,144 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt BUF_RING 9 +.Os +.Sh NAME +.Nm buf_ring , +.Nm buf_ring_alloc , +.Nm buf_ring_free , +.Nm buf_ring_enqueue , +.Nm buf_ring_enqueue_bytes , +.Nm buf_ring_dequeue_mc , +.Nm buf_ring_dequeue_sc , +.Nm buf_ring_count , +.Nm buf_ring_empty , +.Nm buf_ring_full , +.Nm buf_ring_peek , +.Nd multi-producer, {single, multi}-consumer lock-less ring buffer +.Sh SYNOPSIS +.In sys/param.h +.In sys/buf_ring.h +.Ft struct buf_ring * +.Fn buf_ring_alloc "int count" "struct malloc_type *type" "int flags" "struct mtx *sc_lock" +.Ft void +.Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn buf_ring_enqueue "struct buf_ring *br" "void *buf" +.Ft int +.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes" +.Ft void * +.Fn buf_ring_dequeue_mc "struct buf_ring *br" +.Ft void * +.Fn buf_ring_dequeue_sc "struct buf_ring *br" +.Ft int +.Fn buf_ring_count "struct buf_ring *br" +.Ft int +.Fn buf_ring_empty "struct buf_ring *br" +.Ft int +.Fn buf_ring_full "struct buf_ring *br" +.Ft void * +.Fn buf_ring_peek "struct buf_ring *br" +.Sh DESCRIPTION +The +.Nm +functions provide a lock-less multi-producer and lock-less multi-consumer as +well as single-consumer ring buffer. +.Pp +The +.Fn buf_ring_alloc +function is used to allocate a buf_ring ring buffer with +.Fa count +slots using malloc_type +.Fa type +and memory flags +.Fa flags . +The single consumer interface is protected by +.Fa sc_lock . +.Pp +The +.Fn buf_ring_free +function is used to free a buf_ring. +The user is responsible for freeing any enqueued items. +.Pp +The +.Fn buf_ring_enqueue +function is used to enqueue a buffer to a buf_ring. +.Pp +The +.Fn buf_ring_enqueue_bytes +function is used to enqueue a buffer to a buf_ring and increment the +number of bytes enqueued by +.Fa bytes . +.Pp +The +.Fn buf_ring_dequeue_mc +function is a multi-consumer safe way of dequeueing elements from a buf_ring. +.Pp +The +.Fn buf_ring_dequeue_sc +function is a single-consumer interface to dequeue elements - requiring +the user to serialize accesses with a lock. +.Pp +The +.Fn buf_ring_count +function returns the number of elements in a buf_ring. +.Pp +The +.Fn buf_ring_empty +function returns +.Dv TRUE +if the buf_ring is empty, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_full +function returns +.Dv TRUE +if no more items can be enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_peek +function returns a pointer to the last element in the buf_ring if the +buf_ring is not empty, +.Dv NULL +otherwise. +.Sh RETURN VALUES +The +.Fn buf_ring_enqueue +and +.Fn buf_ring_enqueue_bytes +functions return +.Er ENOBUFS +if there are no available slots in the buf_ring. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . Copied: stable/9/share/man/man9/drbr.9 (from r230787, head/share/man/man9/drbr.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/drbr.9 Mon Feb 6 13:12:30 2012 (r231081, copy of r230787, head/share/man/man9/drbr.9) @@ -0,0 +1,147 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt DRBR 9 +.Os +.Sh NAME +.Nm drbr , +.Nm drbr_free , +.Nm drbr_enqueue , +.Nm drbr_dequeue , +.Nm drbr_dequeue_cond , +.Nm drbr_flush , +.Nm drbr_empty , +.Nm drbr_inuse , +.Nm drbr_stats_update , +.Nd network driver interface to buf_ring +.Sh SYNOPSIS +.In sys/param.h +.In net/if.h +.In net/if_var.h +.Ft void +.Fn drbr_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn drbr_enqueue "struct ifnet *ifp" "struct buf_ring *br" "struct mbuf *m" +.Ft struct mbuf * +.Fn drbr_dequeue "struct ifnet *ifp" "struct buf_ring *br" +.Ft struct mbuf * +.Fn drbr_dequeue_cond "struct ifnet *ifp" "struct buf_ring *br" "int (*func) (struct mbuf *, void *)" "void *arg" +.Ft void +.Fn drbr_flush "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br" +.Ft void +.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags" +.Sh DESCRIPTION +The +.Nm +functions provide an API to network drivers for using +.Xr buf_ring 9 +for enqueueing and dequeueing packets. +This is meant as a replacement for the IFQ interface for packet queuing. +It allows a packet to be enqueued with a single atomic and packet +dequeue to be done without any per-packet atomics as it is protected +by the driver's tx queue lock. +If +.Dv INVARIANTS +is enabled, +.Fn drbr_dequeue +will assert that the tx queue lock is held when it is called. +.Pp +The +.Fn drbr_free +function frees all the enqueued mbufs and then frees the buf_ring. +.Pp +The +.Fn drbr_enqueue +function is used to enqueue an mbuf to a buf_ring, falling back to the +ifnet's IFQ if +.Xr ALTQ 4 +is enabled. +.Pp +The +.Fn drbr_dequeue +function is used to dequeue an mbuf from a buf_ring or, if +.Xr ALTQ 4 +is enabled, from the ifnet's IFQ. +.Pp +The +.Fn drbr_dequeue_cond +function is used to conditionally dequeue an mbuf from a buf_ring based +on whether +.Fa func +returns +.Dv TRUE +or +.Dv FALSE . +.Pp +The +.Fn drbr_flush +function frees all mbufs enqueued in the buf_ring and the ifnet's IFQ. +.Pp +The +.Fn drbr_empty +function returns +.Dv TRUE +if there are no mbufs enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn drbr_inuse +function returns the number of mbufs enqueued. +Note to users that this is intrinsically racy as there is no guarantee that +there will not be more mbufs when +.Fn drbr_dequeue +is actually called. +Provided the tx queue lock is held there will not be less. +.Pp +The +.Fn drbr_stats_update +function updates the number of bytes and the number of multicast packets sent. +.Sh RETURN VALUES +The +.Fn drbr_enqueue +function returns +.Er ENOBUFS +if there are no slots available in the buf_ring and +.Dv 0 +on success. +.Pp +The +.Fn drbr_dequeue +and +.Fn drbr_dequeue_cond +functions return an mbuf on success and +.Dv NULL +if the buf_ring is empty. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 13:14:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3D5106566C; Mon, 6 Feb 2012 13:14:26 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 783F88FC15; Mon, 6 Feb 2012 13:14:26 +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 q16DEQbv037233; Mon, 6 Feb 2012 13:14:26 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DEQgF037232; Mon, 6 Feb 2012 13:14:26 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061314.q16DEQgF037232@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231082 - stable/9/tools/regression/bin/sh/builtins X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:14:26 -0000 Author: dumbbell Date: Mon Feb 6 13:14:26 2012 New Revision: 231082 URL: http://svn.freebsd.org/changeset/base/231082 Log: MFC r230211: sh: Test EXIT trap with multiple statements in it Reviewed by: jilles Added: stable/9/tools/regression/bin/sh/builtins/trap9.0 - copied unchanged from r230211, head/tools/regression/bin/sh/builtins/trap9.0 Modified: Directory Properties: stable/9/tools/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/trap9.0 (from r230211, head/tools/regression/bin/sh/builtins/trap9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap9.0 Mon Feb 6 13:14:26 2012 (r231082, copy of r230211, head/tools/regression/bin/sh/builtins/trap9.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1 From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 13:29:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0DE106566B; Mon, 6 Feb 2012 13:29:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EF48FC17; Mon, 6 Feb 2012 13:29:51 +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 q16DTphZ037870; Mon, 6 Feb 2012 13:29:51 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DTp3v037863; Mon, 6 Feb 2012 13:29:51 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061329.q16DTp3v037863@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231085 - in stable/9: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:29:51 -0000 Author: dumbbell Date: Mon Feb 6 13:29:50 2012 New Revision: 231085 URL: http://svn.freebsd.org/changeset/base/231085 Log: MFC r230212: sh: Fix execution of multiple statements in a trap when evalskip is set Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles Sponsored by: Yakaz (http://www.yakaz.com) Added: stable/9/tools/regression/bin/sh/builtins/trap10.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap10.0 stable/9/tools/regression/bin/sh/builtins/trap11.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap11.0 Modified: stable/9/bin/sh/eval.c stable/9/bin/sh/eval.h stable/9/bin/sh/trap.c Directory Properties: stable/9/bin/sh/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Modified: stable/9/bin/sh/eval.c ============================================================================== --- stable/9/bin/sh/eval.c Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/eval.c Mon Feb 6 13:29:50 2012 (r231085) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ -static int skipcount; /* number of levels to skip */ +int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ Modified: stable/9/bin/sh/eval.h ============================================================================== --- stable/9/bin/sh/eval.h Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/eval.h Mon Feb 6 13:29:50 2012 (r231085) @@ -60,6 +60,7 @@ void evalbackcmd(union node *, struct ba #define in_function() funcnest extern int funcnest; extern int evalskip; +extern int skipcount; /* reasons for skipping commands (see comment on breakcmd routine) */ #define SKIPBREAK 1 Modified: stable/9/bin/sh/trap.c ============================================================================== --- stable/9/bin/sh/trap.c Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/trap.c Mon Feb 6 13:29:50 2012 (r231085) @@ -412,7 +412,7 @@ void dotrap(void) { int i; - int savestatus; + int savestatus, prev_evalskip, prev_skipcount; in_dotrap++; for (;;) { @@ -427,10 +427,36 @@ dotrap(void) */ if (i == SIGCHLD) ignore_sigchld++; + + /* + * Backup current evalskip + * state and reset it before + * executing a trap, so that the + * trap is not disturbed by an + * ongoing break/continue/return + * statement. + */ + prev_evalskip = evalskip; + prev_skipcount = skipcount; + evalskip = 0; + last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); exitstatus = savestatus; + + /* + * If such a command was not + * already in progress, allow a + * break/continue/return in the + * trap action to have an effect + * outside of it. + */ + if (prev_evalskip != 0) { + evalskip = prev_evalskip; + skipcount = prev_skipcount; + } + if (i == SIGCHLD) ignore_sigchld--; } @@ -501,6 +527,11 @@ exitshell_savedstatus(void) } handler = &loc1; if ((p = trap[0]) != NULL && *p != '\0') { + /* + * Reset evalskip, or the trap on EXIT could be + * interrupted if the last command was a "return". + */ + evalskip = 0; trap[0] = NULL; evalstring(p, 0); } Copied: stable/9/tools/regression/bin/sh/builtins/trap10.0 (from r230212, head/tools/regression/bin/sh/builtins/trap10.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap10.0 Mon Feb 6 13:29:50 2012 (r231085, copy of r230212, head/tools/regression/bin/sh/builtins/trap10.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# Check that the return statement will not break the EXIT trap, ie. all +# trap commands are executed before the script exits. + +test "$(trap 'printf trap; echo ped' EXIT; f() { return; }; f)" = trapped || exit 1 Copied: stable/9/tools/regression/bin/sh/builtins/trap11.0 (from r230212, head/tools/regression/bin/sh/builtins/trap11.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap11.0 Mon Feb 6 13:29:50 2012 (r231085, copy of r230212, head/tools/regression/bin/sh/builtins/trap11.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# Check that the return statement will not break the USR1 trap, ie. all +# trap commands are executed before the script resumes. + +result=$(${SH} -c 'trap "printf trap; echo ped" USR1; f() { return $(kill -USR1 $$); }; f') +test $? -eq 0 || exit 1 +test "$result" = trapped || exit 1 From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 18:11:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8346C1065674; Mon, 6 Feb 2012 18:11:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D7FE8FC1A; Mon, 6 Feb 2012 18:11:01 +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 q16IB1x4047548; Mon, 6 Feb 2012 18:11:01 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IB14c047541; Mon, 6 Feb 2012 18:11:01 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061811.q16IB14c047541@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231093 - in stable/9: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/modules/cxgbe sys/modules/cxgbe/firmware tools/tools/cxgbetool X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:11:01 -0000 Author: np Date: Mon Feb 6 18:11:01 2012 New Revision: 231093 URL: http://svn.freebsd.org/changeset/base/231093 Log: MFC r228491, r228561, r228594. r228491: Do not clobber the ingress queue's congestion setting. r228561: Many updates to cxgbe(4) - Device configuration via plain text config file. Also able to operate when not attached to the chip as the master driver. - Generic "work request" queue that serves as the base for both ctrl and ofld tx queues. - Generic interrupt handler routine that can process any event on any kind of ingress queue (via a dispatch table). - A couple of new driver ioctls. cxgbetool can now install a firmware to the card ("loadfw" command) and can read the card's memory ("memdump" and "tcb" commands). - Lots of assorted information within dev.t4nex.X.misc.* This is primarily for debugging and won't show up in sysctl -a. - Code to manage the L2 tables on the chip. - Updates to cxgbe(4) man page to go with the tunables that have changed. - Updates to the shared code in common/ - Updates to the driver-firmware interface (now at fw 1.4.16.0) r228594: Catch up with new driver ioctls in cxgbe. Added: stable/9/sys/dev/cxgbe/firmware/ - copied from r228561, head/sys/dev/cxgbe/firmware/ stable/9/sys/modules/cxgbe/firmware/ - copied from r228561, head/sys/modules/cxgbe/firmware/ Deleted: stable/9/sys/dev/cxgbe/common/t4fw_interface.h Modified: stable/9/share/man/man4/cxgbe.4 stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/osdep.h stable/9/sys/dev/cxgbe/t4_ioctl.h stable/9/sys/dev/cxgbe/t4_l2t.c stable/9/sys/dev/cxgbe/t4_l2t.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/modules/cxgbe/Makefile stable/9/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/tools/tools/ (props changed) Modified: stable/9/share/man/man4/cxgbe.4 ============================================================================== --- stable/9/share/man/man4/cxgbe.4 Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/share/man/man4/cxgbe.4 Mon Feb 6 18:11:01 2012 (r231093) @@ -99,18 +99,29 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.max_ntxq_10G_port -The maximum number of tx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_nrxq_10G_port -The maximum number of rx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_ntxq_1G_port -The maximum number of tx queues to use for a 1Gb port. -The default value is 2. -.It Va hw.cxgbe.max_nrxq_1G_port -The maximum number of rx queues to use for a 1Gb port. -The default value is 2. +.It Va hw.cxgbe.ntxq10g +The number of tx queues to use for a 10Gb port. The default is 16 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq10g +The number of rx queues to use for a 10Gb port. The default is 8 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.ntxq1g +The number of tx queues to use for a 1Gb port. The default is 4 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq1g +The number of rx queues to use for a 1Gb port. The default is 2 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq10g +The number of TOE tx queues to use for a 10Gb port. The default is 8 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq10g +The number of TOE rx queues to use for a 10Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq1g +The number of TOE tx queues to use for a 1Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq1g +The number of TOE rx queues to use for a 1Gb port. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G The timer index value to use to delay interrupts. @@ -119,6 +130,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. +Different cxgbe interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -127,6 +140,11 @@ and the index selects a value from this The default value is 2 for both 10Gb and 1Gb ports, which means 16 packets (or the holdoff timer going off) before an interrupt is generated. +-1 disables packet counting. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_txq The size, in number of entries, of the descriptor ring used for a tx queue. @@ -134,10 +152,46 @@ A buf_ring of the same size is also allo software queuing. See .Xr ifnet 9 . The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.interrupt_types +The interrupt types that the driver is allowed to use. +Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +The default is 7 (all allowed). +The driver will select the best possible type out of the allowed types by +itself. +.It Va hw.cxgbe.config_file +Select a pre-packaged device configuration file. +A configuration file contains a recipe for partitioning and configuring the +hardware resources on the card. +This tunable is for specialized applications only and should not be used in +normal operation. +The configuration profile currently in use is available in the dev.t4nex.X.cf +and dev.t4nex.X.cfcsum sysctls. +.It Va hw.cxgbe.linkcaps_allowed +.It Va hw.cxgbe.niccaps_allowed +.It Va hw.cxgbe.toecaps_allowed +.It Va hw.cxgbe.rdmacaps_allowed +.It Va hw.cxgbe.iscsicaps_allowed +.It Va hw.cxgbe.fcoecaps_allowed +Disallowing capabilities provides a hint to the driver and firmware to not +reserve hardware resources for that feature. +Each of these is a bit field with a bit for each sub-capability within the +capability. +This tunable is for specialized applications only and should not be used in +normal operation. +The capabilities for which hardware resources have been reserved are listed in +dev.t4nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/adapter.h Mon Feb 6 18:11:01 2012 (r231093) @@ -31,6 +31,7 @@ #ifndef __T4_ADAPTER_H__ #define __T4_ADAPTER_H__ +#include #include #include #include @@ -46,8 +47,9 @@ #include #include "offload.h" -#include "common/t4fw_interface.h" +#include "firmware/t4fw_interface.h" +#define T4_CFGNAME "t4fw_cfg" #define T4_FWNAME "t4fw" MALLOC_DECLARE(M_CXGBE); @@ -110,25 +112,21 @@ enum { FW_IQ_QSIZE = 256, FW_IQ_ESIZE = 64, /* At least 64 mandated by the firmware spec */ - INTR_IQ_QSIZE = 64, - INTR_IQ_ESIZE = 64, /* Handles some CPLs too, do not reduce */ - - CTRL_EQ_QSIZE = 128, - CTRL_EQ_ESIZE = 64, - RX_IQ_QSIZE = 1024, RX_IQ_ESIZE = 64, /* At least 64 so CPL_RX_PKT will fit */ - RX_FL_ESIZE = 64, /* 8 64bit addresses */ + EQ_ESIZE = 64, /* All egress queues use this entry size */ + RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES FL_BUF_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif + CTRL_EQ_QSIZE = 128, + TX_EQ_QSIZE = 1024, - TX_EQ_ESIZE = 64, TX_SGL_SEGS = 36, TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; @@ -144,13 +142,16 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - INTR_SHARED = (1 << 2), /* one set of intrq's for all ports */ + INTR_DIRECT = (1 << 2), /* direct interrupts for everything */ + MASTER_PF = (1 << 3), + ADAP_SYSCTL_CTX = (1 << 4), CXGBE_BUSY = (1 << 9), /* port flags */ DOOMED = (1 << 0), - VI_ENABLED = (1 << 1), + PORT_INIT_DONE = (1 << 1), + PORT_SYSCTL_CTX = (1 << 2), }; #define IS_DOOMED(pi) (pi->flags & DOOMED) @@ -186,6 +187,12 @@ struct port_info { int first_txq; /* index of first tx queue */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldtxq; /* # of offload tx queues */ + int first_ofld_txq; /* index of first offload tx queue */ + int nofldrxq; /* # of offload rx queues */ + int first_ofld_rxq; /* index of first offload rx queue */ +#endif int tmr_idx; int pktc_idx; int qsize_rxq; @@ -194,11 +201,8 @@ struct port_info { struct link_config link_cfg; struct port_stats stats; - struct taskqueue *tq; struct callout tick; - struct sysctl_ctx_list ctx; /* lives from ifconfig up to down */ - struct sysctl_oid *oid_rxq; - struct sysctl_oid *oid_txq; + struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */ uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; @@ -222,17 +226,26 @@ struct tx_map { bus_dmamap_t map; }; +/* DMA maps used for tx */ +struct tx_maps { + struct tx_map *maps; + uint32_t map_total; /* # of DMA maps */ + uint32_t map_pidx; /* next map to be used */ + uint32_t map_cidx; /* reclaimed up to this index */ + uint32_t map_avail; /* # of available maps */ +}; + struct tx_sdesc { uint8_t desc_used; /* # of hardware descriptors used by the WR */ uint8_t credits; /* NIC txq: # of frames sent out in the WR */ }; -typedef void (iq_intr_handler_t)(void *); - enum { /* iq flags */ - IQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - IQ_STARTED = (1 << 2), /* started */ + IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ + IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ + IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ /* iq state */ IQS_DISABLED = 0, @@ -252,26 +265,35 @@ struct sge_iq { uint16_t abs_id; /* absolute SGE id for the iq */ int8_t intr_pktc_idx; /* packet count threshold index */ int8_t pad0; - iq_intr_handler_t *handler; __be64 *desc; /* KVA of descriptor ring */ - volatile uint32_t state; + volatile int state; struct adapter *adapter; const __be64 *cdesc; /* current descriptor */ uint8_t gen; /* generation bit */ uint8_t intr_params; /* interrupt holdoff parameters */ - uint8_t intr_next; /* holdoff for next interrupt */ + uint8_t intr_next; /* XXX: holdoff for next interrupt */ uint8_t esize; /* size (bytes) of each entry in the queue */ uint16_t qsize; /* size (# of entries) of the queue */ uint16_t cidx; /* consumer index */ - uint16_t cntxt_id; /* SGE context id for the iq */ + uint16_t cntxt_id; /* SGE context id for the iq */ + + STAILQ_ENTRY(sge_iq) link; }; enum { + EQ_CTRL = 1, + EQ_ETH = 2, +#ifndef TCP_OFFLOAD_DISABLE + EQ_OFLD = 3, +#endif + /* eq flags */ - EQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - EQ_STARTED = (1 << 2), /* started */ - EQ_CRFLUSHED = (1 << 3), /* expecting an update from SGE */ + EQ_TYPEMASK = 7, /* 3 lsbits hold the type */ + EQ_ALLOCATED = (1 << 3), /* firmware resources allocated */ + EQ_DOOMED = (1 << 4), /* about to be destroyed */ + EQ_CRFLUSHED = (1 << 5), /* expecting an update from SGE */ + EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps */ }; /* @@ -281,10 +303,11 @@ enum { * consumes them) but it's special enough to have its own struct (see sge_fl). */ struct sge_eq { + unsigned int flags; /* MUST be first */ + unsigned int cntxt_id; /* SGE context id for the eq */ bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; char lockname[16]; - unsigned int flags; struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -297,9 +320,24 @@ struct sge_eq { uint16_t pidx; /* producer idx (desc idx) */ uint16_t pending; /* # of descriptors used since last doorbell */ uint16_t iqid; /* iq that gets egr_update for the eq */ - unsigned int cntxt_id; /* SGE context id for the eq */ + uint8_t tx_chan; /* tx channel used by the eq */ + struct task tx_task; + struct callout tx_callout; + + /* stats */ + + uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for eq */ + uint32_t unstalled; /* recovered from stall */ +}; + +enum { + FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */ + FL_DOOMED = (1 << 1), /* about to be destroyed */ }; +#define FL_RUNNING_LOW(fl) (fl->cap - fl->needed <= fl->lowat) +#define FL_NOT_RUNNING_LOW(fl) (fl->cap - fl->needed >= 2 * fl->lowat) + struct sge_fl { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -307,6 +345,7 @@ struct sge_fl { uint8_t tag_idx; struct mtx fl_lock; char lockname[16]; + int flags; __be64 *desc; /* KVA of descriptor ring, ptr to addresses */ bus_addr_t ba; /* bus address of descriptor ring */ @@ -317,8 +356,10 @@ struct sge_fl { uint32_t cidx; /* consumer idx (buffer idx, NOT hw desc idx) */ uint32_t pidx; /* producer idx (buffer idx, NOT hw desc idx) */ uint32_t needed; /* # of buffers needed to fill up fl. */ + uint32_t lowat; /* # of buffers <= this means fl needs help */ uint32_t pending; /* # of bufs allocated since last doorbell */ unsigned int dmamap_failed; + TAILQ_ENTRY(sge_fl) link; /* All starving freelists */ }; /* txq: SGE egress queue + what's needed for Ethernet NIC */ @@ -330,14 +371,8 @@ struct sge_txq { struct buf_ring *br; /* tx buffer ring */ struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ struct mbuf *m; /* held up due to temporary resource shortage */ - struct task resume_tx; - /* DMA maps used for tx */ - struct tx_map *maps; - uint32_t map_total; /* # of DMA maps */ - uint32_t map_pidx; /* next map to be used */ - uint32_t map_cidx; /* reclaimed up to this index */ - uint32_t map_avail; /* # of available maps */ + struct tx_maps txmaps; /* stats for common events first */ @@ -354,20 +389,14 @@ struct sge_txq { uint32_t no_dmamap; /* no DMA map to load the mbuf */ uint32_t no_desc; /* out of hardware descriptors */ - uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for txq */ } __aligned(CACHE_LINE_SIZE); -enum { - RXQ_LRO_ENABLED = (1 << 0) -}; - /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ struct sge_rxq { struct sge_iq iq; /* MUST be first */ - struct sge_fl fl; + struct sge_fl fl; /* MUST follow iq */ struct ifnet *ifp; /* the interface this rxq belongs to */ - unsigned int flags; #ifdef INET struct lro_ctrl lro; /* LRO state */ #endif @@ -381,12 +410,28 @@ struct sge_rxq { } __aligned(CACHE_LINE_SIZE); -/* ctrlq: SGE egress queue + stats for control queue */ -struct sge_ctrlq { +#ifndef TCP_OFFLOAD_DISABLE +/* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */ +struct sge_ofld_rxq { + struct sge_iq iq; /* MUST be first */ + struct sge_fl fl; /* MUST follow iq */ +} __aligned(CACHE_LINE_SIZE); +#endif + +/* + * wrq: SGE egress queue that is given prebuilt work requests. Both the control + * and offload tx queues are of this type. + */ +struct sge_wrq { struct sge_eq eq; /* MUST be first */ + struct adapter *adapter; + struct mbuf *head; /* held up due to lack of descriptors */ + struct mbuf *tail; /* valid only if head is valid */ + /* stats for common events first */ + uint64_t tx_wrs; /* # of tx work requests */ /* stats for not-that-common events */ @@ -394,20 +439,28 @@ struct sge_ctrlq { } __aligned(CACHE_LINE_SIZE); struct sge { - uint16_t timer_val[SGE_NTIMERS]; - uint8_t counter_val[SGE_NCOUNTERS]; + int timer_val[SGE_NTIMERS]; + int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; - int nrxq; /* total rx queues (all ports and the rest) */ - int ntxq; /* total tx queues (all ports and the rest) */ - int niq; /* total ingress queues */ - int neq; /* total egress queues */ + int nrxq; /* total # of Ethernet rx queues */ + int ntxq; /* total # of Ethernet tx tx queues */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldrxq; /* total # of TOE rx queues */ + int nofldtxq; /* total # of TOE tx queues */ +#endif + int niq; /* total # of ingress queues */ + int neq; /* total # of egress queues */ struct sge_iq fwq; /* Firmware event queue */ - struct sge_ctrlq *ctrlq;/* Control queues */ - struct sge_iq *intrq; /* Interrupt queues */ + struct sge_wrq mgmtq; /* Management queue (control queue) */ + struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ +#ifndef TCP_OFFLOAD_DISABLE + struct sge_wrq *ofld_txq; /* TOE tx queues */ + struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ +#endif uint16_t iq_start; int eq_start; @@ -415,7 +468,12 @@ struct sge { struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ }; +struct rss_header; +typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, + struct mbuf *); + struct adapter { + SLIST_ENTRY(adapter) link; device_t dev; struct cdev *cdev; @@ -444,27 +502,47 @@ struct adapter { struct sge sge; + struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; + uint32_t filter_mode; +#ifndef TCP_OFFLOAD_DISABLE + struct uld_softc tom; + struct tom_tunables tt; +#endif struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - int registered_device_map; int open_device_map; +#ifndef TCP_OFFLOAD_DISABLE + int offload_map; +#endif int flags; char fw_version[32]; + unsigned int cfcsum; struct adapter_params params; struct t4_virt_res vres; - struct sysctl_ctx_list ctx; /* from first_port_up to last_port_down */ - struct sysctl_oid *oid_fwq; - struct sysctl_oid *oid_ctrlq; - struct sysctl_oid *oid_intrq; + uint16_t linkcaps; + uint16_t niccaps; + uint16_t toecaps; + uint16_t rdmacaps; + uint16_t iscsicaps; + uint16_t fcoecaps; + + struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ struct mtx sc_lock; char lockname[16]; + + /* Starving free lists */ + struct mtx sfl_lock; /* same cache-line as sc_lock? but that's ok */ + TAILQ_HEAD(, sge_fl) sfl; + struct callout sfl_callout; + + cpl_handler_t cpl_handler[256] __aligned(CACHE_LINE_SIZE); }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -506,11 +584,15 @@ struct adapter { #define for_each_rxq(pi, iter, rxq) \ rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \ for (iter = 0; iter < pi->nrxq; ++iter, ++rxq) +#define for_each_ofld_txq(pi, iter, ofld_txq) \ + ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ + for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq) +#define for_each_ofld_rxq(pi, iter, ofld_rxq) \ + ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ + for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 -#define NINTRQ(sc) ((sc)->intr_count > T4_EXTRA_INTR ? \ - (sc)->intr_count - T4_EXTRA_INTR : 1) static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) @@ -589,29 +671,52 @@ static inline bool is_10G_port(const str return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +static inline int tx_resume_threshold(struct sge_eq *eq) +{ + return (eq->qsize / 4); +} + /* t4_main.c */ -void cxgbe_txq_start(void *, int); +void t4_tx_task(void *, int); +void t4_tx_callout(void *); int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int); +void t4_iterate(void (*)(struct adapter *, void *), void *); +int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); /* t4_sge.c */ void t4_sge_modload(void); -void t4_sge_init(struct adapter *); +int t4_sge_init(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); int t4_teardown_adapter_queues(struct adapter *); -int t4_setup_eth_queues(struct port_info *); -int t4_teardown_eth_queues(struct port_info *); +int t4_setup_port_queues(struct port_info *); +int t4_teardown_port_queues(struct port_info *); +int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); +void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); void t4_intr_all(void *); void t4_intr(void *); void t4_intr_err(void *); void t4_intr_evt(void *); int t4_mgmt_tx(struct adapter *, struct mbuf *); +int t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct mbuf *); int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); void t4_update_fl_bufsize(struct ifnet *); +int can_resume_tx(struct sge_eq *); + +static inline int t4_wrq_tx(struct adapter *sc, struct sge_wrq *wrq, struct mbuf *m) +{ + int rc; + + TXQ_LOCK(wrq); + rc = t4_wrq_tx_locked(sc, wrq, m); + TXQ_UNLOCK(wrq); + return (rc); +} + #endif Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/common/common.h Mon Feb 6 18:11:01 2012 (r231093) @@ -42,6 +42,15 @@ enum { enum { MEM_EDC0, MEM_EDC1, MEM_MC }; +enum { + MEMWIN0_APERTURE = 2048, + MEMWIN0_BASE = 0x1b800, + MEMWIN1_APERTURE = 32768, + MEMWIN1_BASE = 0x28000, + MEMWIN2_APERTURE = 65536, + MEMWIN2_BASE = 0x30000, +}; + enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR }; @@ -53,8 +62,8 @@ enum { }; #define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 3 -#define FW_VERSION_MICRO 10 +#define FW_VERSION_MINOR 4 +#define FW_VERSION_MICRO 16 struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -190,7 +199,6 @@ struct tp_proxy_stats { struct tp_cpl_stats { u32 req[4]; u32 rsp[4]; - u32 tx_err[4]; }; struct tp_rdma_stats { @@ -214,9 +222,9 @@ struct vpd_params { }; struct pci_params { - unsigned int vpd_cap_addr; - unsigned char speed; - unsigned char width; + unsigned int vpd_cap_addr; + unsigned short speed; + unsigned short width; }; /* @@ -239,20 +247,20 @@ struct adapter_params { unsigned int fw_vers; unsigned int tp_vers; - u8 api_vers[7]; unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - unsigned int mc_size; /* MC memory size */ - unsigned int nfilters; /* size of filter region */ + unsigned int mc_size; /* MC memory size */ + unsigned int nfilters; /* size of filter region */ unsigned int cim_la_size; - unsigned int nports; /* # of ethernet ports */ + /* Used as int in sysctls, do not reduce size */ + unsigned int nports; /* # of ethernet ports */ unsigned int portvec; - unsigned int rev; /* chip revision */ + unsigned int rev; /* chip revision */ unsigned int offload; unsigned int ofldq_wr_cred; @@ -366,6 +374,9 @@ int t4_seeprom_wp(struct adapter *adapte int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented); int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size); +unsigned int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); @@ -460,8 +471,8 @@ int t4_wol_pat_enable(struct adapter *ad int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, enum dev_master master, enum dev_state *state); int t4_fw_bye(struct adapter *adap, unsigned int mbox); -int t4_early_init(struct adapter *adap, unsigned int mbox); int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); +int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, u32 *val); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 18:11:01 2012 (r231093) @@ -30,10 +30,10 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "t4_regs.h" #include "t4_regs_values.h" -#include "t4fw_interface.h" +#include "firmware/t4fw_interface.h" #undef msleep -#define msleep(x) DELAY((x) * 1000) +#define msleep(x) pause("t4hw", (x) * hz / 1000) /** * t4_wait_op_done_val - wait until an operation is completed @@ -187,7 +187,7 @@ int t4_wr_mbox_meat(struct adapter *adap * off to larger delays to a maximum retry delay. */ static const int delay[] = { - 1, 1, 3, 5, 10, 10, 20, 50, 100, 200 + 1, 1, 3, 5, 10, 10, 20, 50, 100 }; u32 v; @@ -625,17 +625,6 @@ enum { SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ SF_ERASE_SECTOR = 0xd8, /* erase sector */ - - FW_START_SEC = 8, /* first flash sector for FW */ - FW_END_SEC = 15, /* last flash sector for FW */ - FW_IMG_START = FW_START_SEC * SF_SEC_SIZE, - FW_MAX_SIZE = (FW_END_SEC - FW_START_SEC + 1) * SF_SEC_SIZE, - - FLASH_CFG_MAX_SIZE = 0x10000 , /* max size of the flash config file */ - FLASH_CFG_OFFSET = 0x1f0000, - FLASH_CFG_START_SEC = FLASH_CFG_OFFSET / SF_SEC_SIZE, - FPGA_FLASH_CFG_OFFSET = 0xf0000 , /* if FPGA mode, then cfg file is at 1MB - 64KB */ - FPGA_FLASH_CFG_START_SEC = FPGA_FLASH_CFG_OFFSET / SF_SEC_SIZE, }; /** @@ -763,12 +752,15 @@ int t4_read_flash(struct adapter *adapte * @addr: the start address to write * @n: length of data to write in bytes * @data: the data to write + * @byte_oriented: whether to store data as bytes or as words * * Writes up to a page of data (256 bytes) to the serial flash starting * at the given address. All the data must be written to the same page. + * If @byte_oriented is set the write data is stored as byte stream + * (i.e. matches what on disk), otherwise in big-endian. */ static int t4_write_flash(struct adapter *adapter, unsigned int addr, - unsigned int n, const u8 *data) + unsigned int n, const u8 *data, int byte_oriented) { int ret; u32 buf[SF_PAGE_SIZE / 4]; @@ -788,6 +780,9 @@ static int t4_write_flash(struct adapter for (val = 0, i = 0; i < c; ++i) val = (val << 8) + *data++; + if (!byte_oriented) + val = htonl(val); + ret = sf1_write(adapter, c, c != left, 1, val); if (ret) goto unlock; @@ -799,7 +794,8 @@ static int t4_write_flash(struct adapter t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ /* Read the page to verify the write succeeded */ - ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, 1); + ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, + byte_oriented); if (ret) return ret; @@ -825,7 +821,7 @@ unlock: int t4_get_fw_version(struct adapter *adapter, u32 *vers) { return t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), 1, + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), 1, vers, 0); } @@ -838,7 +834,7 @@ int t4_get_fw_version(struct adapter *ad */ int t4_get_tp_version(struct adapter *adapter, u32 *vers) { - return t4_read_flash(adapter, FW_IMG_START + offsetof(struct fw_hdr, + return t4_read_flash(adapter, FLASH_FW_START + offsetof(struct fw_hdr, tp_microcode_ver), 1, vers, 0); } @@ -854,24 +850,17 @@ int t4_get_tp_version(struct adapter *ad */ int t4_check_fw_version(struct adapter *adapter) { - u32 api_vers[2]; int ret, major, minor, micro; ret = t4_get_fw_version(adapter, &adapter->params.fw_vers); if (!ret) ret = t4_get_tp_version(adapter, &adapter->params.tp_vers); - if (!ret) - ret = t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, intfver_nic), - 2, api_vers, 1); if (ret) return ret; major = G_FW_HDR_FW_VER_MAJOR(adapter->params.fw_vers); minor = G_FW_HDR_FW_VER_MINOR(adapter->params.fw_vers); micro = G_FW_HDR_FW_VER_MICRO(adapter->params.fw_vers); - memcpy(adapter->params.api_vers, api_vers, - sizeof(adapter->params.api_vers)); if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */ CH_ERR(adapter, "card FW has major version %u, driver wants " @@ -914,6 +903,21 @@ static int t4_flash_erase_sectors(struct } /** + * t4_flash_cfg_addr - return the address of the flash configuration file + * @adapter: the adapter + * + * Return the address within the flash where the Firmware Configuration + * File is stored. + */ +unsigned int t4_flash_cfg_addr(struct adapter *adapter) +{ + if (adapter->params.sf_size == 0x100000) + return FLASH_FPGA_CFG_START; + else + return FLASH_CFG_START; +} + +/** * t4_load_cfg - download config file * @adap: the adapter * @cfg_data: the cfg text file to write @@ -928,17 +932,8 @@ int t4_load_cfg(struct adapter *adap, co unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - if (adap->params.sf_size == 0x100000) { - addr = FPGA_FLASH_CFG_OFFSET; - flash_cfg_start_sec = FPGA_FLASH_CFG_START_SEC; - } else { - addr = FLASH_CFG_OFFSET; - flash_cfg_start_sec = FLASH_CFG_START_SEC; - } - if (!size) { - CH_ERR(adap, "cfg file has no data\n"); - return -EINVAL; - } + addr = t4_flash_cfg_addr(adap); + flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { CH_ERR(adap, "cfg file too large, max is %u bytes\n", @@ -950,7 +945,11 @@ int t4_load_cfg(struct adapter *adap, co sf_sec_size); ret = t4_flash_erase_sectors(adap, flash_cfg_start_sec, flash_cfg_start_sec + i - 1); - if (ret) + /* + * If size == 0 then we're simply erasing the FLASH sectors associated + * with the on-adapter Firmware Configuration File. + */ + if (ret || size == 0) goto out; /* this will write to the flash up to SF_PAGE_SIZE at a time */ @@ -959,7 +958,7 @@ int t4_load_cfg(struct adapter *adap, co n = size - i; else n = SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, n, cfg_data); + ret = t4_write_flash(adap, addr, n, cfg_data, 1); if (ret) goto out; @@ -969,7 +968,8 @@ int t4_load_cfg(struct adapter *adap, co out: if (ret) - CH_ERR(adap, "config file download failed %d\n", ret); + CH_ERR(adap, "config file %s failed %d\n", + (size == 0 ? "clear" : "download"), ret); return ret; } @@ -1004,9 +1004,9 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FW_MAX_SIZE) { + if (size > FLASH_FW_MAX_SIZE) { CH_ERR(adap, "FW image too large, max is %u bytes\n", - FW_MAX_SIZE); + FLASH_FW_MAX_SIZE); return -EFBIG; } @@ -1020,7 +1020,8 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FW_START_SEC, FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, + FLASH_FW_START_SEC + i - 1); if (ret) goto out; @@ -1031,28 +1032,110 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FW_IMG_START, SF_PAGE_SIZE, first_page); + ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FW_IMG_START; + addr = FLASH_FW_START; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data); + ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data, 1); if (ret) goto out; } ret = t4_write_flash(adap, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), - sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver); + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) CH_ERR(adap, "firmware download failed, error %d\n", ret); return ret; } +/* BIOS boot header */ +typedef struct boot_header_s { + u8 signature[2]; /* signature */ + u8 length; /* image length (include header) */ + u8 offset[4]; /* initialization vector */ + u8 reserved[19]; /* reserved */ + u8 exheader[2]; /* offset to expansion header */ +} boot_header_t; + +enum { + BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */ + BOOT_SIGNATURE = 0xaa55, /* signature of BIOS boot ROM */ + BOOT_SIZE_INC = 512, /* image size measured in 512B chunks */ + BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */ + BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment */ +}; + +/* + * t4_load_boot - download boot flash + * @adapter: the adapter + * @boot_data: the boot image to write + * @size: image size + * + * Write the supplied boot image to the card's serial flash. + * The boot image has the following sections: a 28-byte header and the + * boot image. + */ +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size) +{ + int ret, addr; + unsigned int i; + unsigned int boot_sector = boot_addr * 1024; + unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; + + /* + * Perform some primitive sanity testing to avoid accidentally + * writing garbage over the boot sectors. We ought to check for + * more but it's not worth it for now ... + */ + if (size < BOOT_MIN_SIZE || size > BOOT_MAX_SIZE) { + CH_ERR(adap, "boot image too small/large\n"); + return -EFBIG; + } + + /* + * Make sure the boot image does not encroach on the firmware region + */ + if ((boot_sector + size) >> 16 > FLASH_FW_START_SEC) { + CH_ERR(adap, "boot image encroaching on firmware region\n"); + return -EFBIG; + } + + i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ + ret = t4_flash_erase_sectors(adap, boot_sector >> 16, + (boot_sector >> 16) + i - 1); + if (ret) + goto out; + + /* + * Skip over the first SF_PAGE_SIZE worth of data and write it after + * we finish copying the rest of the boot image. This will ensure + * that the BIOS boot header will only be written if the boot image + * was written in full. + */ + addr = boot_sector; + for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { + addr += SF_PAGE_SIZE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 6 18:46:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E821065674; Mon, 6 Feb 2012 18:46:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF29C8FC1A; Mon, 6 Feb 2012 18:46:50 +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 q16IkoWI048865; Mon, 6 Feb 2012 18:46:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IkoQY048863; Mon, 6 Feb 2012 18:46:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061846.q16IkoQY048863@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231096 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:46:50 -0000 Author: np Date: Mon Feb 6 18:46:49 2012 New Revision: 231096 URL: http://svn.freebsd.org/changeset/base/231096 Log: MFC r229714 Always release the inp lock before returning from tcp_detach. Modified: stable/9/sys/netinet/tcp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/9/sys/netinet/tcp_usrreq.c Mon Feb 6 18:15:46 2012 (r231095) +++ stable/9/sys/netinet/tcp_usrreq.c Mon Feb 6 18:46:49 2012 (r231096) @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp tcp_discardcb(tp); in_pcbdetach(inp); in_pcbfree(inp); - } else + } else { in_pcbdetach(inp); + INP_WUNLOCK(inp); + } } } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 02:21:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A25106564A; Tue, 7 Feb 2012 02:21:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43688FC16; Tue, 7 Feb 2012 02:21:17 +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 q172LHTN064048; Tue, 7 Feb 2012 02:21:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172LHAY064046; Tue, 7 Feb 2012 02:21:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070221.q172LHAY064046@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 02:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231104 - stable/9/sys/dev/cxgb/common X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:21:17 -0000 Author: np Date: Tue Feb 7 02:21:17 2012 New Revision: 231104 URL: http://svn.freebsd.org/changeset/base/231104 Log: MFC r228825: Fix return value of function. Modified: stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/cxgb/common/cxgb_aq100x.c ============================================================================== --- stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 01:26:29 2012 (r231103) +++ stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:17 2012 (r231104) @@ -232,7 +232,7 @@ aq100x_power_down(struct cphy *phy, int err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, BMCR_PDOWN, off ? BMCR_PDOWN : 0); if (err || off) - return (v); + return (err); msleep(300); do { From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 03:34:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F09106564A; Tue, 7 Feb 2012 03:34:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3338FC14; Tue, 7 Feb 2012 03:34:57 +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 q173Yvaw066772; Tue, 7 Feb 2012 03:34:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173YvQG066770; Tue, 7 Feb 2012 03:34:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070334.q173YvQG066770@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231108 - stable/9/usr.sbin/pkg_install/info X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:34:57 -0000 Author: emaste Date: Tue Feb 7 03:34:57 2012 New Revision: 231108 URL: http://svn.freebsd.org/changeset/base/231108 Log: MFC r226697 and r226708: Avoid printing // for packages that install to / I have some packages that install to / (for whatever reason). Right now we print entries of the form //path/to/file when listing files (pkg_info -L, pkg_info -g etc.) This change avoids printing the redundant / . Staticify elide_root() for now to fix build. Modified: stable/9/usr.sbin/pkg_install/info/show.c Directory Properties: stable/9/usr.sbin/pkg_install/info/ (props changed) Modified: stable/9/usr.sbin/pkg_install/info/show.c ============================================================================== --- stable/9/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:15:12 2012 (r231107) +++ stable/9/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:34:57 2012 (r231108) @@ -207,6 +207,14 @@ show_plist(const char *title, Package *p } } +static const char * +elide_root(const char *dir) +{ + if (strcmp(dir, "/") == 0) + return ""; + return dir; +} + /* Show all files in the packing list (except ignored ones) */ void show_files(const char *title, Package *plist) @@ -223,7 +231,7 @@ show_files(const char *title, Package *p switch(p->type) { case PLIST_FILE: if (!ign) - printf("%s/%s\n", dir, p->name); + printf("%s/%s\n", elide_root(dir), p->name); ign = FALSE; break; @@ -270,7 +278,7 @@ show_size(const char *title, Package *pl switch (p->type) { case PLIST_FILE: if (!ign) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!lstat(tmp, &sb)) { size += sb.st_size; if (Verbose) @@ -328,7 +336,7 @@ show_cksum(const char *title, Package *p else dir = p->name; } else if (p->type == PLIST_FILE) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!fexists(tmp)) warnx("%s doesn't exist", tmp); else if (p->next && p->next->type == PLIST_COMMENT && From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 04:03:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DFAD106566B; Tue, 7 Feb 2012 04:03:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190E68FC0C; Tue, 7 Feb 2012 04:03:40 +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 q1743dW7067855; Tue, 7 Feb 2012 04:03:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1743dux067853; Tue, 7 Feb 2012 04:03:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070403.q1743dux067853@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 04:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231112 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:03:40 -0000 Author: emaste Date: Tue Feb 7 04:03:39 2012 New Revision: 231112 URL: http://svn.freebsd.org/changeset/base/231112 Log: MFC r227893 and r228119: Avoid double free creating a new RAID with invalid command line arguments. In build_volume(), check if arrays is allocated before traversing its items. While parsing the arrays input, it's possible that we reach the error path before initializing the 'arrays' pointer, which in turn leads to a NULL deference. Modified: stable/9/usr.sbin/mfiutil/mfi_config.c Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:00:57 2012 (r231111) +++ stable/9/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:03:39 2012 (r231112) @@ -348,6 +348,7 @@ parse_array(int fd, int raid_type, char error = mfi_lookup_drive(fd, cp, &device_id); if (error) { free(info->drives); + info->drives = NULL; return (error); } @@ -355,12 +356,14 @@ parse_array(int fd, int raid_type, char error = errno; warn("Failed to fetch drive info for drive %s", cp); free(info->drives); + info->drives = NULL; return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); free(info->drives); + info->drives = NULL; return (EINVAL); } } @@ -817,9 +820,11 @@ error: free(config); free(state.volumes); free(state.arrays); - for (i = 0; i < narrays; i++) - free(arrays[i].drives); - free(arrays); + if (arrays != NULL) { + for (i = 0; i < narrays; i++) + free(arrays[i].drives); + free(arrays); + } close(fd); return (error); From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 09:37:30 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0BD21065674; Tue, 7 Feb 2012 09:37:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAC058FC0C; Tue, 7 Feb 2012 09:37:30 +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 q179bUpc078603; Tue, 7 Feb 2012 09:37:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179bUGm078601; Tue, 7 Feb 2012 09:37:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070937.q179bUGm078601@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231119 - stable/9/usr.sbin/boot0cfg X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:37:31 -0000 Author: kib Date: Tue Feb 7 09:37:30 2012 New Revision: 231119 URL: http://svn.freebsd.org/changeset/base/231119 Log: MFC r230978: Be as explicit as possible when describing relation between the -m mask argument and slices. Adjust example for the same reason. Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:27:07 2012 (r231118) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:37:30 2012 (r231119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2011 +.Dd February 4, 2012 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -114,6 +114,9 @@ Specify slices to be enabled/disabled, w .Ar mask is an integer between 0 (no slices enabled) and 0xf (all four slices enabled). +Each mask bit enables corresponding slice if set to 1. +The least significant bit of the mask corresponds to slice 1, +the most significant bit of the mask corresponds to slice 4. .It Fl o Ar options A comma-separated string of any of the following options may be specified (with @@ -172,9 +175,9 @@ To boot slice 2 on the next boot: .Pp .Dl "boot0cfg -s 2 ad0" .Pp -To enable just slices 1 and 2 in the menu: +To enable just slices 1 and 3 in the menu: .Pp -.Dl "boot0cfg -m 0x3 ad0" +.Dl "boot0cfg -m 0x5 ad0" .Pp To go back to non-interactive booting, use .Xr fdisk 8 From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 16:07:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BF3106566B; Tue, 7 Feb 2012 16:07:29 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9BD98FC08; Tue, 7 Feb 2012 16:07:29 +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 q17G7TiA096639; Tue, 7 Feb 2012 16:07:29 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17G7TW0096635; Tue, 7 Feb 2012 16:07:29 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202071607.q17G7TW0096635@svn.freebsd.org> From: Olivier Houchard Date: Tue, 7 Feb 2012 16:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231132 - in stable/9/sys/arm: arm include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 16:07:29 -0000 Author: cognet Date: Tue Feb 7 16:07:29 2012 New Revision: 231132 URL: http://svn.freebsd.org/changeset/base/231132 Log: MFC r226441 and r226443 r226441: Explicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the page has been allocated, or we could end up using random values, and bad things could happen. PR: arm/161492 Submitted by: Ian Lepore r226443: Fix 2 bugs : - A race condition could happen if two threads were using RAS at the same time as the code didn't reset RAS_END, the RAS code could believe we were not in a RAS, when we were in fact. - Using signed value logic to compare addresses wasn't such a good idea. Many thanks to Ian to investigate on these issues. Pointy hat to: cognet PR: arm/161498 Submitted by: Ian Lepore Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45907106566C; Tue, 7 Feb 2012 17:42:11 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 334A78FC08; Tue, 7 Feb 2012 17:42: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 q17HgB09099747; Tue, 7 Feb 2012 17:42:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HgBg5099745; Tue, 7 Feb 2012 17:42:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202071742.q17HgBg5099745@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 7 Feb 2012 17:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231135 - stable/9/usr.bin/grep X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:42:11 -0000 Author: gabor Date: Tue Feb 7 17:42:10 2012 New Revision: 231135 URL: http://svn.freebsd.org/changeset/base/231135 Log: MFC r230141 (eadler): - Remove duplicate line from usage() Modified: stable/9/usr.bin/grep/grep.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Tue Feb 7 17:21:54 2012 (r231134) +++ stable/9/usr.bin/grep/grep.c Tue Feb 7 17:42:10 2012 (r231135) @@ -158,7 +158,6 @@ usage(void) { fprintf(stderr, getstr(4), getprogname()); fprintf(stderr, "%s", getstr(5)); - fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(6)); fprintf(stderr, "%s", getstr(7)); exit(2); From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 17:46:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9426E106566C; Tue, 7 Feb 2012 17:46:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 826198FC16; Tue, 7 Feb 2012 17:46:02 +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 q17Hk2b8000144; Tue, 7 Feb 2012 17:46:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hk2Hb000142; Tue, 7 Feb 2012 17:46:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071746.q17Hk2Hb000142@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231138 - stable/9/usr.sbin/jail X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:46:02 -0000 Author: mm Date: Tue Feb 7 17:46:02 2012 New Revision: 231138 URL: http://svn.freebsd.org/changeset/base/231138 Log: MFC r230495: Try resolving jail path with realpath(3). jail(8) does a chdir(2) to the given path argument. Kernel evaluates the jail path from the new cwd and not from the original cwd, which leads to undesired behavior if given a relative path. Reviewed by: jamie Modified: stable/9/usr.sbin/jail/jail.c Directory Properties: stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/usr.sbin/jail/jail.c ============================================================================== --- stable/9/usr.sbin/jail/jail.c Tue Feb 7 17:45:11 2012 (r231137) +++ stable/9/usr.sbin/jail/jail.c Tue Feb 7 17:46:02 2012 (r231138) @@ -508,6 +508,7 @@ static void set_param(const char *name, char *value) { struct jailparam *param; + char path[PATH_MAX]; int i; static int paramlistsize; @@ -520,8 +521,13 @@ set_param(const char *name, char *value) } /* jail_set won't chdir along with its chroot, so do it here. */ - if (!strcmp(name, "path") && chdir(value) < 0) - err(1, "chdir: %s", value); + if (!strcmp(name, "path")) { + /* resolve the path with realpath(3) */ + if (realpath(value, path) != NULL) + value = path; + if (chdir(value) < 0) + err(1, "chdir: %s", value); + } /* Check for repeat parameters */ for (i = 0; i < nparams; i++) From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 17:52:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14E40106566C; Tue, 7 Feb 2012 17:52:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0320A8FC0C; Tue, 7 Feb 2012 17:52:33 +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 q17HqWD5000477; Tue, 7 Feb 2012 17:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HqWTB000475; Tue, 7 Feb 2012 17:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202071752.q17HqWTB000475@svn.freebsd.org> From: Michael Tuexen Date: Tue, 7 Feb 2012 17:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231140 - stable/9/lib/libc/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:52:33 -0000 Author: tuexen Date: Tue Feb 7 17:52:32 2012 New Revision: 231140 URL: http://svn.freebsd.org/changeset/base/231140 Log: MFC r227755: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Tue Feb 7 17:47:04 2012 (r231139) +++ stable/9/lib/libc/net/sctp_sys_calls.c Tue Feb 7 17:52:32 2012 (r231140) @@ -412,6 +412,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PEER_ADDR_THLDS: ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; break; + case SCTP_REMOTE_UDP_ENCAPS_PORT: + ((struct sctp_udpencaps *)arg)->sue_assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 17:57:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716271065670; Tue, 7 Feb 2012 17:57:34 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1478FC08; Tue, 7 Feb 2012 17:57:34 +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 q17HvYbu000687; Tue, 7 Feb 2012 17:57:34 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HvYul000678; Tue, 7 Feb 2012 17:57:34 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071757.q17HvYul000678@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231141 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:57:34 -0000 Author: mm Date: Tue Feb 7 17:57:33 2012 New Revision: 231141 URL: http://svn.freebsd.org/changeset/base/231141 Log: MFC r230514: Merge illumos revisions 13572, 13573, 13574: Rev. 13572: disk sync write perf regression when slog is used post oi_148 [1] Rev. 13573: crash during reguid causes stale config [2] allow and unallow missing from zpool history since removal of pyzfs [5] Rev. 13574: leaking a vdev when removing an l2cache device [3] memory leak when adding a file-based l2arc device [4] leak in ZFS from metaslab_group_create and zfs_ereport_checksum [6] References: https://www.illumos.org/issues/1909 [1] https://www.illumos.org/issues/1949 [2] https://www.illumos.org/issues/1951 [3] https://www.illumos.org/issues/1952 [4] https://www.illumos.org/issues/1953 [5] https://www.illumos.org/issues/1954 [6] Obtained from: illumos (issues #1909, #1949, #1951, #1952, #1953, #1954) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:33 2012 (r231141) @@ -4197,7 +4197,7 @@ tryagain: (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN); - if (zfs_ioctl(hdl, ZFS_IOC_GET_FSACL, &zc) != 0) { + if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"), zc.zc_name); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:33 2012 (r231141) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -36,7 +36,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang or dump device related allocations + * Currently we don't allow any gang, zil, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:33 2012 (r231141) @@ -1073,8 +1073,10 @@ spa_unload(spa_t *spa) } spa->spa_spares.sav_count = 0; - for (i = 0; i < spa->spa_l2cache.sav_count; i++) + for (i = 0; i < spa->spa_l2cache.sav_count; i++) { + vdev_clear_stats(spa->spa_l2cache.sav_vdevs[i]); vdev_free(spa->spa_l2cache.sav_vdevs[i]); + } if (spa->spa_l2cache.sav_vdevs) { kmem_free(spa->spa_l2cache.sav_vdevs, spa->spa_l2cache.sav_count * sizeof (void *)); @@ -1302,11 +1304,13 @@ spa_load_l2cache(spa_t *spa) vd = oldvdevs[i]; if (vd != NULL) { + ASSERT(vd->vdev_isl2cache); + if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - (void) vdev_close(vd); - spa_l2cache_remove(vd); + vdev_clear_stats(vd); + vdev_free(vd); } } @@ -1949,7 +1953,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ */ if (type != SPA_IMPORT_ASSEMBLE) { spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); - error = vdev_validate(rvd); + error = vdev_validate(rvd, mosconfig); spa_config_exit(spa, SCL_ALL, FTAG); if (error != 0) @@ -2818,6 +2822,7 @@ spa_validate_aux_devs(spa_t *spa, nvlist if ((strcmp(config, ZPOOL_CONFIG_L2CACHE) == 0) && strcmp(vd->vdev_ops->vdev_op_type, VDEV_TYPE_DISK) != 0) { error = ENOTBLK; + vdev_free(vd); goto out; } #endif @@ -2927,10 +2932,6 @@ spa_l2cache_drop(spa_t *spa) if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - if (vd->vdev_isl2cache) - spa_l2cache_remove(vd); - vdev_clear_stats(vd); - (void) vdev_close(vd); } } @@ -3929,7 +3930,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui pvd = oldvd->vdev_parent; if ((error = spa_config_parse(spa, &newrootvd, nvroot, NULL, 0, - VDEV_ALLOC_ADD)) != 0) + VDEV_ALLOC_ATTACH)) != 0) return (spa_vdev_exit(spa, NULL, txg, EINVAL)); if (newrootvd->vdev_children != 1) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:33 2012 (r231141) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_H @@ -48,7 +49,7 @@ extern boolean_t zfs_nocacheflush; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); extern boolean_t vdev_uses_zvols(vdev_t *); -extern int vdev_validate(vdev_t *); +extern int vdev_validate(vdev_t *, boolean_t); extern void vdev_close(vdev_t *); extern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace); extern void vdev_reopen(vdev_t *); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:33 2012 (r231141) @@ -261,6 +261,7 @@ typedef struct vdev_label { #define VDEV_ALLOC_L2CACHE 3 #define VDEV_ALLOC_ROOTPOOL 4 #define VDEV_ALLOC_SPLIT 5 +#define VDEV_ALLOC_ATTACH 6 /* * Allocate or free a vdev Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:33 2012 (r231141) @@ -499,7 +499,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_removing); } - if (parent && !parent->vdev_parent) { + if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { ASSERT(alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_ADD || alloctype == VDEV_ALLOC_SPLIT || @@ -675,6 +675,8 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + if (tvd->vdev_mg) + ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); tvd->vdev_mg = svd->vdev_mg; tvd->vdev_ms = svd->vdev_ms; @@ -1294,13 +1296,18 @@ vdev_open(vdev_t *vd) * contents. This needs to be done before vdev_load() so that we don't * inadvertently do repair I/Os to the wrong device. * + * If 'strict' is false ignore the spa guid check. This is necessary because + * if the machine crashed during a re-guid the new guid might have been written + * to all of the vdev labels, but not the cached config. The strict check + * will be performed when the pool is opened again using the mos config. + * * This function will only return failure if one of the vdevs indicates that it * has since been destroyed or exported. This is only possible if * /etc/zfs/zpool.cache was readonly at the time. Otherwise, the vdev state * will be updated but the function will return 0. */ int -vdev_validate(vdev_t *vd) +vdev_validate(vdev_t *vd, boolean_t strict) { spa_t *spa = vd->vdev_spa; nvlist_t *label; @@ -1308,7 +1315,7 @@ vdev_validate(vdev_t *vd) uint64_t state; for (int c = 0; c < vd->vdev_children; c++) - if (vdev_validate(vd->vdev_child[c]) != 0) + if (vdev_validate(vd->vdev_child[c], strict) != 0) return (EBADF); /* @@ -1338,8 +1345,9 @@ vdev_validate(vdev_t *vd) return (0); } - if (nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, - &guid) != 0 || guid != spa_guid(spa)) { + if (strict && (nvlist_lookup_uint64(label, + ZPOOL_CONFIG_POOL_GUID, &guid) != 0 || + guid != spa_guid(spa))) { vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, VDEV_AUX_CORRUPT_DATA); nvlist_free(label); @@ -1501,7 +1509,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd); + (void) vdev_validate(vd, B_TRUE); } /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:33 2012 (r231141) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -709,6 +713,10 @@ zfs_ereport_start_checksum(spa_t *spa, v if (report->zcr_ereport == NULL) { report->zcr_free(report->zcr_cbdata, report->zcr_cbinfo); + if (report->zcr_ckinfo != NULL) { + kmem_free(report->zcr_ckinfo, + sizeof (*report->zcr_ckinfo)); + } kmem_free(report, sizeof (*report)); return; } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:33 2012 (r231141) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -2235,13 +2235,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) + /* + * ZIL blocks are always contiguous (i.e. not gang blocks) so we + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang" + * when allocating them. + */ + if (use_slog) { error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } - if (error) + if (error) { error = metaslab_alloc(spa, spa_normal_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } if (error == 0) { BP_SET_LSIZE(new_bp, size); From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 18:05:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD171065672; Tue, 7 Feb 2012 18:05:11 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 395F28FC16; Tue, 7 Feb 2012 18:05: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 q17I5Bqk001032; Tue, 7 Feb 2012 18:05:11 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17I5Btw001030; Tue, 7 Feb 2012 18:05:11 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201202071805.q17I5Btw001030@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 7 Feb 2012 18:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231143 - stable/9/sys/dev/iwn X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:05:11 -0000 Author: bschmidt Date: Tue Feb 7 18:05:10 2012 New Revision: 231143 URL: http://svn.freebsd.org/changeset/base/231143 Log: MFC r230620: On state changes from RUN to anything else the AGGR sessions are cleared/dropped leading to qid2tap[n] being NULL as there no longer is a tap. Now, if there have been lots of frames queued the firmware processes and returns those after the tap is gone. Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Tue Feb 7 17:57:59 2012 (r231142) +++ stable/9/sys/dev/iwn/if_iwn.c Tue Feb 7 18:05:10 2012 (r231143) @@ -2813,11 +2813,13 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bitmap |= 1ULL << bit; } tap = sc->qid2tap[qid]; - tid = WME_AC_TO_TID(tap->txa_ac); - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; - wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + if (tap != NULL) { + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + } seqno = le32toh(*(status + nframes)) & 0xfff; for (lastidx = (seqno & 0xff); ring->read != lastidx;) { From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 18:54:47 2012 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E972106564A; Tue, 7 Feb 2012 18:54:47 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 83C3E8FC1B; Tue, 7 Feb 2012 18:54:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q17IcIDS046804; Tue, 7 Feb 2012 22:38:18 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q17IcI66046803; Tue, 7 Feb 2012 22:38:18 +0400 (MSK) (envelope-from ache) Date: Tue, 7 Feb 2012 22:38:18 +0400 From: Andrey Chernov To: Martin Matuska Message-ID: <20120207183818.GA46739@vniz.net> Mail-Followup-To: Andrey Chernov , Martin Matuska , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-stable-9@FreeBSD.ORG References: <201202071746.q17Hk2Hb000142@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202071746.q17Hk2Hb000142@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, svn-src-stable-9@FreeBSD.ORG Subject: Re: svn commit: r231138 - stable/9/usr.sbin/jail X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:54:47 -0000 On Tue, Feb 07, 2012 at 05:46:02PM +0000, Martin Matuska wrote: > Author: mm > Date: Tue Feb 7 17:46:02 2012 > New Revision: 231138 > URL: http://svn.freebsd.org/changeset/base/231138 > > Log: > MFC r230495: > Try resolving jail path with realpath(3). Please note that our realpath(3) is far from perfect, see my followup to http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/128933 -- http://ache.vniz.net/ From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:11:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A0DF1065676; Tue, 7 Feb 2012 19:11:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6729F8FC2B; Tue, 7 Feb 2012 19:11:55 +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 q17JBtuR003212; Tue, 7 Feb 2012 19:11:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JBtxI003203; Tue, 7 Feb 2012 19:11:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071911.q17JBtxI003203@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231145 - in stable/9/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:11:55 -0000 Author: jhb Date: Tue Feb 7 19:11:54 2012 New Revision: 231145 URL: http://svn.freebsd.org/changeset/base/231145 Log: MFC 228957: Implement linux_fadvise64() and linux_fadvise64_64() using kern_posix_fadvise(). Modified: stable/9/sys/amd64/linux32/linux.h stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/amd64/linux32/syscalls.master stable/9/sys/compat/linux/linux_file.c stable/9/sys/i386/linux/linux.h stable/9/sys/i386/linux/linux_dummy.c stable/9/sys/i386/linux/syscalls.master Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/amd64/linux32/linux.h ============================================================================== --- stable/9/sys/amd64/linux32/linux.h Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/linux.h Tue Feb 7 19:11:54 2012 (r231145) @@ -597,6 +597,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:11:54 2012 (r231145) @@ -59,7 +59,6 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(epoll_create); @@ -72,7 +71,6 @@ DUMMY(timer_gettime); DUMMY(timer_getoverrun); DUMMY(timer_delete); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/9/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/9/sys/amd64/linux32/syscalls.master Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) @@ -419,7 +419,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -443,7 +444,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } Modified: stable/9/sys/compat/linux/linux_file.c ============================================================================== --- stable/9/sys/compat/linux/linux_file.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/compat/linux/linux_file.c Tue Feb 7 19:11:54 2012 (r231145) @@ -1530,3 +1530,48 @@ linux_lchown(struct thread *td, struct l LFREEPATH(path); return (error); } + +static int +convert_fadvice(int advice) +{ + switch (advice) { + case LINUX_POSIX_FADV_NORMAL: + return (POSIX_FADV_NORMAL); + case LINUX_POSIX_FADV_RANDOM: + return (POSIX_FADV_RANDOM); + case LINUX_POSIX_FADV_SEQUENTIAL: + return (POSIX_FADV_SEQUENTIAL); + case LINUX_POSIX_FADV_WILLNEED: + return (POSIX_FADV_WILLNEED); + case LINUX_POSIX_FADV_DONTNEED: + return (POSIX_FADV_DONTNEED); + case LINUX_POSIX_FADV_NOREUSE: + return (POSIX_FADV_NOREUSE); + default: + return (-1); + } +} + +int +linux_fadvise64(struct thread *td, struct linux_fadvise64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} + +int +linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} Modified: stable/9/sys/i386/linux/linux.h ============================================================================== --- stable/9/sys/i386/linux/linux.h Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/linux.h Tue Feb 7 19:11:54 2012 (r231145) @@ -573,6 +573,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/9/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/9/sys/i386/linux/linux_dummy.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/linux_dummy.c Tue Feb 7 19:11:54 2012 (r231145) @@ -62,14 +62,12 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/9/sys/i386/linux/syscalls.master ============================================================================== --- stable/9/sys/i386/linux/syscalls.master Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) @@ -421,7 +421,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -447,7 +448,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:13:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220E11065673; Tue, 7 Feb 2012 19:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EBD98FC15; Tue, 7 Feb 2012 19:13:35 +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 q17JDZF8003347; Tue, 7 Feb 2012 19:13:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JDYvu003336; Tue, 7 Feb 2012 19:13:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071913.q17JDYvu003336@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231147 - in stable/9/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:13:35 -0000 Author: jhb Date: Tue Feb 7 19:13:34 2012 New Revision: 231147 URL: http://svn.freebsd.org/changeset/base/231147 Log: Regen. Modified: stable/9/sys/amd64/linux32/linux32_proto.h stable/9/sys/amd64/linux32/linux32_syscall.h stable/9/sys/amd64/linux32/linux32_syscalls.c stable/9/sys/amd64/linux32/linux32_sysent.c stable/9/sys/amd64/linux32/linux32_systrace_args.c stable/9/sys/i386/linux/linux_proto.h stable/9/sys/i386/linux/linux_syscall.h stable/9/sys/i386/linux/linux_syscalls.c stable/9/sys/i386/linux/linux_sysent.c stable/9/sys/i386/linux/linux_systrace_args.c Modified: stable/9/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_set_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -829,7 +832,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/9/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ const char *linux_syscallnames[] = { Modified: stable/9/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #include "opt_compat.h" @@ -269,7 +269,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ @@ -291,7 +291,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ Modified: stable/9/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) @@ -1674,7 +1674,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1808,7 +1813,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4613,6 +4623,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4772,6 +4798,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: Modified: stable/9/sys/i386/linux/linux_proto.h ============================================================================== --- stable/9/sys/i386/linux/linux_proto.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_get_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -834,7 +837,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/9/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/9/sys/i386/linux/linux_syscall.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/9/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ const char *linux_syscallnames[] = { Modified: stable/9/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/9/sys/i386/linux/linux_sysent.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #include @@ -268,7 +268,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ @@ -290,7 +290,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ Modified: stable/9/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/9/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) @@ -1724,7 +1724,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1873,7 +1878,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4775,6 +4785,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4984,6 +5010,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:23:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FF4106564A; Tue, 7 Feb 2012 19:23:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6E058FC13; Tue, 7 Feb 2012 19:23:08 +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 q17JN80S003795; Tue, 7 Feb 2012 19:23:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JN8o4003792; Tue, 7 Feb 2012 19:23:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071923.q17JN8o4003792@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231150 - in stable/9/sys: i386/i386 mips/mips X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:23:09 -0000 Author: jhb Date: Tue Feb 7 19:23:08 2012 New Revision: 231150 URL: http://svn.freebsd.org/changeset/base/231150 Log: MFC 228962: Use curthread rather than PCPU_GET(curthread). 'curthread' uses special-case optimizations on several platforms and is preferred. Modified: stable/9/sys/i386/i386/sys_machdep.c stable/9/sys/mips/mips/gdb_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/9/sys/i386/i386/sys_machdep.c Tue Feb 7 19:14:13 2012 (r231149) +++ stable/9/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:08 2012 (r231150) @@ -549,7 +549,7 @@ user_ldt_free(struct thread *td) return; } - if (td == PCPU_GET(curthread)) { + if (td == curthread) { #ifdef XEN i386_reset_ldt(&default_proc_ldt); PCPU_SET(currentldt, (int)&default_proc_ldt); Modified: stable/9/sys/mips/mips/gdb_machdep.c ============================================================================== --- stable/9/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:14:13 2012 (r231149) +++ stable/9/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:08 2012 (r231150) @@ -116,7 +116,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz { *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == PCPU_GET(curthread)) { + if (kdb_thread == curthread) { register_t *zero_ptr = &kdb_frame->zero; return zero_ptr + regnum; } @@ -154,7 +154,7 @@ gdb_cpu_setreg(int regnum, void *val) switch (regnum) { case GDB_REG_PC: kdb_thrctx->pcb_context[10] = *(register_t *)val; - if (kdb_thread == PCPU_GET(curthread)) + if (kdb_thread == curthread) kdb_frame->pc = *(register_t *)val; } } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:32:21 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3040A106566C; Tue, 7 Feb 2012 19:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0158FC0C; Tue, 7 Feb 2012 19:32:21 +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 q17JWKxl004150; Tue, 7 Feb 2012 19:32:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JWKK0004149; Tue, 7 Feb 2012 19:32:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071932.q17JWKK0004149@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231152 - in stable/9/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica c... X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:32:21 -0000 Author: jhb Date: Tue Feb 7 19:32:20 2012 New Revision: 231152 URL: http://svn.freebsd.org/changeset/base/231152 Log: Hoist mergeinfo for modules/sound/driver/* up to sys/. Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:40:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED0D106566C; Tue, 7 Feb 2012 19:40:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC8B48FC14; Tue, 7 Feb 2012 19:40:52 +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 q17JeqG8004452; Tue, 7 Feb 2012 19:40:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JeqjF004449; Tue, 7 Feb 2012 19:40:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071940.q17JeqjF004449@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231153 - stable/9/sys/dev/ichwd X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:40:53 -0000 Author: jhb Date: Tue Feb 7 19:40:52 2012 New Revision: 231153 URL: http://svn.freebsd.org/changeset/base/231153 Log: MFC 229598: Remove use of explicit bus space tags and handles and use methods that operate on resource objects instead. Modified: stable/9/sys/dev/ichwd/ichwd.c stable/9/sys/dev/ichwd/ichwd.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.c Tue Feb 7 19:32:20 2012 (r231152) +++ stable/9/sys/dev/ichwd/ichwd.c Tue Feb 7 19:40:52 2012 (r231153) @@ -198,26 +198,26 @@ static struct ichwd_device ichwd_devices static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ - bus_space_read_1((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_1((sc)->tco_res, (off)) #define ichwd_read_tco_2(sc, off) \ - bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_2((sc)->tco_res, (off)) #define ichwd_read_tco_4(sc, off) \ - bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_4((sc)->tco_res, (off)) #define ichwd_read_smi_4(sc, off) \ - bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off)) + bus_read_4((sc)->smi_res, (off)) #define ichwd_read_gcs_4(sc, off) \ - bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off)) + bus_read_4((sc)->gcs_res, (off)) #define ichwd_write_tco_1(sc, off, val) \ - bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_1((sc)->tco_res, (off), (val)) #define ichwd_write_tco_2(sc, off, val) \ - bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_2((sc)->tco_res, (off), (val)) #define ichwd_write_tco_4(sc, off, val) \ - bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_4((sc)->tco_res, (off), (val)) #define ichwd_write_smi_4(sc, off, val) \ - bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val)) + bus_write_4((sc)->smi_res, (off), (val)) #define ichwd_write_gcs_4(sc, off, val) \ - bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val)) + bus_write_4((sc)->gcs_res, (off), (val)) #define ichwd_verbose_printf(dev, ...) \ do { \ @@ -519,8 +519,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve SMI registers\n"); goto fail; } - sc->smi_bst = rman_get_bustag(sc->smi_res); - sc->smi_bsh = rman_get_bushandle(sc->smi_res); sc->tco_rid = 1; sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid, @@ -530,8 +528,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve TCO registers\n"); goto fail; } - sc->tco_bst = rman_get_bustag(sc->tco_res); - sc->tco_bsh = rman_get_bushandle(sc->tco_res); sc->gcs_rid = 0; if (sc->ich_version >= 6) { @@ -541,12 +537,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve GCS registers\n"); goto fail; } - sc->gcs_bst = rman_get_bustag(sc->gcs_res); - sc->gcs_bsh = rman_get_bushandle(sc->gcs_res); - } else { - sc->gcs_res = 0; - sc->gcs_bst = 0; - sc->gcs_bsh = 0; } if (ichwd_clear_noreboot(sc) != 0) Modified: stable/9/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.h Tue Feb 7 19:32:20 2012 (r231152) +++ stable/9/sys/dev/ichwd/ichwd.h Tue Feb 7 19:40:52 2012 (r231153) @@ -48,18 +48,12 @@ struct ichwd_softc { int smi_enabled; int smi_rid; struct resource *smi_res; - bus_space_tag_t smi_bst; - bus_space_handle_t smi_bsh; int tco_rid; struct resource *tco_res; - bus_space_tag_t tco_bst; - bus_space_handle_t tco_bsh; int gcs_rid; struct resource *gcs_res; - bus_space_tag_t gcs_bst; - bus_space_handle_t gcs_bsh; eventhandler_tag ev_tag; }; From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:53:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1CC2106566C; Tue, 7 Feb 2012 19:53:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A682C8FC0C; Tue, 7 Feb 2012 19:53:02 +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 q17Jr2Fm004951; Tue, 7 Feb 2012 19:53:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Jr2iZ004946; Tue, 7 Feb 2012 19:53:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071953.q17Jr2iZ004946@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231156 - in stable/9/sys/dev: bxe qlxgb sfxge X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:53:03 -0000 Author: jhb Date: Tue Feb 7 19:53:02 2012 New Revision: 231156 URL: http://svn.freebsd.org/changeset/base/231156 Log: MFC 229613: Update recently added drivers to use the if_*addr_r*lock() wrapper functions instead of using the IF_ADDR_LOCK directly. The wrapper functions are the supported interface for device drivers. Modified: stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/qlxgb/qla_os.c stable/9/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/bxe/if_bxe.c Tue Feb 7 19:53:02 2012 (r231156) @@ -14115,7 +14115,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) i = 0; config = BXE_SP(sc, mcast_config); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14144,7 +14144,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) config_table->cam_entry.lsb_mac_addr); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); old = config->hdr.length; @@ -14172,7 +14172,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) /* Accept one or more multicasts */ memset(mc_filter, 0, 4 * MC_HASH_SIZE); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14184,7 +14184,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) bit &= 0x1f; mc_filter[regidx] |= (1 << bit); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < MC_HASH_SIZE; i++) REG_WR(sc, MC_HASH_OFFSET(sc, i), mc_filter[i]); Modified: stable/9/sys/dev/qlxgb/qla_os.c ============================================================================== --- stable/9/sys/dev/qlxgb/qla_os.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/qlxgb/qla_os.c Tue Feb 7 19:53:02 2012 (r231156) @@ -760,7 +760,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a int mcnt = 0; struct ifnet *ifp = ha->ifp; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -776,7 +776,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); qla_hw_set_multi(ha, mta, mcnt, add_multi); Modified: stable/9/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/9/sys/dev/sfxge/sfxge_port.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/sfxge/sfxge_port.c Tue Feb 7 19:53:02 2012 (r231156) @@ -301,7 +301,7 @@ sfxge_mac_filter_set_locked(struct sfxge * 0xff. */ bucket[0xff] = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) { sa = (struct sockaddr_dl *)ifma->ifma_addr; @@ -309,7 +309,7 @@ sfxge_mac_filter_set_locked(struct sfxge bucket[index] = 1; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } return efx_mac_hash_set(enp, bucket); } @@ -391,10 +391,10 @@ sfxge_port_start(struct sfxge_softc *sc) goto fail2; /* Set the unicast address */ - IF_ADDR_LOCK(ifp); + if_addr_rlock(ifp); bcopy(LLADDR((struct sockaddr_dl *)ifp->if_addr->ifa_addr), mac_addr, sizeof(mac_addr)); - IF_ADDR_UNLOCK(ifp); + if_addr_runlock(ifp); if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0) goto fail; From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 19:55:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8DC106568C; Tue, 7 Feb 2012 19:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FEA28FC25; Tue, 7 Feb 2012 19:55:59 +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 q17JtwBh005100; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Jtwe5005098; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071955.q17Jtwe5005098@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231157 - stable/9/sys/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:55:59 -0000 Author: jhb Date: Tue Feb 7 19:55:58 2012 New Revision: 231157 URL: http://svn.freebsd.org/changeset/base/231157 Log: MFC 229614: Add new variants of the IF_ADDR_*LOCK*() macros used for protecting interface address lists that distinguish read locks from write locks. To preserve the KPI, the previous operations are mapped to the write lock macros. The lock is still kept as a mutex for now. Modified: stable/9/sys/net/if_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Tue Feb 7 19:53:02 2012 (r231156) +++ stable/9/sys/net/if_var.h Tue Feb 7 19:55:58 2012 (r231157) @@ -248,9 +248,15 @@ typedef void if_init_f_t(void *); #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) #define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +/* XXX: Compat. */ +#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) +#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 21:56:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9065B106566C; Tue, 7 Feb 2012 21:56: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 63DE08FC0C; Tue, 7 Feb 2012 21:56:59 +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 q17Lux50009058; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Lux75009056; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072156.q17Lux75009056@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 21:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231162 - in stable: 8/sbin/newfs_msdos 9/sbin/newfs_msdos X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:56:59 -0000 Author: delphij Date: Tue Feb 7 21:56:58 2012 New Revision: 231162 URL: http://svn.freebsd.org/changeset/base/231162 Log: MFC r227454: Use __packed to prevent alignment from taking place, which otherwise may change the on-disk format in an incompatible way. Without this change, msdosfs created on FreeBSD/arm would not be mountable. PR: bin/162486 Submitted by: Ian Lepore Reported by: Mattia Rossi Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/9/sbin/newfs_msdos/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/9/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 20:54:44 2012 (r231161) +++ stable/9/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 21:56:58 2012 (r231162) @@ -99,7 +99,7 @@ static const char rcsid[] = struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ u_int8_t bsOemName[8]; /* OEM name and version */ -}; +} __packed; struct bsbpb { u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ @@ -114,7 +114,7 @@ struct bsbpb { u_int8_t bpbHeads[2]; /* drive heads */ u_int8_t bpbHiddenSecs[4]; /* hidden sectors */ u_int8_t bpbHugeSectors[4]; /* big total sectors */ -}; +} __packed; struct bsxbpb { u_int8_t bpbBigFATsecs[4]; /* big sectors per FAT */ @@ -124,7 +124,7 @@ struct bsxbpb { u_int8_t bpbFSInfo[2]; /* file system info sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ u_int8_t bpbReserved[12]; /* reserved */ -}; +} __packed; struct bsx { u_int8_t exDriveNumber; /* drive number */ @@ -133,7 +133,7 @@ struct bsx { u_int8_t exVolumeID[4]; /* volume ID number */ u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ -}; +} __packed; struct de { u_int8_t deName[11]; /* name and extension */ @@ -143,7 +143,7 @@ struct de { u_int8_t deMDate[2]; /* creation date */ u_int8_t deStartCluster[2]; /* starting cluster */ u_int8_t deFileSize[4]; /* size */ -}; +} __packed; struct bpb { u_int bpbBytesPerSec; /* bytes per sector */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 22:13:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08FEF106566C; Tue, 7 Feb 2012 22:13:34 +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 EAFEF8FC15; Tue, 7 Feb 2012 22:13:33 +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 q17MDXCJ009681; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDXh9009679; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072213.q17MDXh9009679@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 22:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231164 - in stable: 8/usr.bin/newgrp 9/usr.bin/newgrp X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:34 -0000 Author: delphij Date: Tue Feb 7 22:13:33 2012 New Revision: 231164 URL: http://svn.freebsd.org/changeset/base/231164 Log: MFC r226274,r226416: Fix the error message when setgid() failed. PR: bin/161509 Submitted by: Jeremy Huddleston Modified: stable/9/usr.bin/newgrp/newgrp.c Directory Properties: stable/9/usr.bin/newgrp/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/newgrp/newgrp.c Directory Properties: stable/8/usr.bin/newgrp/ (props changed) Modified: stable/9/usr.bin/newgrp/newgrp.c ============================================================================== --- stable/9/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:24 2012 (r231163) +++ stable/9/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:33 2012 (r231164) @@ -140,7 +140,7 @@ restoregrps(void) if (initres < 0) warn("initgroups"); if (setres < 0) - warn("setgroups"); + warn("setgid"); } static void From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 7 22:13:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A409C106579D; Tue, 7 Feb 2012 22:13:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 507BB8FC18; Tue, 7 Feb 2012 22:13:39 +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 q17MDdUH009726; Tue, 7 Feb 2012 22:13:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDdb5009724; Tue, 7 Feb 2012 22:13:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202072213.q17MDdb5009724@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 22:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231165 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:41 -0000 Author: jhb Date: Tue Feb 7 22:13:38 2012 New Revision: 231165 URL: http://svn.freebsd.org/changeset/base/231165 Log: MFC 229465: Use correct locking when traversing interface address list. Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Tue Feb 7 22:13:33 2012 (r231164) +++ stable/9/sys/netinet6/in6.c Tue Feb 7 22:13:38 2012 (r231165) @@ -2211,9 +2211,7 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_UNLOCK(ifp); return (besta); } - IF_ADDR_UNLOCK(ifp); - IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2231,10 +2229,10 @@ in6_ifawithifp(struct ifnet *ifp, struct if (ifa != NULL) ifa_ref(ifa); - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ if (dep[0]) From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 04:40:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2944D1065705; Wed, 8 Feb 2012 04:40:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E5A8FC18; Wed, 8 Feb 2012 04:40:15 +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 q184eExu022416; Wed, 8 Feb 2012 04:40:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q184eEmO022414; Wed, 8 Feb 2012 04:40:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080440.q184eEmO022414@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231178 - stable/9/sys/ia64/ia64 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:40:15 -0000 Author: marcel Date: Wed Feb 8 04:40:14 2012 New Revision: 231178 URL: http://svn.freebsd.org/changeset/base/231178 Log: MFC r231177: Rev. 228360 moved the call to cpu_set_upcall() to happen before td_proc gets initialized in td (=newtd). Use td0 instead. Modified: stable/9/sys/ia64/ia64/vm_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/ia64/ia64/vm_machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:05:38 2012 (r231177) +++ stable/9/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:40:14 2012 (r231178) @@ -192,7 +192,7 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb, sizeof(*pcb)); pcb->pcb_special.bspstore = td->td_kstack; pcb->pcb_special.pfs = 0; - pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace); pcb->pcb_special.sp = (uintptr_t)tf - 16; pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 07:30:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACD4106564A; Wed, 8 Feb 2012 07:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75E238FC0C; Wed, 8 Feb 2012 07:30:48 +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 q187Umds028148; Wed, 8 Feb 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q187Ums5028146; Wed, 8 Feb 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202080730.q187Ums5028146@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Feb 2012 07:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231188 - stable/9/sys/vm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 07:30:48 -0000 Author: mav Date: Wed Feb 8 07:30:48 2012 New Revision: 231188 URL: http://svn.freebsd.org/changeset/base/231188 Log: MFC 230877: Fix NULL dereference panic on attempt to turn off (on system shutdown) disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Modified: stable/9/sys/vm/swap_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Wed Feb 8 06:56:19 2012 (r231187) +++ stable/9/sys/vm/swap_pager.c Wed Feb 8 07:30:48 2012 (r231188) @@ -2521,7 +2521,7 @@ swapgeom_orphan(struct g_consumer *cp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) if (sp->sw_id == cp) - sp->sw_id = NULL; + sp->sw_flags |= SW_CLOSING; mtx_unlock(&sw_dev_mtx); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 14:09:09 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B245106566C; Wed, 8 Feb 2012 14:09:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 595A68FC1B; Wed, 8 Feb 2012 14:09:09 +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 q18E99pT046013; Wed, 8 Feb 2012 14:09:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18E99T6046011; Wed, 8 Feb 2012 14:09:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081409.q18E99T6046011@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 14:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231202 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 14:09:09 -0000 Author: kib Date: Wed Feb 8 14:09:08 2012 New Revision: 231202 URL: http://svn.freebsd.org/changeset/base/231202 Log: MFC r230553: When doing vflush(WRITECLOSE), clean vnode pages. Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is still a race allowing a process to dirty pages after msync finished. Remounts rw->ro just left dirty pages in system. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Wed Feb 8 13:39:38 2012 (r231201) +++ stable/9/sys/kern/vfs_subr.c Wed Feb 8 14:09:08 2012 (r231202) @@ -2496,6 +2496,18 @@ loop: * vnodes open for writing. */ if (flags & WRITECLOSE) { + if (vp->v_object != NULL) { + VM_OBJECT_LOCK(vp->v_object); + vm_object_page_clean(vp->v_object, 0, 0, 0); + VM_OBJECT_UNLOCK(vp->v_object); + } + error = VOP_FSYNC(vp, MNT_WAIT, td); + if (error != 0) { + VOP_UNLOCK(vp, 0); + vdrop(vp); + MNT_VNODE_FOREACH_ABORT(mp, mvp); + return (error); + } error = VOP_GETATTR(vp, &vattr, td->td_ucred); VI_LOCK(vp); From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 14:21:21 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49AA5106566B; Wed, 8 Feb 2012 14:21:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DBB78FC08; Wed, 8 Feb 2012 14:21:21 +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 q18ELKnJ046454; Wed, 8 Feb 2012 14:21:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18ELKkN046452; Wed, 8 Feb 2012 14:21:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081421.q18ELKkN046452@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 14:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231203 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 14:21:21 -0000 Author: kib Date: Wed Feb 8 14:21:20 2012 New Revision: 231203 URL: http://svn.freebsd.org/changeset/base/231203 Log: MFC r230866: Add kqueue support to /dev/klog. PR: kern/156423 Modified: stable/9/sys/kern/subr_log.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_log.c ============================================================================== --- stable/9/sys/kern/subr_log.c Wed Feb 8 14:09:08 2012 (r231202) +++ stable/9/sys/kern/subr_log.c Wed Feb 8 14:21:20 2012 (r231203) @@ -59,6 +59,7 @@ static d_close_t logclose; static d_read_t logread; static d_ioctl_t logioctl; static d_poll_t logpoll; +static d_kqfilter_t logkqfilter; static void logtimeout(void *arg); @@ -69,9 +70,20 @@ static struct cdevsw log_cdevsw = { .d_read = logread, .d_ioctl = logioctl, .d_poll = logpoll, + .d_kqfilter = logkqfilter, .d_name = "log", }; +static int logkqread(struct knote *note, long hint); +static void logkqdetach(struct knote *note); + +static struct filterops log_read_filterops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = logkqdetach, + .f_event = logkqread, +}; + static struct logsoftc { int sc_state; /* see above for possibilities */ struct selinfo sc_selp; /* process waiting on select call */ @@ -181,6 +193,40 @@ logpoll(struct cdev *dev, int events, st return (revents); } +static int +logkqfilter(struct cdev *dev, struct knote *kn) +{ + + if (kn->kn_filter != EVFILT_READ) + return (EINVAL); + + kn->kn_fop = &log_read_filterops; + kn->kn_hook = NULL; + + mtx_lock(&msgbuf_lock); + knlist_add(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); + return (0); +} + +static int +logkqread(struct knote *kn, long hint) +{ + + mtx_assert(&msgbuf_lock, MA_OWNED); + kn->kn_data = msgbuf_getcount(msgbufp); + return (kn->kn_data != 0); +} + +static void +logkqdetach(struct knote *kn) +{ + + mtx_lock(&msgbuf_lock); + knlist_remove(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); +} + static void logtimeout(void *arg) { @@ -198,6 +244,7 @@ logtimeout(void *arg) } msgbuftrigger = 0; selwakeuppri(&logsoftc.sc_selp, LOG_RDPRI); + KNOTE_LOCKED(&logsoftc.sc_selp.si_note, 0); if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) pgsigio(&logsoftc.sc_sigio, SIGIO, 0); cv_broadcastpri(&log_wakeup, LOG_RDPRI); @@ -256,6 +303,7 @@ log_drvinit(void *unused) cv_init(&log_wakeup, "klog"); callout_init_mtx(&logsoftc.sc_callout, &msgbuf_lock, 0); + knlist_init_mtx(&logsoftc.sc_selp.si_note, &msgbuf_lock); make_dev_credf(MAKEDEV_ETERNAL, &log_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "klog"); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 18:51:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC25106564A; Wed, 8 Feb 2012 18:51:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938758FC08; Wed, 8 Feb 2012 18:51: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 q18IpBvF056190; Wed, 8 Feb 2012 18:51:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IpBp8056187; Wed, 8 Feb 2012 18:51:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081851.q18IpBp8056187@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231221 - stable/9/sbin/ifconfig X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:51:11 -0000 Author: bz Date: Wed Feb 8 18:51:10 2012 New Revision: 231221 URL: http://svn.freebsd.org/changeset/base/231221 Log: MFC r228641: Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum offloading on vlans and document the new option. Modified: stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ifconfig/ifvlan.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:36:07 2012 (r231220) +++ stable/9/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:10 2012 (r231221) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 13, 2011 +.Dd December 17, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -423,10 +423,10 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, -frame filtering in hardware, or TSO on VLAN, +frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , Modified: stable/9/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/9/sbin/ifconfig/ifvlan.c Wed Feb 8 18:36:07 2012 (r231220) +++ stable/9/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:10 2012 (r231221) @@ -183,6 +183,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwcsum", IFCAP_VLAN_HWCSUM, setifcap), + DEF_CMD("-vlanhwcsum", -IFCAP_VLAN_HWCSUM, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 8 23:14:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C74106564A; Wed, 8 Feb 2012 23:14:27 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57EC88FC12; Wed, 8 Feb 2012 23:14:27 +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 q18NERDO069410; Wed, 8 Feb 2012 23:14:27 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NERJJ069408; Wed, 8 Feb 2012 23:14:27 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202082314.q18NERJJ069408@svn.freebsd.org> From: Sean Farley Date: Wed, 8 Feb 2012 23:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231235 - stable/9/usr.sbin/cron/crontab X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:14:27 -0000 Author: scf Date: Wed Feb 8 23:14:26 2012 New Revision: 231235 URL: http://svn.freebsd.org/changeset/base/231235 Log: Merge from head to stable/9: r230655: Since April 2, 2006, Indiana has observed DST. Modified: stable/9/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/9/usr.sbin/cron/crontab/ (props changed) Modified: stable/9/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/9/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:13:21 2012 (r231234) +++ stable/9/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:14:26 2012 (r231235) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2005 +.Dd January 28, 2012 .Dt CRONTAB 5 .Os .Sh NAME @@ -301,7 +301,7 @@ affected. In general, it is not a good idea to schedule jobs during this period. .Pp -For US timezones (except parts of IN, AZ, and HI) the time shift occurs at +For US timezones (except parts of AZ and HI) the time shift occurs at 2AM local time. For others, the output of the .Xr zdump 8 From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 01:18:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D7F1106566C; Thu, 9 Feb 2012 01:18:35 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC088FC15; Thu, 9 Feb 2012 01:18:35 +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 q191IZoZ073629; Thu, 9 Feb 2012 01:18:35 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q191IZg8073627; Thu, 9 Feb 2012 01:18:35 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202090118.q191IZg8073627@svn.freebsd.org> From: Sean Farley Date: Thu, 9 Feb 2012 01:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231243 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 01:18:35 -0000 Author: scf Date: Thu Feb 9 01:18:35 2012 New Revision: 231243 URL: http://svn.freebsd.org/changeset/base/231243 Log: Merge from head to stable/9: r230656: msdos was renamed to msdosfs in 2001 by r77577. Modified: stable/9/share/man/man4/umass.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/umass.4 ============================================================================== --- stable/9/share/man/man4/umass.4 Thu Feb 9 01:18:23 2012 (r231242) +++ stable/9/share/man/man4/umass.4 Thu Feb 9 01:18:35 2012 (r231243) @@ -231,7 +231,7 @@ based file systems when storing informat videos. These file systems can be accessed by specifying the file system type as -.Cm msdos +.Cm msdosfs when using .Xr mount 8 . .Sh SEE ALSO From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 06:48:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EF4A106566B; Thu, 9 Feb 2012 06:48:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584568FC16; Thu, 9 Feb 2012 06:48:05 +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 q196m5t5085806; Thu, 9 Feb 2012 06:48:05 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q196m5r7085801; Thu, 9 Feb 2012 06:48:05 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090648.q196m5r7085801@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 06:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231247 - in stable/9: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 06:48:05 -0000 Author: bapt Date: Thu Feb 9 06:48:04 2012 New Revision: 231247 URL: http://svn.freebsd.org/changeset/base/231247 Log: MFH r230307: fix SIGINFO-related data corruption bug Approved by: des (mentor) Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/common.h stable/9/lib/libfetch/http.c stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/lib/libfetch/ (props changed) stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/common.c Thu Feb 9 06:48:04 2012 (r231247) @@ -404,6 +404,34 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + errno = ENOMEM; + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -429,6 +457,7 @@ fetch_read(conn_t *conn, char *buf, size fd_set readfds; ssize_t rlen, total; int r; + char *start; if (fetchTimeout) { FD_ZERO(&readfds); @@ -437,6 +466,24 @@ fetch_read(conn_t *conn, char *buf, size } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* + * The last invocation of fetch_read was interrupted by a + * signal after some data had been read from the socket. Copy + * the cached data into the supplied buffer before trying to + * read from the socket again. + */ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf+= total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -472,6 +519,8 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); @@ -492,8 +541,12 @@ fetch_read(conn_t *conn, char *buf, size errno = 0; r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -677,6 +730,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: stable/9/lib/libfetch/common.h ============================================================================== --- stable/9/lib/libfetch/common.h Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/common.h Thu Feb 9 06:48:04 2012 (r231247) @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ + struct { /* data cached after an interrupted + read */ + char *buf; + size_t size; + size_t pos; + size_t len; + } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/http.c Thu Feb 9 06:48:04 2012 (r231247) @@ -196,6 +196,8 @@ http_growbuf(struct httpio *io, size_t l static int http_fillbuf(struct httpio *io, size_t len) { + ssize_t nbytes; + if (io->error) return (-1); if (io->eof) @@ -204,10 +206,11 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->bufpos = 0; return (io->buflen); } @@ -227,10 +230,11 @@ http_fillbuf(struct httpio *io, size_t l len = io->chunksize; if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->chunksize -= io->buflen; if (io->chunksize == 0) { @@ -272,8 +276,11 @@ http_readfn(void *v, char *buf, int len) io->bufpos += l; } - if (!pos && io->error) + if (!pos && io->error) { + if (io->error == EINTR) + io->error = 0; return (-1); + } return (pos); } Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/usr.bin/fetch/fetch.c Thu Feb 9 06:48:04 2012 (r231247) @@ -317,7 +317,7 @@ fetch(char *URL, const char *path) struct stat sb, nsb; struct xferstat xs; FILE *f, *of; - size_t size, wr; + size_t size, readcnt, wr; off_t count; char flags[8]; const char *slash; @@ -636,21 +636,26 @@ fetch(char *URL, const char *path) stat_end(&xs); siginfo = 0; } - if ((size = fread(buf, 1, size, f)) == 0) { + + if (size == 0) + break; + + if ((readcnt = fread(buf, 1, size, f)) < size) { if (ferror(f) && errno == EINTR && !sigint) clearerr(f); - else + else if (readcnt == 0) break; } - stat_update(&xs, count += size); - for (ptr = buf; size > 0; ptr += wr, size -= wr) - if ((wr = fwrite(ptr, 1, size, of)) < size) { + + stat_update(&xs, count += readcnt); + for (ptr = buf; readcnt > 0; ptr += wr, readcnt -= wr) + if ((wr = fwrite(ptr, 1, readcnt, of)) < readcnt) { if (ferror(of) && errno == EINTR && !sigint) clearerr(of); else break; } - if (size != 0) + if (readcnt != 0) break; } if (!sigalrm) From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 07:38:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66526106566B; Thu, 9 Feb 2012 07:38:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFBE8FC0C; Thu, 9 Feb 2012 07:38:57 +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 q197cvHd087746; Thu, 9 Feb 2012 07:38:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197cv7B087744; Thu, 9 Feb 2012 07:38:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090738.q197cv7B087744@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231251 - stable/9/sys/cam/ata X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:38:57 -0000 Author: mav Date: Thu Feb 9 07:38:56 2012 New Revision: 231251 URL: http://svn.freebsd.org/changeset/base/231251 Log: MFC r230912: Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables. Even having more specific hint.ata.X.mode controls, global ones are still could be useful from some points, including compatibility. PR: kern/164651 Modified: stable/9/sys/cam/ata/ata_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Thu Feb 9 07:28:17 2012 (r231250) +++ stable/9/sys/cam/ata/ata_xpt.c Thu Feb 9 07:38:56 2012 (r231251) @@ -186,6 +186,12 @@ static void ata_dev_async(u_int32_t asy static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static int ata_dma = 1; +static int atapi_dma = 1; + +TUNABLE_INT("hw.ata.ata_dma", &ata_dma); +TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); + static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, @@ -356,6 +362,13 @@ probestart(struct cam_periph *periph, un if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } + if (periph->path->device->protocol == PROTO_ATA) { + if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } else { + if (atapi_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } negotiate: /* Honor device capabilities. */ wantmode = mode = ata_max_mode(ident_buf, mode); From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 07:43:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29F68106564A; Thu, 9 Feb 2012 07:43:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDDDE8FC14; Thu, 9 Feb 2012 07:43:38 +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 q197hcQf087990; Thu, 9 Feb 2012 07:43:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197hc9H087987; Thu, 9 Feb 2012 07:43:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090743.q197hc9H087987@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231253 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:43:39 -0000 Author: mav Date: Thu Feb 9 07:43:38 2012 New Revision: 231253 URL: http://svn.freebsd.org/changeset/base/231253 Log: MFC r230921: Insert ordered command every 1/4 of the current command timeout, not 1/4 of the default one. Without this change setting kern.cam.ada.default_timeout to 1 instead of 30 allowed me to trigger several false positive command timeouts under heavy ZFS load on a SiI3132 siis(4) controller with 5 HDDs on a port multiplier. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Feb 9 07:40:13 2012 (r231252) +++ stable/9/sys/cam/ata/ata_da.c Thu Feb 9 07:43:38 2012 (r231253) @@ -1105,7 +1105,7 @@ adaregister(struct cam_periph *periph, v */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); if (ADA_RA >= 0 && @@ -1660,7 +1660,7 @@ adasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Feb 9 07:40:13 2012 (r231252) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Feb 9 07:43:38 2012 (r231253) @@ -1098,7 +1098,7 @@ dadump(void *arg, void *virtual, vm_offs /*data_ptr*/(u_int8_t *) virtual, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, - DA_DEFAULT_TIMEOUT * 1000); + da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1511,7 +1511,7 @@ daregister(struct cam_periph *periph, vo */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); mtx_unlock(periph->sim->mtx); @@ -2398,7 +2398,7 @@ dasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 09:20:35 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB64106566C; Thu, 9 Feb 2012 09:20:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F808FC0A; Thu, 9 Feb 2012 09:20:34 +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 q199KYrj091536; Thu, 9 Feb 2012 09:20:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199KYwJ091533; Thu, 9 Feb 2012 09:20:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090920.q199KYwJ091533@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231260 - stable/9/bin/df X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:20:35 -0000 Author: bapt Date: Thu Feb 9 09:20:34 2012 New Revision: 231260 URL: http://svn.freebsd.org/changeset/base/231260 Log: MFH r226502,r226503: factor out the common code and fix two display bugs Approved by: des (mentor) Modified: stable/9/bin/df/df.1 stable/9/bin/df/df.c Directory Properties: stable/9/bin/df/ (props changed) Modified: stable/9/bin/df/df.1 ============================================================================== --- stable/9/bin/df/df.1 Thu Feb 9 09:01:03 2012 (r231259) +++ stable/9/bin/df/df.1 Thu Feb 9 09:20:34 2012 (r231260) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd November 23, 2008 +.Dd October 18, 2011 .Dt DF 1 .Os .Sh NAME @@ -63,6 +63,7 @@ The following options are available: Show all mount points, including those that were mounted with the .Dv MNT_IGNORE flag. +This is implied for file systems specified on the command line. .It Fl b Use 512-byte blocks rather than the default. Note that Modified: stable/9/bin/df/df.c ============================================================================== --- stable/9/bin/df/df.c Thu Feb 9 09:01:03 2012 (r231259) +++ stable/9/bin/df/df.c Thu Feb 9 09:20:34 2012 (r231260) @@ -107,7 +107,7 @@ main(int argc, char *argv[]) const char *fstype; char *mntpath, *mntpt; const char **vfslist; - size_t i, mntsize; + int i, mntsize; int ch, rv; fstype = "ufs"; @@ -187,30 +187,21 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) - update_maxwidths(&maxwidths, &mntbuf[i]); - rv = 0; if (!*argv) { + /* everything (modulo -t) */ + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) { - if (cflag) - addstat(&totalbuf, &mntbuf[i]); - update_maxwidths(&maxwidths, &mntbuf[i]); - } - if (cflag) - update_maxwidths(&maxwidths, &totalbuf); - for (i = 0; i < mntsize; i++) - if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) - prtstat(&mntbuf[i], &maxwidths); - if (cflag) - prtstat(&totalbuf, &maxwidths); - exit(rv); + } else { + /* just the filesystems specified on the command line */ + mntbuf = malloc(argc * sizeof(*mntbuf)); + if (mntbuf == 0) + err(1, "malloc()"); + mntsize = 0; + /* continued in for loop below */ } + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == 0) { @@ -279,14 +270,24 @@ main(int argc, char *argv[]) continue; } - if (argc == 1) { - bzero(&maxwidths, sizeof(maxwidths)); - update_maxwidths(&maxwidths, &statfsbuf); + /* the user asked for it, so ignore the ignore flag */ + statfsbuf.f_flags &= ~MNT_IGNORE; + + /* add to list */ + mntbuf[mntsize++] = statfsbuf; + } + + bzero(&maxwidths, sizeof(maxwidths)); + for (i = 0; i < mntsize; i++) { + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) { + update_maxwidths(&maxwidths, &mntbuf[i]); + if (cflag) + addstat(&totalbuf, &mntbuf[i]); } - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); } + for (i = 0; i < mntsize; i++) + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) + prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); return (rv); From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 09:24:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 900C6106566B; Thu, 9 Feb 2012 09:24:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791858FC08; Thu, 9 Feb 2012 09:24:33 +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 q199OX7f091786; Thu, 9 Feb 2012 09:24:33 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199OXAt091783; Thu, 9 Feb 2012 09:24:33 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090924.q199OXAt091783@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231263 - stable/9/usr.bin/ktrace X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:24:33 -0000 Author: bapt Date: Thu Feb 9 09:24:33 2012 New Revision: 231263 URL: http://svn.freebsd.org/changeset/base/231263 Log: MFH r226504: Make ktrace(1) build cleanly at WARNS level 6 Approved by: des (mentor) Modified: stable/9/usr.bin/ktrace/Makefile stable/9/usr.bin/ktrace/ktrace.c Directory Properties: stable/9/usr.bin/ktrace/ (props changed) Modified: stable/9/usr.bin/ktrace/Makefile ============================================================================== --- stable/9/usr.bin/ktrace/Makefile Thu Feb 9 09:23:37 2012 (r231262) +++ stable/9/usr.bin/ktrace/Makefile Thu Feb 9 09:24:33 2012 (r231263) @@ -5,6 +5,4 @@ PROG= ktrace SRCS= ktrace.c subr.c MLINKS= ktrace.1 trace.1 -WARNS?= 4 - .include Modified: stable/9/usr.bin/ktrace/ktrace.c ============================================================================== --- stable/9/usr.bin/ktrace/ktrace.c Thu Feb 9 09:23:37 2012 (r231262) +++ stable/9/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:33 2012 (r231263) @@ -43,14 +43,15 @@ static char sccsid[] = "@(#)ktrace.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include +#include #include -#include #include #include #include +#include +#include #include #include #include @@ -59,21 +60,22 @@ __FBSDID("$FreeBSD$"); static char def_tracefile[] = DEF_TRACEFILE; +static enum clear { NOTSET, CLEAR, CLEARALL } clear = NOTSET; +static int pid; + static void no_ktrace(int); -static int rpid(char *); +static void set_pid_clear(const char *, enum clear); static void usage(void); int main(int argc, char *argv[]) { - enum { NOTSET, CLEAR, CLEARALL } clear; - int append, ch, fd, inherit, ops, pid, pidset, trpoints; + int append, ch, fd, inherit, ops, trpoints; const char *tracefile; mode_t omask; struct stat sb; - clear = NOTSET; - append = ops = pidset = inherit = 0; + append = ops = inherit = 0; trpoints = DEF_POINTS; tracefile = def_tracefile; while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1) @@ -82,11 +84,10 @@ main(int argc, char *argv[]) append = 1; break; case 'C': - clear = CLEARALL; - pidset = 1; + set_pid_clear("1", CLEARALL); break; case 'c': - clear = CLEAR; + set_pid_clear(NULL, CLEAR); break; case 'd': ops |= KTRFLAG_DESCEND; @@ -95,15 +96,14 @@ main(int argc, char *argv[]) tracefile = optarg; break; case 'g': - pid = -rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); + pid = -pid; break; case 'i': inherit = 1; break; case 'p': - pid = rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); break; case 't': trpoints = getpoints(optarg); @@ -115,12 +115,19 @@ main(int argc, char *argv[]) default: usage(); } + argv += optind; argc -= optind; - - if ((pidset && *argv) || (!pidset && clear == NOTSET && !*argv)) + + /* must have either -[Cc], a pid or a command */ + if (clear == NOTSET && pid == 0 && argc == 0) + usage(); + /* can't have both a pid and a command */ + /* (note that -C sets pid to 1) */ + if (pid != 0 && argc > 0) { usage(); - + } + if (inherit) trpoints |= KTRFAC_INHERIT; @@ -129,10 +136,9 @@ main(int argc, char *argv[]) if (clear == CLEARALL) { ops = KTROP_CLEAR | KTRFLAG_DESCEND; trpoints = ALL_POINTS; - pid = 1; - } else - ops |= pidset ? KTROP_CLEAR : KTROP_CLEARFILE; - + } else { + ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; + } if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); @@ -160,46 +166,75 @@ main(int argc, char *argv[]) trpoints |= PROC_ABI_POINTS; - if (*argv) { + if (argc > 0) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) err(1, "%s", tracefile); - execvp(argv[0], &argv[0]); - err(1, "exec of '%s' failed", argv[0]); + execvp(*argv, argv); + err(1, "exec of '%s' failed", *argv); } - else if (ktrace(tracefile, ops, trpoints, pid) < 0) + if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); } -static int -rpid(char *p) +static void +set_pid_clear(const char *p, enum clear cl) { - static int first; + intmax_t n; + char *e; - if (first++) { - warnx("only one -g or -p flag is permitted"); + if (clear != NOTSET && cl != NOTSET) { + /* either -c and -C or either of them twice */ + warnx("only one -c or -C flag is permitted"); + usage(); + } + if ((clear == CLEARALL && p != NULL) || (cl == CLEARALL && pid != 0)) { + /* both -C and a pid or pgid */ + warnx("the -C flag may not be combined with -g or -p"); usage(); } - if (!*p) { - warnx("illegal process id"); + if (p != NULL && pid != 0) { + /* either -p and -g or either of them twice */ + warnx("only one -g or -p flag is permitted"); usage(); } - return(atoi(p)); + if (p != NULL) { + errno = 0; + n = strtoimax(p, &e, 10); + /* + * 1) not a number, or outside the range of an intmax_t + * 2) inside the range of intmax_t but outside the range + * of an int, keeping in mind that the pid may be + * negated if it's actually a pgid. + */ + if (*e != '\0' || n < 1 || errno == ERANGE || + n > (intmax_t)INT_MAX || n > -(intmax_t)INT_MIN) { + warnx("invalid process or group id"); + usage(); + } + pid = n; + } + if (cl != NOTSET) + if ((clear = cl) == CLEARALL) + pid = 1; } static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", -"usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", -" ktrace [-adi] [-f trfile] [-t trstr] command"); + + fprintf(stderr, "%s\n%s\n", + "usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", + " ktrace [-adi] [-f trfile] [-t trstr] command"); exit(1); } static void no_ktrace(int sig __unused) { - (void)fprintf(stderr, -"error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); + + fprintf(stderr, "error:\t%s\n\t%s\n", + "ktrace() system call not supported in the running kernel", + "re-compile kernel with 'options KTRACE'"); exit(1); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 10:30:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150F7106566B; Thu, 9 Feb 2012 10:30:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D96778FC08; Thu, 9 Feb 2012 10:30:45 +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 q19AUjT2094187; Thu, 9 Feb 2012 10:30:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AUjVW094185; Thu, 9 Feb 2012 10:30:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202091030.q19AUjVW094185@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 9 Feb 2012 10:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231268 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:30:46 -0000 Author: kib Date: Thu Feb 9 10:30:45 2012 New Revision: 231268 URL: http://svn.freebsd.org/changeset/base/231268 Log: MFC r230341: Use shared lock for the executable vnode in the exec path after the VV_TEXT changes are handled. Assert that vnode is exclusively locked at the places that modify VV_TEXT. Modified: stable/9/sys/kern/kern_exec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Thu Feb 9 10:22:08 2012 (r231267) +++ stable/9/sys/kern/kern_exec.c Thu Feb 9 10:30:45 2012 (r231268) @@ -471,6 +471,7 @@ interpret: * actually an executable image. */ textset = imgp->vp->v_vflag & VV_TEXT; + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag |= VV_TEXT; error = exec_map_first_page(imgp); @@ -502,8 +503,10 @@ interpret: if (error) { if (error == -1) { - if (textset == 0) + if (textset == 0) { + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag &= ~VV_TEXT; + } error = ENOEXEC; } goto exec_fail_dealloc; @@ -596,7 +599,7 @@ interpret: /* close files on exec */ fdcloseexec(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); /* Get a reference to the vnode prior to locking the proc */ VREF(binvp); @@ -701,7 +704,7 @@ interpret: VOP_UNLOCK(imgp->vp, 0); setugidsafety(td); error = fdcheckstd(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error != 0) goto done1; PROC_LOCK(p); @@ -805,7 +808,7 @@ interpret: pe.pm_entryaddr = imgp->entry_addr; PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } else PROC_UNLOCK(p); #else /* !HWPMC_HOOKS */ @@ -857,7 +860,7 @@ done1: if (tracecred != NULL) crfree(tracecred); #endif - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 13:23:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99E11106564A; Thu, 9 Feb 2012 13:23:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 843258FC0C; Thu, 9 Feb 2012 13:23:33 +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 q19DNXNk002612; Thu, 9 Feb 2012 13:23:33 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19DNXEt002609; Thu, 9 Feb 2012 13:23:33 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091323.q19DNXEt002609@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 13:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231271 - stable/9/rescue/rescue X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 13:23:33 -0000 Author: bapt Date: Thu Feb 9 13:23:33 2012 New Revision: 231271 URL: http://svn.freebsd.org/changeset/base/231271 Log: MFH r227531: Add netcat (nc) to /rescue. Approved by: des (mentor) Modified: stable/9/rescue/rescue/Makefile Directory Properties: stable/9/rescue/rescue/ (props changed) Modified: stable/9/rescue/rescue/Makefile ============================================================================== --- stable/9/rescue/rescue/Makefile Thu Feb 9 10:56:05 2012 (r231270) +++ stable/9/rescue/rescue/Makefile Thu Feb 9 13:23:33 2012 (r231271) @@ -181,7 +181,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU # CRUNCH_SRCDIRS+= usr.bin -CRUNCH_PROGS_usr.bin= head mt sed tail tee +CRUNCH_PROGS_usr.bin= head mt nc sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 14:16:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB2B1065672; Thu, 9 Feb 2012 14:16:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 849828FC1B; Thu, 9 Feb 2012 14:16:01 +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 q19EG1pj004643; Thu, 9 Feb 2012 14:16:01 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EG1w0004636; Thu, 9 Feb 2012 14:16:01 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091416.q19EG1w0004636@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 14:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231277 - in stable/9: etc/rc.d sbin/dhclient X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:16:01 -0000 Author: bapt Date: Thu Feb 9 14:16:00 2012 New Revision: 231277 URL: http://svn.freebsd.org/changeset/base/231277 Log: MFH r226345, r226464, r226879: Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs Approved by: des (mentor) Modified: stable/9/etc/rc.d/dhclient stable/9/sbin/dhclient/Makefile stable/9/sbin/dhclient/dhclient.8 stable/9/sbin/dhclient/dhclient.c stable/9/sbin/dhclient/dhcpd.h stable/9/sbin/dhclient/errwarn.c Directory Properties: stable/9/etc/rc.d/ (props changed) stable/9/sbin/dhclient/ (props changed) Modified: stable/9/etc/rc.d/dhclient ============================================================================== --- stable/9/etc/rc.d/dhclient Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/etc/rc.d/dhclient Thu Feb 9 14:16:00 2012 (r231277) @@ -9,56 +9,49 @@ . /etc/rc.subr . /etc/network.subr +ifn="$2" + name="dhclient" rcvar= -start_cmd="dhclient_start" -stop_cmd="dhclient_stop" - -dhclient_start() +pidfile="/var/run/${name}.${ifn}.pid" +start_precmd="dhclient_prestart" +stop_precmd="dhclient_pre_check" + +# rc_force check can only be done at the run_rc_command +# time, so we're testing it in the pre* hooks. +dhclient_pre_check() { - # prevent unnecessary restarts - # XXX: dhclient had better create a pidfile - if [ -x /bin/pgrep ]; then - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - sleep 1 - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - exit 0 - fi - elif [ -e /var/run/dhclient.pid ]; then - if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then - exit 0 - fi - fi + if [ -z "${rc_force}" ] && ! dhcpif $ifn; then + err 1 "'$ifn' is not a DHCP-enabled interface" fi +} + +dhclient_prestart() +{ + dhclient_pre_check - # Override for $ifn specific flags (see rc.subr for $flags setting) - specific=`get_if_var $ifn dhclient_flags_IF` + # Interface-specific flags (see rc.subr for $flags setting) + specific=$(get_if_var $ifn dhclient_flags_IF) if [ -z "$flags" -a -n "$specific" ]; then rc_flags=$specific fi - background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient` + background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient) if checkyesno background_dhclient; then rc_flags="${rc_flags} -b" fi - ${dhclient_program} ${rc_flags} $ifn + rc_flags="${rc_flags} ${ifn}" } -dhclient_stop() -{ - ifconfig $ifn down # cause dhclient to die -} - -ifn="$2" - load_rc_config $name load_rc_config network -if ! dhcpif $ifn; then - return 1 +if [ -z $ifn ] ; then + # only complain if a command was specified but no interface + if [ -n "$1" ] ; then + err 1 "$0: no interface specified" + fi fi run_rc_command "$1" Modified: stable/9/sbin/dhclient/Makefile ============================================================================== --- stable/9/sbin/dhclient/Makefile Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/Makefile Thu Feb 9 14:16:00 2012 (r231277) @@ -39,6 +39,8 @@ PROG= dhclient SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +DPADD= ${LIBUTIL} +LDADD= -lutil WARNS?= 2 Modified: stable/9/sbin/dhclient/dhclient.8 ============================================================================== --- stable/9/sbin/dhclient/dhclient.8 Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:00 2012 (r231277) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd October 13, 2011 .Dt DHCLIENT 8 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl bdqu .Op Fl c Ar file .Op Fl l Ar file +.Op Fl p Ar file .Ar interface .Sh DESCRIPTION The @@ -83,6 +84,10 @@ will revert to running in the background Specify an alternate location, .Ar file , for the leases file. +.It Fl p Ar file +Specify an alternate location for the PID file. +The default is +.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm Modified: stable/9/sbin/dhclient/dhclient.c ============================================================================== --- stable/9/sbin/dhclient/dhclient.c Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhclient.c Thu Feb 9 14:16:00 2012 (r231277) @@ -95,6 +95,9 @@ struct iaddr iaddr_broadcast = { 4, { 25 struct in_addr inaddr_any; struct sockaddr_in sockaddr_broadcast; +char *path_dhclient_pidfile; +struct pidfh *pidfile; + /* * ASSERT_STATE() does nothing now; it used to be * assert (state_is == state_shouldbe). @@ -316,6 +319,8 @@ die: if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } @@ -327,12 +332,13 @@ main(int argc, char *argv[]) int pipe_fd[2]; int immediate_daemon = 0; struct passwd *pw; + pid_t otherpid; /* Initially, log errors to stderr as well as to syslogd. */ openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); setlogmask(LOG_UPTO(LOG_DEBUG)); - while ((ch = getopt(argc, argv, "bc:dl:qu")) != -1) + while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) switch (ch) { case 'b': immediate_daemon = 1; @@ -346,6 +352,9 @@ main(int argc, char *argv[]) case 'l': path_dhclient_db = optarg; break; + case 'p': + path_dhclient_pidfile = optarg; + break; case 'q': quiet = 1; break; @@ -362,6 +371,21 @@ main(int argc, char *argv[]) if (argc != 1) usage(); + if (path_dhclient_pidfile == NULL) { + asprintf(&path_dhclient_pidfile, + "%sdhclient.%s.pid", _PATH_VARRUN, *argv); + if (path_dhclient_pidfile == NULL) + error("asprintf"); + } + pidfile = pidfile_open(path_dhclient_pidfile, 0600, &otherpid); + if (pidfile == NULL) { + if (errno == EEXIST) + error("dhclient already running, pid: %d.", otherpid); + if (errno == EAGAIN) + error("dhclient already running."); + warning("Cannot open or create pidfile: %m"); + } + if ((ifi = calloc(1, sizeof(struct interface_info))) == NULL) error("calloc"); if (strlcpy(ifi->name, argv[0], IFNAMSIZ) >= IFNAMSIZ) @@ -385,6 +409,12 @@ main(int argc, char *argv[]) read_client_conf(); + /* The next bit is potentially very time-consuming, so write out + the pidfile right away. We will write it out again with the + correct pid after daemonizing. */ + if (pidfile != NULL) + pidfile_write(pidfile); + if (!interface_link_status(ifi->name)) { fprintf(stderr, "%s: no link ...", ifi->name); fflush(stderr); @@ -2298,6 +2328,9 @@ go_daemon(void) if (daemon(1, 0) == -1) error("daemon"); + if (pidfile != NULL) + pidfile_write(pidfile); + /* we are chrooted, daemon(3) fails to open /dev/null */ if (nullfd != -1) { dup2(nullfd, STDIN_FILENO); Modified: stable/9/sbin/dhclient/dhcpd.h ============================================================================== --- stable/9/sbin/dhclient/dhcpd.h Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:00 2012 (r231277) @@ -41,7 +41,7 @@ * $FreeBSD$ */ -#include +#include #include #include @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -353,6 +354,8 @@ extern int log_perror; extern struct client_config top_level_config; +extern struct pidfh *pidfile; + void dhcpoffer(struct packet *); void dhcpack(struct packet *); void dhcpnak(struct packet *); Modified: stable/9/sbin/dhclient/errwarn.c ============================================================================== --- stable/9/sbin/dhclient/errwarn.c Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/errwarn.c Thu Feb 9 14:16:00 2012 (r231277) @@ -83,6 +83,8 @@ error(char *fmt, ...) fprintf(stderr, "exiting.\n"); fflush(stderr); } + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 15:21:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619C71065673; Thu, 9 Feb 2012 15:21:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4648FC0C; Thu, 9 Feb 2012 15:21:55 +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 q19FLtAe006946; Thu, 9 Feb 2012 15:21:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FLtfA006932; Thu, 9 Feb 2012 15:21:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091521.q19FLtfA006932@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231279 - stable/9/usr.bin/systat X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:21:55 -0000 Author: ed Date: Thu Feb 9 15:21:54 2012 New Revision: 231279 URL: http://svn.freebsd.org/changeset/base/231279 Log: MFC r226396: Fix whitespace inconsistencies in systat(1). According to md5(1), the resulting binary is the same. Modified: stable/9/usr.bin/systat/cmds.c stable/9/usr.bin/systat/cmdtab.c stable/9/usr.bin/systat/devs.c stable/9/usr.bin/systat/fetch.c stable/9/usr.bin/systat/ifcmds.c stable/9/usr.bin/systat/ifstat.c stable/9/usr.bin/systat/keyboard.c stable/9/usr.bin/systat/mode.c stable/9/usr.bin/systat/mode.h stable/9/usr.bin/systat/netstat.c stable/9/usr.bin/systat/systat.h stable/9/usr.bin/systat/vmstat.c Directory Properties: stable/9/usr.bin/systat/ (props changed) Modified: stable/9/usr.bin/systat/cmds.c ============================================================================== --- stable/9/usr.bin/systat/cmds.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/cmds.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,32 +47,32 @@ static const char sccsid[] = "@(#)cmds.c void command(const char *cmd) { - struct cmdtab *p; - char *cp, *tmpstr, *tmpstr1; + struct cmdtab *p; + char *cp, *tmpstr, *tmpstr1; int interval, omask; tmpstr = tmpstr1 = strdup(cmd); omask = sigblock(sigmask(SIGALRM)); - for (cp = tmpstr1; *cp && !isspace(*cp); cp++) - ; - if (*cp) - *cp++ = '\0'; + for (cp = tmpstr1; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp++ = '\0'; if (*tmpstr1 == '\0') return; for (; *cp && isspace(*cp); cp++) ; - if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) - die(0); + if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) + die(0); if (strcmp(tmpstr1, "load") == 0) { load(); goto done; } - if (strcmp(tmpstr1, "stop") == 0) { - alarm(0); - mvaddstr(CMDLINE, 0, "Refresh disabled."); - clrtoeol(); + if (strcmp(tmpstr1, "stop") == 0) { + alarm(0); + mvaddstr(CMDLINE, 0, "Refresh disabled."); + clrtoeol(); goto done; - } + } if (strcmp(tmpstr1, "help") == 0) { int _col, _len; @@ -89,30 +89,30 @@ command(const char *cmd) goto done; } interval = atoi(tmpstr1); - if (interval <= 0 && + if (interval <= 0 && (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) { interval = *cp ? atoi(cp) : naptime; - if (interval <= 0) { + if (interval <= 0) { error("%d: bad interval.", interval); goto done; - } + } } if (interval > 0) { - alarm(0); - naptime = interval; - display(0); - status(); + alarm(0); + naptime = interval; + display(0); + status(); goto done; - } + } p = lookup(tmpstr1); if (p == (struct cmdtab *)-1) { error("%s: Ambiguous command.", tmpstr1); goto done; } - if (p) { - if (curcmd == p) + if (p) { + if (curcmd == p) goto done; - alarm(0); + alarm(0); (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); @@ -131,12 +131,12 @@ command(const char *cmd) else goto done; } - curcmd = p; + curcmd = p; labels(); - display(0); - status(); + display(0); + status(); goto done; - } + } if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: @@ -176,18 +176,18 @@ void status(void) { - error("Showing %s, refresh every %d seconds.", - curcmd->c_name, naptime); + error("Showing %s, refresh every %d seconds.", + curcmd->c_name, naptime); } int prefix(const char *s1, const char *s2) { - while (*s1 == *s2) { - if (*s1 == '\0') - return (1); - s1++, s2++; - } - return (*s1 == '\0'); + while (*s1 == *s2) { + if (*s1 == '\0') + return (1); + s1++, s2++; + } + return (*s1 == '\0'); } Modified: stable/9/usr.bin/systat/cmdtab.c ============================================================================== --- stable/9/usr.bin/systat/cmdtab.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/cmdtab.c Thu Feb 9 15:21:54 2012 (r231279) @@ -40,22 +40,22 @@ static const char sccsid[] = "@(#)cmdtab #include "mode.h" struct cmdtab cmdtab[] = { - { "pigs", showpigs, fetchpigs, labelpigs, + { "pigs", showpigs, fetchpigs, labelpigs, initpigs, openpigs, closepigs, 0, 0, CF_LOADAV }, - { "swap", showswap, fetchswap, labelswap, + { "swap", showswap, fetchswap, labelswap, initswap, openswap, closeswap, 0, 0, CF_LOADAV }, - { "mbufs", showmbufs, fetchmbufs, labelmbufs, + { "mbufs", showmbufs, fetchmbufs, labelmbufs, initmbufs, openmbufs, closembufs, 0, 0, CF_LOADAV }, - { "iostat", showiostat, fetchiostat, labeliostat, + { "iostat", showiostat, fetchiostat, labeliostat, initiostat, openiostat, closeiostat, cmdiostat, 0, CF_LOADAV }, - { "vmstat", showkre, fetchkre, labelkre, + { "vmstat", showkre, fetchkre, labelkre, initkre, openkre, closekre, cmdkre, 0, 0 }, - { "netstat", shownetstat, fetchnetstat, labelnetstat, + { "netstat", shownetstat, fetchnetstat, labelnetstat, initnetstat, opennetstat, closenetstat, cmdnetstat, 0, CF_LOADAV }, { "icmp", showicmp, fetchicmp, labelicmp, @@ -78,6 +78,6 @@ struct cmdtab cmdtab[] = { { "ifstat", showifstat, fetchifstat, labelifstat, initifstat, openifstat, closeifstat, cmdifstat, 0, CF_LOADAV }, - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; struct cmdtab *curcmd = &cmdtab[0]; Modified: stable/9/usr.bin/systat/devs.c ============================================================================== --- stable/9/usr.bin/systat/devs.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/devs.c Thu Feb 9 15:21:54 2012 (r231279) @@ -105,7 +105,7 @@ dsinit(int maxshowdevs, struct statinfo /* * Make sure that the userland devstat version matches the kernel - * devstat version. If not, exit and print a message informing + * devstat version. If not, exit and print a message informing * the user of his mistake. */ if (devstat_checkversion(NULL) < 0) @@ -155,10 +155,10 @@ dscmd(const char *cmd, const char *args, if (prefix(cmd, "refresh")) { retval = devstat_selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, generation, - s1->dinfo->devices, num_devices, + s1->dinfo->devices, num_devices, (last_type ==DS_MATCHTYPE_PATTERN) ? matches : NULL, (last_type ==DS_MATCHTYPE_PATTERN) ? num_matches : 0, - (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, + (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, (last_type == DS_MATCHTYPE_SPEC) ?num_devices_specified : 0, (last_type == DS_MATCHTYPE_NONE) ? DS_SELECT_ADD : DS_SELECT_ADDONLY, maxshowdevs, 0); @@ -220,7 +220,7 @@ dsmatchselect(const char *args, devstat_ } for (i = 0; i < num_args; i++) { - if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { + if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { warnx("%s", devstat_errbuf); return(0); } @@ -282,7 +282,7 @@ dsselect(const char *args, devstat_selec asprintf(&buffer, "%s%d", dev_select[i].device_name, dev_select[i].unit_number); if (strcmp(buffer, tmpstr1) == 0) { - + num_devices_specified++; specified_devices =(char **)realloc( Modified: stable/9/usr.bin/systat/fetch.c ============================================================================== --- stable/9/usr.bin/systat/fetch.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/fetch.c Thu Feb 9 15:21:54 2012 (r231279) @@ -62,17 +62,17 @@ void getsysctl(const char *name, void *p { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { - error("sysctl(%s...) failed: %s", name, + error("sysctl(%s...) failed: %s", name, strerror(errno)); } if (nlen != len) { - error("sysctl(%s...) expected %lu, got %lu", name, + error("sysctl(%s...) expected %lu, got %lu", name, (unsigned long)len, (unsigned long)nlen); } } /* - * Read sysctl data with variable size. Try some times (with increasing + * Read sysctl data with variable size. Try some times (with increasing * buffers), fail if still too small. * This is needed sysctls with possibly raplidly increasing data sizes, * but imposes little overhead in the case of constant sizes. @@ -84,8 +84,8 @@ void getsysctl(const char *name, void *p /* Some defines: Number of tries. */ #define SD_NTRIES 10 /* Percent of over-allocation (initial) */ -#define SD_MARGIN 10 -/* +#define SD_MARGIN 10 +/* * Factor for over-allocation in percent (the margin is increased by this on * any failed try). */ Modified: stable/9/usr.bin/systat/ifcmds.c ============================================================================== --- stable/9/usr.bin/systat/ifcmds.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/ifcmds.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,7 +47,7 @@ ifcmd(const char *cmd, const char *args) clrtoeol(); addstr("what scale? "); addstr(get_helplist()); - } + } } return (1); } Modified: stable/9/usr.bin/systat/ifstat.c ============================================================================== --- stable/9/usr.bin/systat/ifstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/ifstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -43,7 +43,7 @@ #include "extern.h" #include "convtbl.h" - /* Column numbers */ + /* Column numbers */ #define C1 0 /* 0-19 */ #define C2 20 /* 20-39 */ @@ -121,9 +121,9 @@ static u_int getifnum(void); } while (0) #define DOPUTTOTAL(c, r, d) do { \ - CLEAR_COLUMN((r), (c)); \ - mvprintw((r), (c), "%12.3f %s ", \ - convert(d##_##c, SC_AUTO), \ + CLEAR_COLUMN((r), (c)); \ + mvprintw((r), (c), "%12.3f %s ", \ + convert(d##_##c, SC_AUTO), \ get_string(d##_##c, SC_AUTO)); \ } while (0) @@ -255,8 +255,8 @@ fetchifstat(void) (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; - new_outb = ifp->if_mib.ifmd_data.ifi_obytes; + new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; + new_outb = ifp->if_mib.ifmd_data.ifi_obytes; /* Display interface if it's received some traffic. */ if (new_inb > 0 && old_inb == 0) { @@ -269,9 +269,9 @@ fetchifstat(void) * for our current traffic rates, and while we're there, * see if we have new peak rates. */ - old_tv = ifp->tv; - timersub(&new_tv, &old_tv, &tv); - elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); + old_tv = ifp->tv; + timersub(&new_tv, &old_tv, &tv); + elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); ifp->if_in_curtraffic = new_inb - old_inb; ifp->if_out_curtraffic = new_outb - old_outb; @@ -281,8 +281,8 @@ fetchifstat(void) * and line, we divide by ``elapsed'' as this is likely * to be more accurate. */ - ifp->if_in_curtraffic /= elapsed; - ifp->if_out_curtraffic /= elapsed; + ifp->if_in_curtraffic /= elapsed; + ifp->if_out_curtraffic /= elapsed; if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak) ifp->if_in_traffic_peak = ifp->if_in_curtraffic; Modified: stable/9/usr.bin/systat/keyboard.c ============================================================================== --- stable/9/usr.bin/systat/keyboard.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,76 +47,76 @@ static const char sccsid[] = "@(#)keyboa int keyboard(void) { - char ch, line[80]; + char ch, line[80]; int oldmask; - for (;;) { - col = 0; - move(CMDLINE, 0); - do { - refresh(); - ch = getch(); - if (ch == ERR) { - if (errno == EINTR) - continue; - exit(1); - } - if (ch >= 'A' && ch <= 'Z') - ch += 'a' - 'A'; - if (col == 0) { + for (;;) { + col = 0; + move(CMDLINE, 0); + do { + refresh(); + ch = getch(); + if (ch == ERR) { + if (errno == EINTR) + continue; + exit(1); + } + if (ch >= 'A' && ch <= 'Z') + ch += 'a' - 'A'; + if (col == 0) { #define mask(s) (1 << ((s) - 1)) - if (ch == CTRL('l')) { + if (ch == CTRL('l')) { oldmask = sigblock(mask(SIGALRM)); wrefresh(curscr); sigsetmask(oldmask); - continue; - } + continue; + } if (ch == CTRL('g')) { oldmask = sigblock(mask(SIGALRM)); status(); sigsetmask(oldmask); continue; } - if (ch != ':') - continue; - move(CMDLINE, 0); - clrtoeol(); - } - if (ch == erasechar() && col > 0) { - if (col == 1 && line[0] == ':') - continue; - col--; - goto doerase; - } - if (ch == CTRL('w') && col > 0) { - while (--col >= 0 && isspace(line[col])) - ; - col++; - while (--col >= 0 && !isspace(line[col])) - if (col == 0 && line[0] == ':') - break; - col++; - goto doerase; - } - if (ch == killchar() && col > 0) { - col = 0; - if (line[0] == ':') - col++; - doerase: - move(CMDLINE, col); - clrtoeol(); - continue; - } - if (isprint(ch) || ch == ' ') { - line[col] = ch; - mvaddch(CMDLINE, col, ch); - col++; - } - } while (col == 0 || (ch != '\r' && ch != '\n')); - line[col] = '\0'; + if (ch != ':') + continue; + move(CMDLINE, 0); + clrtoeol(); + } + if (ch == erasechar() && col > 0) { + if (col == 1 && line[0] == ':') + continue; + col--; + goto doerase; + } + if (ch == CTRL('w') && col > 0) { + while (--col >= 0 && isspace(line[col])) + ; + col++; + while (--col >= 0 && !isspace(line[col])) + if (col == 0 && line[0] == ':') + break; + col++; + goto doerase; + } + if (ch == killchar() && col > 0) { + col = 0; + if (line[0] == ':') + col++; + doerase: + move(CMDLINE, col); + clrtoeol(); + continue; + } + if (isprint(ch) || ch == ' ') { + line[col] = ch; + mvaddch(CMDLINE, col, ch); + col++; + } + } while (col == 0 || (ch != '\r' && ch != '\n')); + line[col] = '\0'; oldmask = sigblock(mask(SIGALRM)); - command(line + 1); + command(line + 1); sigsetmask(oldmask); - } + } /*NOTREACHED*/ } Modified: stable/9/usr.bin/systat/mode.c ============================================================================== --- stable/9/usr.bin/systat/mode.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/mode.c Thu Feb 9 15:21:54 2012 (r231279) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/9/usr.bin/systat/mode.h ============================================================================== --- stable/9/usr.bin/systat/mode.h Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/mode.h Thu Feb 9 15:21:54 2012 (r231279) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/9/usr.bin/systat/netstat.c ============================================================================== --- stable/9/usr.bin/systat/netstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/netstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -128,7 +128,7 @@ closenetstat(WINDOW *w) lastrow--; p->ni_line = -1; } - if (w != NULL) { + if (w != NULL) { wclear(w); wrefresh(w); delwin(w); Modified: stable/9/usr.bin/systat/systat.h ============================================================================== --- stable/9/usr.bin/systat/systat.h Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/systat.h Thu Feb 9 15:21:54 2012 (r231279) @@ -33,10 +33,10 @@ #include struct cmdtab { - const char *c_name; /* command name */ - void (*c_refresh)(void); /* display refresh */ - void (*c_fetch)(void); /* sets up data structures */ - void (*c_label)(void); /* label display */ + const char *c_name; /* command name */ + void (*c_refresh)(void); /* display refresh */ + void (*c_fetch)(void); /* sets up data structures */ + void (*c_label)(void); /* label display */ int (*c_init)(void); /* initialize namelist, etc. */ WINDOW *(*c_open)(void); /* open display */ void (*c_close)(WINDOW *); /* close display */ Modified: stable/9/usr.bin/systat/vmstat.c ============================================================================== --- stable/9/usr.bin/systat/vmstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/vmstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -224,7 +224,7 @@ initkre(void) intrloc = calloc(nintr, sizeof (long)); intrname = calloc(nintr, sizeof (char *)); intrnamebuf = sysctl_dynread("hw.intrnames", NULL); - if (intrnamebuf == NULL || intrname == NULL || + if (intrnamebuf == NULL || intrname == NULL || intrloc == NULL) { error("Out of memory"); if (intrnamebuf) @@ -854,7 +854,7 @@ dinfo(int dn, int lc, struct statinfo *n elapsed_time = now->snap_time - then->snap_time; } else { /* Calculate relative to device creation */ - elapsed_time = now->snap_time - devstat_compute_etime( + elapsed_time = now->snap_time - devstat_compute_etime( &now->dinfo->devices[di].creation_time, NULL); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 15:23:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87373106568E; Thu, 9 Feb 2012 15:23:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711B38FC22; Thu, 9 Feb 2012 15:23:39 +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 q19FNdTw007054; Thu, 9 Feb 2012 15:23:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FNdZJ007052; Thu, 9 Feb 2012 15:23:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091523.q19FNdZJ007052@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231280 - stable/9/usr.bin/systat X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:23:39 -0000 Author: ed Date: Thu Feb 9 15:23:39 2012 New Revision: 231280 URL: http://svn.freebsd.org/changeset/base/231280 Log: MFC r226424: Use integer to store the result of getch(). We need to use an integer to make the comparison against ERR work. Modified: stable/9/usr.bin/systat/keyboard.c Directory Properties: stable/9/usr.bin/systat/ (props changed) Modified: stable/9/usr.bin/systat/keyboard.c ============================================================================== --- stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:21:54 2012 (r231279) +++ stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:23:39 2012 (r231280) @@ -47,8 +47,8 @@ static const char sccsid[] = "@(#)keyboa int keyboard(void) { - char ch, line[80]; - int oldmask; + char line[80]; + int ch, oldmask; for (;;) { col = 0; From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 15:26:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45BBF106566B; Thu, 9 Feb 2012 15:26:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6A48FC0C; Thu, 9 Feb 2012 15:26:48 +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 q19FQmLN007210; Thu, 9 Feb 2012 15:26:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FQl4V007208; Thu, 9 Feb 2012 15:26:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091526.q19FQl4V007208@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231281 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:26:48 -0000 Author: ed Date: Thu Feb 9 15:26:47 2012 New Revision: 231281 URL: http://svn.freebsd.org/changeset/base/231281 Log: MFC r229385 Fix subtle typo: compare against idx -- not index. In this context, index refers to the index(3) function. In this case it doesn't really harm, as this function is never called with idx == NULL. Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Thu Feb 9 15:23:39 2012 (r231280) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Thu Feb 9 15:26:47 2012 (r231281) @@ -469,7 +469,7 @@ snmp_leaf_insert(struct snmp_toolinfo *s static int32_t snmp_index_insert(struct snmp_idxlist *headp, struct index *idx) { - if (headp == NULL || index == NULL) + if (headp == NULL || idx == NULL) return (-1); STAILQ_INSERT_TAIL(headp, idx, link); From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 15:28:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 289E81065740; Thu, 9 Feb 2012 15:28:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E1E8FC08; Thu, 9 Feb 2012 15:28:29 +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 q19FSSvr007297; Thu, 9 Feb 2012 15:28:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FSSnX007295; Thu, 9 Feb 2012 15:28:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091528.q19FSSnX007295@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231282 - stable/9/include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:28:29 -0000 Author: ed Date: Thu Feb 9 15:28:28 2012 New Revision: 231282 URL: http://svn.freebsd.org/changeset/base/231282 Log: MFC r229590 manually: It turns out our GCC has quite an interesting bug: typeof(1.0fi) != float _Complex typeof((float _Complex)1.0fi) != float _Complex typeof((float _Complex)1.0i) == float _Complex In other words: if casting to an equal size, GCC seems to take a shortcut. By casting down from a double to a float, GCC doesn't take this shortcut, yielding the proper type. Modified: stable/9/include/complex.h Modified: stable/9/include/complex.h ============================================================================== --- stable/9/include/complex.h Thu Feb 9 15:26:47 2012 (r231281) +++ stable/9/include/complex.h Thu Feb 9 15:28:28 2012 (r231282) @@ -33,7 +33,7 @@ #if __STDC_VERSION__ < 199901 #define _Complex __complex__ #endif -#define _Complex_I 1.0fi +#define _Complex_I ((float _Complex)1.0i) #endif #define complex _Complex From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:11:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F721065674; Thu, 9 Feb 2012 16:11:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53DA28FC0A; Thu, 9 Feb 2012 16:11: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 q19GBwOl008732; Thu, 9 Feb 2012 16:11:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GBwCt008730; Thu, 9 Feb 2012 16:11:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202091611.q19GBwCt008730@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 16:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231284 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:11:58 -0000 Author: bz Date: Thu Feb 9 16:11:57 2012 New Revision: 231284 URL: http://svn.freebsd.org/changeset/base/231284 Log: MFC r229127: Remove a declaration to a non-existent function. Modified: stable/9/sys/netinet6/scope6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/scope6_var.h ============================================================================== --- stable/9/sys/netinet6/scope6_var.h Thu Feb 9 15:36:54 2012 (r231283) +++ stable/9/sys/netinet6/scope6_var.h Thu Feb 9 16:11:57 2012 (r231284) @@ -49,7 +49,6 @@ int scope6_set __P((struct ifnet *, stru int scope6_get __P((struct ifnet *, struct scope6_id *)); void scope6_setdefault __P((struct ifnet *)); int scope6_get_default __P((struct scope6_id *)); -u_int32_t scope6_in6_addrscope __P((struct in6_addr *)); u_int32_t scope6_addr2default __P((struct in6_addr *)); int sa6_embedscope __P((struct sockaddr_in6 *, int)); int sa6_recoverscope __P((struct sockaddr_in6 *)); From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:53:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9CB51065670; Thu, 9 Feb 2012 16:53:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1F8A8FC12; Thu, 9 Feb 2012 16:53:51 +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 q19Grpru010236; Thu, 9 Feb 2012 16:53:51 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Grpof010229; Thu, 9 Feb 2012 16:53:51 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091653.q19Grpof010229@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231287 - in stable/9/sys/boot: arm/at91/boot2 arm/ixp425/boot2 i386/boot2 i386/gptboot i386/zfsboot pc98/boot2 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:53:52 -0000 Author: bapt Date: Thu Feb 9 16:53:51 2012 New Revision: 231287 URL: http://svn.freebsd.org/changeset/base/231287 Log: MFH r226506: Look for /boot/config in addition to /boot.config Approved by: des (mentor) Modified: stable/9/sys/boot/arm/at91/boot2/boot2.c stable/9/sys/boot/arm/ixp425/boot2/boot2.c stable/9/sys/boot/i386/boot2/boot2.c stable/9/sys/boot/i386/gptboot/gptboot.c stable/9/sys/boot/i386/zfsboot/zfsboot.c stable/9/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" @@ -160,7 +161,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_KERNEL "/boot/kernel/kernel" extern uint32_t _end; @@ -168,7 +169,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -74,7 +74,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -238,7 +239,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/9/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:53:51 2012 (r231287) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "gpt.h" -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -163,8 +164,8 @@ main(void) for (;;) { *kname = '\0'; - ino = lookup(PATH_CONFIG); - if (ino > 0) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd != '\0') { Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:53:51 2012 (r231287) @@ -45,7 +45,8 @@ __FBSDID("$FreeBSD$"); /* Hint to loader that we came from ZFS */ #define KARGS_FLAGS_ZFS 0x4 -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -533,7 +534,8 @@ main(void) zfs_mount_pool(spa); - if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { + if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 || + zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) { off = 0; zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -76,7 +76,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -376,7 +377,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:55:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6314106564A; Thu, 9 Feb 2012 16:55:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFBC78FC13; Thu, 9 Feb 2012 16:55:20 +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 q19GtKlH010434; Thu, 9 Feb 2012 16:55:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GtK7H010429; Thu, 9 Feb 2012 16:55:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091655.q19GtK7H010429@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 16:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231289 - in stable/9/contrib/gcclibs/libcpp: . include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:21 -0000 Author: ed Date: Thu Feb 9 16:55:20 2012 New Revision: 231289 URL: http://svn.freebsd.org/changeset/base/231289 Log: MFC r228474: Add support for __COUNTER__. __COUNTER__ allows one to obtain incrementing (read: unique) numbers from the C preprocesor. This is useful when implementing things like a robust implementation of CTASSERT(), which currently fails when using it more than once on a single line of code. Probably not likely to cause any breakage, but still. __COUNTER__ was also added to GCC 4.3, but since that implementation is GPLv3 licensed, I took the liberty of implementing it without looking at any upstream sources. Therefore, this version is licensed under the same license as the rest of the code; GPLv2. Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h stable/9/contrib/gcclibs/libcpp/init.c stable/9/contrib/gcclibs/libcpp/internal.h stable/9/contrib/gcclibs/libcpp/macro.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/include/cpplib.h Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/include/cpplib.h Thu Feb 9 16:55:20 2012 (r231289) @@ -555,7 +555,8 @@ enum builtin_type BT_TIME, /* `__TIME__' */ BT_STDC, /* `__STDC__' */ BT_PRAGMA, /* `_Pragma' operator */ - BT_TIMESTAMP /* `__TIMESTAMP__' */ + BT_TIMESTAMP, /* `__TIMESTAMP__' */ + BT_COUNTER /* `__COUNTER__' */ }; #define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE)) Modified: stable/9/contrib/gcclibs/libcpp/init.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/init.c Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/init.c Thu Feb 9 16:55:20 2012 (r231289) @@ -308,6 +308,7 @@ static const struct builtin builtin_arra B("__BASE_FILE__", BT_BASE_FILE), B("__LINE__", BT_SPECLINE), B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), + B("__COUNTER__", BT_COUNTER), /* Keep builtins not used for -traditional-cpp at the end, and update init_builtins() if any more are added. */ B("_Pragma", BT_PRAGMA), Modified: stable/9/contrib/gcclibs/libcpp/internal.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/internal.h Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/internal.h Thu Feb 9 16:55:20 2012 (r231289) @@ -448,6 +448,8 @@ struct cpp_reader /* A saved list of the defined macros, for dependency checking of precompiled headers. */ struct cpp_savedstate *savedstate; + + unsigned int nextcounter; }; /* Character classes. Based on the more primitive macros in safe-ctype.h. Modified: stable/9/contrib/gcclibs/libcpp/macro.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/macro.c Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/macro.c Thu Feb 9 16:55:20 2012 (r231289) @@ -262,6 +262,10 @@ _cpp_builtin_macro_text (cpp_reader *pfi else result = pfile->time; break; + + case BT_COUNTER: + number = pfile->nextcounter++; + break; } if (result == NULL) From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:55:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F5CC1065675; Thu, 9 Feb 2012 16:55:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592738FC13; Thu, 9 Feb 2012 16:55:42 +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 q19GtgXY010504; Thu, 9 Feb 2012 16:55:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gtggv010502; Thu, 9 Feb 2012 16:55:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091655.q19Gtggv010502@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231290 - stable/9/lib/libc/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:42 -0000 Author: bapt Date: Thu Feb 9 16:55:41 2012 New Revision: 231290 URL: http://svn.freebsd.org/changeset/base/231290 Log: MFH r226166: Document some not-so-recently added trace points Approved by: des (mentor) Modified: stable/9/lib/libc/sys/ktrace.2 Directory Properties: stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/ktrace.2 ============================================================================== --- stable/9/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:20 2012 (r231289) +++ stable/9/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:41 2012 (r231290) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 13, 2008 +.Dd October 9, 2011 .Dt KTRACE 2 .Os .Sh NAME @@ -80,7 +80,7 @@ The .Fa trpoints argument specifies the trace points of interest. The defined trace points are: -.Bl -column KTRFAC_SYSCALLXXX -offset indent +.Bl -column KTRFAC_PROCCTORXXX -offset indent .It "KTRFAC_SYSCALL Trace system calls." .It "KTRFAC_SYSRET Trace return values from system calls." .It "KTRFAC_NAMEI Trace name lookup operations." @@ -88,6 +88,11 @@ The defined trace points are: generate much output). .It "KTRFAC_PSIG Trace posted signals." .It "KTRFAC_CSW Trace context switch points." +.It "KTRFAC_USER Trace application-specific events." +.It "KTRFAC_STRUCT Trace certain data structures." +.It "KTRFAC_SYSCTL Trace sysctls." +.It "KTRFAC_PROCCTOR Trace process construction." +.It "KTRFAC_PROCDTOR Trace process destruction." .It "KTRFAC_INHERIT Inherit tracing to future children." .El .Pp From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:57:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B059106564A; Thu, 9 Feb 2012 16:57:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6318FC0C; Thu, 9 Feb 2012 16:57: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 q19GvMnU010830; Thu, 9 Feb 2012 16:57:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GvMgq010827; Thu, 9 Feb 2012 16:57:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091657.q19GvMgq010827@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231292 - stable/9/share/man/man9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:57:22 -0000 Author: bapt Date: Thu Feb 9 16:57:21 2012 New Revision: 231292 URL: http://svn.freebsd.org/changeset/base/231292 Log: MFH r226119: Mention tdsignal(9) Approved by: des (mentor) Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/psignal.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Thu Feb 9 16:55:50 2012 (r231291) +++ stable/9/share/man/man9/Makefile Thu Feb 9 16:57:21 2012 (r231292) @@ -1004,7 +1004,8 @@ MLINKS+=printf.9 log.9 \ MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 MLINKS+=psignal.9 gsignal.9 \ - psignal.9 pgsignal.9 + psignal.9 pgsignal.9 \ + psignal.9 tdsignal.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ Modified: stable/9/share/man/man9/psignal.9 ============================================================================== --- stable/9/share/man/man9/psignal.9 Thu Feb 9 16:55:50 2012 (r231291) +++ stable/9/share/man/man9/psignal.9 Thu Feb 9 16:57:21 2012 (r231292) @@ -28,14 +28,15 @@ .\" $NetBSD: psignal.9,v 1.1 1996/06/22 22:57:35 pk Exp $ .\" $FreeBSD$ .\" -.Dd June 22, 1996 +.Dd October 8, 2011 .Dt PSIGNAL 9 .Os .Sh NAME .Nm psignal , .Nm pgsignal , -.Nm gsignal -.Nd post signal to a process or process group +.Nm gsignal , +.Nm tdsignal +.Nd post signal to a thread, process, or process group .Sh SYNOPSIS .In sys/types.h .In sys/signalvar.h @@ -45,8 +46,10 @@ .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty" .Ft void .Fn gsignal "int pgid" "int signum" +.Ft void +.Fn tdsignal "struct thread *td" "int signum" .Sh DESCRIPTION -These functions post a signal to one or more processes. +These functions post a signal to a thread or one or more processes. The argument .Fa signum common to all three functions should be in the range @@ -135,6 +138,13 @@ set to zero. If .Fa pgid is zero no action is taken. +.Pp +The +.Fn tdsignal +function posts signal number +.Fa signum +to the thread represented by the thread structure +.Fa td . .Sh SEE ALSO .Xr sigaction 2 , .Xr signal 9 , From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 16:58:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28BC1065672; Thu, 9 Feb 2012 16:58:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B11618FC19; Thu, 9 Feb 2012 16:58:06 +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 q19Gw6B5010991; Thu, 9 Feb 2012 16:58:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gw68A010985; Thu, 9 Feb 2012 16:58:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091658.q19Gw68A010985@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 16:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231294 - stable/9/share/man/man9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:58:07 -0000 Author: ed Date: Thu Feb 9 16:58:06 2012 New Revision: 231294 URL: http://svn.freebsd.org/changeset/base/231294 Log: MFC r230330: Remove remnants of dev_t. These functions take a `struct cdev *' -- not a dev_t. Inside the kernel, dev_t has the same use as in userspace, namely to store a device identifier. Modified: stable/9/share/man/man9/DEV_MODULE.9 stable/9/share/man/man9/devtoname.9 stable/9/share/man/man9/physio.9 stable/9/share/man/man9/uio.9 stable/9/share/man/man9/vcount.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/DEV_MODULE.9 ============================================================================== --- stable/9/share/man/man9/DEV_MODULE.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/DEV_MODULE.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2001 +.Dd January 19, 2012 .Dt DEV_MODULE 9 .Os .Sh NAME @@ -68,7 +68,7 @@ on load and to destroy it when it is unl static struct cdevsw foo_devsw = { ... }; -static dev_t sdev; +static struct cdev *sdev; static int foo_load(module_t mod, int cmd, void *arg) Modified: stable/9/share/man/man9/devtoname.9 ============================================================================== --- stable/9/share/man/man9/devtoname.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/devtoname.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -24,17 +24,17 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 1999 +.Dd January 19, 2012 .Dt DEVTONAME 9 .Os .Sh NAME .Nm devtoname -.Nd "converts dev_t data into a string indicating the device name" +.Nd "converts character device into a string indicating the device name" .Sh SYNOPSIS .In sys/param.h .In sys/conf.h .Ft const char * -.Fn devtoname "dev_t dev" +.Fn devtoname "struct cdev *dev" .Sh DESCRIPTION The .Fn devtoname Modified: stable/9/share/man/man9/physio.9 ============================================================================== --- stable/9/share/man/man9/physio.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/physio.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2004 +.Dd January 19, 2012 .Dt PHYSIO 9 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/bio.h .In sys/buf.h .Ft int -.Fn physio "dev_t dev" "struct uio *uio" "int ioflag" +.Fn physio "struct cdev *dev" "struct uio *uio" "int ioflag" .Sh DESCRIPTION The .Fn physio Modified: stable/9/share/man/man9/uio.9 ============================================================================== --- stable/9/share/man/man9/uio.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/uio.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2011 +.Dd January 19, 2012 .Dt UIO 9 .Os .Sh NAME @@ -154,7 +154,7 @@ static char buffer[BUFSIZE]; static int data_available; /* amount of data that can be read */ static int -fooread(dev_t dev, struct uio *uio, int flag) +fooread(struct cdev *dev, struct uio *uio, int flag) { int rv, amnt; Modified: stable/9/share/man/man9/vcount.9 ============================================================================== --- stable/9/share/man/man9/vcount.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/vcount.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2001 +.Dd January 19, 2012 .Dt VCOUNT 9 .Os .Sh NAME @@ -47,7 +47,7 @@ .Ft int .Fn vcount "struct vnode *vp" .Ft int -.Fn count_dev "dev_t dev" +.Fn count_dev "struct cdev *dev" .Sh DESCRIPTION .Fn vcount is used to get the number of references to a particular device. @@ -56,7 +56,7 @@ It allows for the fact that multiple vno does the same thing as .Fn vcount , but takes a -.Vt dev_t +.Vt "struct cdev" rather than a .Vt "struct vnode" pointer as an argument. From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 20:54:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA53106564A; Thu, 9 Feb 2012 20:54:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 477128FC0A; Thu, 9 Feb 2012 20:54:05 +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 q19Ks5tK028850; Thu, 9 Feb 2012 20:54:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ks5jt028848; Thu, 9 Feb 2012 20:54:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092054.q19Ks5jt028848@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231301 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:54:05 -0000 Author: bz Date: Thu Feb 9 20:54:04 2012 New Revision: 231301 URL: http://svn.freebsd.org/changeset/base/231301 Log: MFC r229276: Remove an uneeded inpcb forward declaration and align the function declaration following to match the style in the rest of the file. Modified: stable/9/sys/netinet6/in6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_var.h ============================================================================== --- stable/9/sys/netinet6/in6_var.h Thu Feb 9 20:51:03 2012 (r231300) +++ stable/9/sys/netinet6/in6_var.h Thu Feb 9 20:54:04 2012 (r231301) @@ -779,8 +779,7 @@ void in6_ifremloop(struct ifaddr *); void in6_ifaddloop(struct ifaddr *); int in6_is_addr_deprecated __P((struct sockaddr_in6 *)); -struct inpcb; -int in6_src_ioctl __P((u_long, caddr_t)); +int in6_src_ioctl __P((u_long, caddr_t)); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 20:57:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41008106566B; Thu, 9 Feb 2012 20:57:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F69E8FC17; Thu, 9 Feb 2012 20:57:26 +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 q19KvQYH029420; Thu, 9 Feb 2012 20:57:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KvPWT029418; Thu, 9 Feb 2012 20:57:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092057.q19KvPWT029418@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231304 - stable/9/sys/net80211 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:57:26 -0000 Author: bz Date: Thu Feb 9 20:57:25 2012 New Revision: 231304 URL: http://svn.freebsd.org/changeset/base/231304 Log: MFC r229795: Correct comment for the IPv6 case to say "traffic class" not "TOS" as pointed out back in 2009. Modified: stable/9/sys/net80211/ieee80211_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net80211/ieee80211_output.c ============================================================================== --- stable/9/sys/net80211/ieee80211_output.c Thu Feb 9 20:54:25 2012 (r231303) +++ stable/9/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:25 2012 (r231304) @@ -834,7 +834,7 @@ ieee80211_classify(struct ieee80211_node uint32_t flow; uint8_t tos; /* - * IPv6 frame, map the DSCP bits from the TOS field. + * IPv6 frame, map the DSCP bits from the traffic class field. */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow), From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 22:02:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58FE3106566B; Thu, 9 Feb 2012 22:02:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4755F8FC12; Thu, 9 Feb 2012 22:02:00 +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 q19M20UE037398; Thu, 9 Feb 2012 22:02:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19M20Mo037396; Thu, 9 Feb 2012 22:02:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092202.q19M20Mo037396@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231309 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:02:00 -0000 Author: bz Date: Thu Feb 9 22:01:59 2012 New Revision: 231309 URL: http://svn.freebsd.org/changeset/base/231309 Log: MFC r229546: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. Modified: stable/9/sys/netinet6/in6_ifattach.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/9/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:44 2012 (r231308) +++ stable/9/sys/netinet6/in6_ifattach.c Thu Feb 9 22:01:59 2012 (r231309) @@ -513,12 +513,8 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); + ifa_free(&ia->ia_ifa); /* From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 22:05:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A8A4106566C; Thu, 9 Feb 2012 22:05:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EFB8FC13; Thu, 9 Feb 2012 22:05:51 +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 q19M5pHx037900; Thu, 9 Feb 2012 22:05:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19M5pnU037898; Thu, 9 Feb 2012 22:05:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202092205.q19M5pnU037898@svn.freebsd.org> From: Michael Tuexen Date: Thu, 9 Feb 2012 22:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231310 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:05:51 -0000 Author: tuexen Date: Thu Feb 9 22:05:51 2012 New Revision: 231310 URL: http://svn.freebsd.org/changeset/base/231310 Log: MFC r231074: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. Modified: stable/9/sys/netinet/sctp_structs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Thu Feb 9 22:01:59 2012 (r231309) +++ stable/9/sys/netinet/sctp_structs.h Thu Feb 9 22:05:51 2012 (r231310) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 9 22:54:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A1F1065674; Thu, 9 Feb 2012 22:54:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213568FC15; Thu, 9 Feb 2012 22:54:17 +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 q19MsGS4041575; Thu, 9 Feb 2012 22:54:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MsGte041573; Thu, 9 Feb 2012 22:54:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092254.q19MsGte041573@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231316 - stable/9/sys/netinet X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:54:17 -0000 Author: bz Date: Thu Feb 9 22:54:16 2012 New Revision: 231316 URL: http://svn.freebsd.org/changeset/base/231316 Log: MFC r230387: Remove a superfluous INET6 check (no opt_inet6.h included anyway). Modified: stable/9/sys/netinet/if_ether.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Thu Feb 9 22:54:07 2012 (r231315) +++ stable/9/sys/netinet/if_ether.c Thu Feb 9 22:54:16 2012 (r231316) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) || defined(INET6) +#if defined(INET) #include #endif From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 00:02:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0CB106564A; Fri, 10 Feb 2012 00:02:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484C18FC0A; Fri, 10 Feb 2012 00:02:04 +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 q1A024JA044102; Fri, 10 Feb 2012 00:02:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0247k044100; Fri, 10 Feb 2012 00:02:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100002.q1A0247k044100@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231319 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:02:04 -0000 Author: bz Date: Fri Feb 10 00:02:03 2012 New Revision: 231319 URL: http://svn.freebsd.org/changeset/base/231319 Log: MFC r230494: Remove unnecessary line break. Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Feb 10 00:01:50 2012 (r231318) +++ stable/9/sys/netinet6/in6.c Fri Feb 10 00:02:03 2012 (r231319) @@ -1354,8 +1354,7 @@ in6_purgeaddr(struct ifaddr *ifa) mltaddr.sin6_family = AF_INET6; mltaddr.sin6_addr = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != - 0) + if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) goto cleanup; rt = rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL); From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 00:08:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D09106566B; Fri, 10 Feb 2012 00:08:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D724D8FC14; Fri, 10 Feb 2012 00:08:53 +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 q1A08rFd044527; Fri, 10 Feb 2012 00:08:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A08rdC044525; Fri, 10 Feb 2012 00:08:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100008.q1A08rdC044525@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231321 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:08:54 -0000 Author: eadler Date: Fri Feb 10 00:08:53 2012 New Revision: 231321 URL: http://svn.freebsd.org/changeset/base/231321 Log: MFC r228344: - Add support for Support SEAGATE DAT Scopion 130 PR: kern/141934 Approved by: cperciva Modified: stable/9/sys/cam/scsi/scsi_sa.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:02:13 2012 (r231320) +++ stable/9/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:08:53 2012 (r231321) @@ -334,6 +334,10 @@ static struct sa_quirk_entry sa_quirk_ta "STT20000*", "*"}, SA_QUIRK_1FM, 0 }, { + { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE", + "DAT 06241-XXX", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0 + }, + { { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG", " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP|SA_QUIRK_1FM, 512 }, From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 00:24:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D7A106566B; Fri, 10 Feb 2012 00:24:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A62AA8FC1A; Fri, 10 Feb 2012 00:24:39 +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 q1A0Odgl045174; Fri, 10 Feb 2012 00:24:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0OdN1045172; Fri, 10 Feb 2012 00:24:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100024.q1A0OdN1045172@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231324 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:24:39 -0000 Author: bz Date: Fri Feb 10 00:24:39 2012 New Revision: 231324 URL: http://svn.freebsd.org/changeset/base/231324 Log: MFC r230506: Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr(). Reviewed by: rwatson Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Feb 10 00:10:13 2012 (r231323) +++ stable/9/sys/netinet6/in6.c Fri Feb 10 00:24:39 2012 (r231324) @@ -1448,6 +1448,8 @@ in6_purgeaddr(struct ifaddr *ifa) } cleanup: + if (ifa0 != NULL) + ifa_free(ifa0); plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { @@ -1472,8 +1474,6 @@ cleanup: return; ia->ia_flags &= ~IFA_ROUTE; } - if (ifa0 != NULL) - ifa_free(ifa0); in6_unlink_ifa(ia, ifp); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 00:51:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71CBB1065670; Fri, 10 Feb 2012 00:51:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 604F68FC15; Fri, 10 Feb 2012 00:51: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 q1A0pNMc046097; Fri, 10 Feb 2012 00:51:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0pNa2046095; Fri, 10 Feb 2012 00:51:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100051.q1A0pNa2046095@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231326 - stable/9/sys/net X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:51:23 -0000 Author: bz Date: Fri Feb 10 00:51:23 2012 New Revision: 231326 URL: http://svn.freebsd.org/changeset/base/231326 Log: MFC r230510: Replace random ARIN direct assignment legacy IPs with proper RFC 5735 TEST-NET1 block for use in documentation and example code addresses. Modified: stable/9/sys/net/route.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Fri Feb 10 00:24:41 2012 (r231325) +++ stable/9/sys/net/route.c Fri Feb 10 00:51:23 2012 (r231326) @@ -1503,10 +1503,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int #ifdef RADIX_MPATH /* * in case address alias finds the first address - * e.g. ifconfig bge0 192.103.54.246/24 - * e.g. ifconfig bge0 192.103.54.247/24 - * the address set in the route is 192.103.54.246 - * so we need to replace it with 192.103.54.247 + * e.g. ifconfig bge0 192.0.2.246/24 + * e.g. ifconfig bge0 192.0.2.247/24 + * the address set in the route is 192.0.2.246 + * so we need to replace it with 192.0.2.247 */ if (memcmp(rt->rt_ifa->ifa_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len)) { From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 03:32:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F4B1065670; Fri, 10 Feb 2012 03:32:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B10178FC12; Fri, 10 Feb 2012 03:32:29 +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 q1A3WTVl051550; Fri, 10 Feb 2012 03:32:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3WTom051545; Fri, 10 Feb 2012 03:32:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202100332.q1A3WTom051545@svn.freebsd.org> From: Rick Macklem Date: Fri, 10 Feb 2012 03:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231330 - in stable/9/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:32:29 -0000 Author: rmacklem Date: Fri Feb 10 03:32:29 2012 New Revision: 231330 URL: http://svn.freebsd.org/changeset/base/231330 Log: MFC: r230605 A problem with respect to data read through the buffer cache for both NFS clients was reported to freebsd-fs@ under the subject "NFS corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when a TCP mounted root fs was changed to using UDP. I believe that this problem was caused by the change in mnt_stat.f_iosize that occurred because rsize was decreased to the maximum supported by UDP. This patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize, since the latter is set to f_iosize when the vnode is allocated, but does not change for a given vnode when f_iosize changes. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nfsclient/nfs_clnode.c stable/9/sys/fs/nfsclient/nfs_clport.c stable/9/sys/nfsclient/nfs_bio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:32:29 2012 (r231330) @@ -480,7 +480,7 @@ ncl_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return ncl_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -960,7 +960,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1264,12 +1264,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1785,7 +1781,7 @@ ncl_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:32:29 2012 (r231330) @@ -136,6 +136,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:32:29 2012 (r231330) @@ -212,6 +212,7 @@ nfscl_nget(struct mount *mntp, struct vn return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/nfsclient/nfs_bio.c Fri Feb 10 03:32:29 2012 (r231330) @@ -474,7 +474,7 @@ nfs_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return nfs_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -951,7 +951,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1255,12 +1255,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1767,7 +1763,7 @@ nfs_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 04:08:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C87106564A; Fri, 10 Feb 2012 04:08:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 659418FC14; Fri, 10 Feb 2012 04:08: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 q1A48M64052780; Fri, 10 Feb 2012 04:08:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A48MB8052778; Fri, 10 Feb 2012 04:08:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100408.q1A48MB8052778@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 04:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231333 - stable/9/share/man/man7 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:08:22 -0000 Author: eadler Date: Fri Feb 10 04:08:22 2012 New Revision: 231333 URL: http://svn.freebsd.org/changeset/base/231333 Log: MFC r231111, r231331 PR: 159551 Approved by: gjb Modified: stable/9/share/man/man7/ports.7 Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/ports.7 ============================================================================== --- stable/9/share/man/man7/ports.7 Fri Feb 10 04:01:17 2012 (r231332) +++ stable/9/share/man/man7/ports.7 Fri Feb 10 04:08:22 2012 (r231333) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 06:34:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1188B106566C; Fri, 10 Feb 2012 06:34:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F31B48FC13; Fri, 10 Feb 2012 06:34:21 +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 q1A6YLJ0057660; Fri, 10 Feb 2012 06:34:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6YLLG057658; Fri, 10 Feb 2012 06:34:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100634.q1A6YLLG057658@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231342 - stable/9/sys/geom/part X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:34:22 -0000 Author: ae Date: Fri Feb 10 06:34:21 2012 New Revision: 231342 URL: http://svn.freebsd.org/changeset/base/231342 Log: MFC r228061: The size of APM could be bigger than number of already allocated entries. And the first usable sector should not start from the inside of APM area. MFC r228076: Add an ability to increase number of allocated APM entries when we have reserved free space in the APM area. Also instead of one write request per each APM entry, use MAXPHYS sized writes when we are updating APM. Modified: stable/9/sys/geom/part/g_part_apm.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_apm.c ============================================================================== --- stable/9/sys/geom/part/g_part_apm.c Fri Feb 10 06:30:52 2012 (r231341) +++ stable/9/sys/geom/part/g_part_apm.c Fri Feb 10 06:34:21 2012 (r231342) @@ -234,6 +234,12 @@ g_part_apm_add(struct g_part_table *base strncpy(entry->ent.ent_name, gpp->gpp_label, sizeof(entry->ent.ent_name)); } + if (baseentry->gpe_index >= table->self.ent_pmblkcnt) + table->self.ent_pmblkcnt = baseentry->gpe_index + 1; + KASSERT(table->self.ent_size >= table->self.ent_pmblkcnt, + ("%s", __func__)); + KASSERT(table->self.ent_size > baseentry->gpe_index, + ("%s", __func__)); return (0); } @@ -443,9 +449,9 @@ g_part_apm_read(struct g_part_table *bas table = (struct g_part_apm_table *)basetable; - basetable->gpt_first = table->self.ent_pmblkcnt + 1; + basetable->gpt_first = table->self.ent_size + 1; basetable->gpt_last = table->ddr.ddr_blkcount - 1; - basetable->gpt_entries = table->self.ent_pmblkcnt - 1; + basetable->gpt_entries = table->self.ent_size - 1; for (index = table->self.ent_pmblkcnt - 1; index > 0; index--) { error = apm_read_ent(cp, index + 1, &ent, table->tivo_series1); @@ -497,67 +503,78 @@ g_part_apm_type(struct g_part_table *bas static int g_part_apm_write(struct g_part_table *basetable, struct g_consumer *cp) { - char buf[512]; + struct g_provider *pp; struct g_part_entry *baseentry; struct g_part_apm_entry *entry; struct g_part_apm_table *table; - int error, index; + char *buf, *ptr; + uint32_t index; + int error; + size_t tblsz; + pp = cp->provider; table = (struct g_part_apm_table *)basetable; /* * Tivo Series 1 disk partitions are currently read-only. */ if (table->tivo_series1) return (EOPNOTSUPP); - bzero(buf, sizeof(buf)); - /* Write the DDR and 'self' entry only when we're newly created. */ + /* Write the DDR only when we're newly created. */ if (basetable->gpt_created) { + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); be16enc(buf, table->ddr.ddr_sig); be16enc(buf + 2, table->ddr.ddr_blksize); be32enc(buf + 4, table->ddr.ddr_blkcount); - error = g_write_data(cp, 0, buf, sizeof(buf)); + error = g_write_data(cp, 0, buf, pp->sectorsize); + g_free(buf); if (error) return (error); } - be16enc(buf, table->self.ent_sig); - be16enc(buf + 2, 0); - be32enc(buf + 4, table->self.ent_pmblkcnt); + /* Allocate the buffer for all entries */ + tblsz = table->self.ent_pmblkcnt; + buf = g_malloc(tblsz * pp->sectorsize, M_WAITOK | M_ZERO); - if (basetable->gpt_created) { - be32enc(buf + 8, table->self.ent_start); - be32enc(buf + 12, table->self.ent_size); - bcopy(table->self.ent_name, buf + 16, - sizeof(table->self.ent_name)); - bcopy(table->self.ent_type, buf + 48, - sizeof(table->self.ent_type)); - error = g_write_data(cp, 512, buf, sizeof(buf)); - if (error) - return (error); - } + /* Fill the self entry */ + be16enc(buf, APM_ENT_SIG); + be32enc(buf + 4, table->self.ent_pmblkcnt); + be32enc(buf + 8, table->self.ent_start); + be32enc(buf + 12, table->self.ent_size); + bcopy(table->self.ent_name, buf + 16, sizeof(table->self.ent_name)); + bcopy(table->self.ent_type, buf + 48, sizeof(table->self.ent_type)); baseentry = LIST_FIRST(&basetable->gpt_entry); - for (index = 1; index <= basetable->gpt_entries; index++) { + for (index = 1; index < tblsz; index++) { entry = (baseentry != NULL && index == baseentry->gpe_index) ? (struct g_part_apm_entry *)baseentry : NULL; + ptr = buf + index * pp->sectorsize; + be16enc(ptr, APM_ENT_SIG); + be32enc(ptr + 4, table->self.ent_pmblkcnt); if (entry != NULL && !baseentry->gpe_deleted) { - be32enc(buf + 8, entry->ent.ent_start); - be32enc(buf + 12, entry->ent.ent_size); - bcopy(entry->ent.ent_name, buf + 16, + be32enc(ptr + 8, entry->ent.ent_start); + be32enc(ptr + 12, entry->ent.ent_size); + bcopy(entry->ent.ent_name, ptr + 16, sizeof(entry->ent.ent_name)); - bcopy(entry->ent.ent_type, buf + 48, + bcopy(entry->ent.ent_type, ptr + 48, sizeof(entry->ent.ent_type)); } else { - bzero(buf + 8, 4 + 4 + 32 + 32); - strcpy(buf + 48, APM_ENT_TYPE_UNUSED); + strcpy(ptr + 48, APM_ENT_TYPE_UNUSED); } - error = g_write_data(cp, (index + 1) * 512, buf, sizeof(buf)); - if (error) - return (error); if (entry != NULL) baseentry = LIST_NEXT(baseentry, gpe_entry); } + for (index = 0; index < tblsz; index += MAXPHYS / pp->sectorsize) { + error = g_write_data(cp, (1 + index) * pp->sectorsize, + buf + index * pp->sectorsize, + (tblsz - index > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (tblsz - index) * pp->sectorsize); + if (error) { + g_free(buf); + return (error); + } + } + g_free(buf); return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 06:38:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080211065670; Fri, 10 Feb 2012 06:38:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA7288FC08; Fri, 10 Feb 2012 06:38:03 +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 q1A6c3cJ057884; Fri, 10 Feb 2012 06:38:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6c3jm057882; Fri, 10 Feb 2012 06:38:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100638.q1A6c3jm057882@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231344 - stable/9/sys/geom/part X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:38:04 -0000 Author: ae Date: Fri Feb 10 06:38:03 2012 New Revision: 231344 URL: http://svn.freebsd.org/changeset/base/231344 Log: MFC r230861: The scheme code may not know about some inconsistency in the metadata. So, add an integrity check after recovery attempt. Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Fri Feb 10 06:35:14 2012 (r231343) +++ stable/9/sys/geom/part/g_part.c Fri Feb 10 06:38:03 2012 (r231344) @@ -1215,6 +1215,9 @@ g_part_ctl_recover(struct gctl_req *req, if (table->gpt_corrupt) { error = G_PART_RECOVER(table); + if (error == 0) + error = g_part_check_integrity(table, + LIST_FIRST(&gp->consumer)); if (error) { gctl_error(req, "%d recovering '%s' failed", error, gp->name); From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 09:46:31 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AF0106564A; Fri, 10 Feb 2012 09:46:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55A438FC16; Fri, 10 Feb 2012 09:46:31 +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 q1A9kVAU065008; Fri, 10 Feb 2012 09:46:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9kVOp065007; Fri, 10 Feb 2012 09:46:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202100946.q1A9kVOp065007@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 09:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231365 - in stable/9/etc: . rc.d X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:46:31 -0000 Author: dougb Date: Fri Feb 10 09:46:30 2012 New Revision: 231365 URL: http://svn.freebsd.org/changeset/base/231365 Log: Pull up mergeinfo from r226345,226464,226879 to etc/ where it belongs Modified: Directory Properties: stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 10:22:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 633C4106566C; Fri, 10 Feb 2012 10:22:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515628FC08; Fri, 10 Feb 2012 10:22:43 +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 q1AAMhdS066604; Fri, 10 Feb 2012 10:22:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAMhWm066602; Fri, 10 Feb 2012 10:22:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101022.q1AAMhWm066602@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231373 - stable/9/etc/rc.d X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:22:43 -0000 Author: dougb Date: Fri Feb 10 10:22:42 2012 New Revision: 231373 URL: http://svn.freebsd.org/changeset/base/231373 Log: MFC r228191: Ensure kldxref is run first. Modified: stable/9/etc/rc.d/kld Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/kld ============================================================================== --- stable/9/etc/rc.d/kld Fri Feb 10 10:18:30 2012 (r231372) +++ stable/9/etc/rc.d/kld Fri Feb 10 10:22:42 2012 (r231373) @@ -27,7 +27,7 @@ # $FreeBSD$ # # PROVIDE: kld -# REQUIRE: FILESYSTEMS +# REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 13:35:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43DD7106564A; Fri, 10 Feb 2012 13:35:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8888FC14; Fri, 10 Feb 2012 13:35:50 +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 q1ADZoHI076176; Fri, 10 Feb 2012 13:35:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADZnri076174; Fri, 10 Feb 2012 13:35:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202101335.q1ADZnri076174@svn.freebsd.org> From: Martin Matuska Date: Fri, 10 Feb 2012 13:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231381 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:35:50 -0000 Author: mm Date: Fri Feb 10 13:35:49 2012 New Revision: 231381 URL: http://svn.freebsd.org/changeset/base/231381 Log: MFC r231144: Merge illumos revision 13594: uninitialized variables in zfs(8) may make snapshots undestroyable [1] References: https://www.illumos.org/issues/2067 [1] Obtained from: illumos (issue #2067) PR: bin/164802 Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:15:11 2012 (r231380) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:35:49 2012 (r231381) @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void static int destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) { - int err; + int err = 0; assert(cb->cb_firstsnap == NULL); assert(cb->cb_prevsnap == NULL); err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) ZFS_TYPE_SNAPSHOT); if (zhp != NULL) { boolean_t defer = cb->cb_defer_destroy; - int err; + int err = 0; /* * We can't defer destroy non-snapshots, so set it to @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma uid_t id; uint64_t classes; #ifdef sun - int err; + int err = 0; directory_error_t e; #endif @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) boolean_t prtnum = B_FALSE; boolean_t parseable = B_FALSE; boolean_t sid2posix = B_FALSE; - int error; + int error = 0; int c; zfs_sort_column_t *default_sortcol = NULL; zfs_sort_column_t *sortcol = NULL; @@ -2920,7 +2920,7 @@ zfs_do_list(int argc, char **argv) list_cbdata_t cb = { 0 }; char *value; int limit = 0; - int ret; + int ret = 0; zfs_sort_column_t *sortcol = NULL; int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -3050,7 +3050,9 @@ zfs_do_rename(int argc, char **argv) { zfs_handle_t *zhp; renameflags_t flags = { 0 }; - int c, ret, types; + int c; + int ret = 0; + int types; boolean_t parents = B_FALSE; /* check options */ @@ -3143,7 +3145,7 @@ static int zfs_do_promote(int argc, char **argv) { zfs_handle_t *zhp; - int ret; + int ret = 0; /* check options */ if (argc > 1 && argv[1][0] == '-') { @@ -3264,7 +3266,7 @@ rollback_check(zfs_handle_t *zhp, void * static int zfs_do_rollback(int argc, char **argv) { - int ret; + int ret = 0; int c; boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; @@ -3382,7 +3384,7 @@ static int zfs_do_set(int argc, char **argv) { set_cbdata_t cb; - int ret; + int ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3436,7 +3438,7 @@ static int zfs_do_snapshot(int argc, char **argv) { boolean_t recursive = B_FALSE; - int ret; + int ret = 0; char c; nvlist_t *props; @@ -5274,7 +5276,7 @@ zfs_do_holds(int argc, char **argv) holds_cbdata_t cb = { 0 }; int limit = 0; - int ret; + int ret = 0; int flags = 0; /* check options */ @@ -5851,7 +5853,7 @@ static int unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) { zfs_handle_t *zhp; - int ret; + int ret = 0; struct stat64 statbuf; struct extmnttab entry; const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; @@ -6319,7 +6321,7 @@ manual_mount(int argc, char **argv) zfs_handle_t *zhp; char mountpoint[ZFS_MAXPROPLEN]; char mntopts[MNT_LINE_MAX] = { '\0' }; - int ret; + int ret = 0; int c; int flags = 0; char *dataset, *path; @@ -6469,7 +6471,7 @@ zfs_do_diff(int argc, char **argv) char *tosnap = NULL; char *fromsnap = NULL; char *atp, *copy; - int err; + int err = 0; int c; while ((c = getopt(argc, argv, "FHt")) != -1) { @@ -6539,7 +6541,7 @@ zfs_do_diff(int argc, char **argv) int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *progname; char *cmdname; From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 15:54:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452BD1065672; Fri, 10 Feb 2012 15:54:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F19A8FC08; Fri, 10 Feb 2012 15:54:18 +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 q1AFsILR082088; Fri, 10 Feb 2012 15:54:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFsHfh082086; Fri, 10 Feb 2012 15:54:17 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202101554.q1AFsHfh082086@svn.freebsd.org> From: Brooks Davis Date: Fri, 10 Feb 2012 15:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231388 - stable/9/etc/rc.d X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:54:18 -0000 Author: brooks Date: Fri Feb 10 15:54:17 2012 New Revision: 231388 URL: http://svn.freebsd.org/changeset/base/231388 Log: MFC r230403. When creating the jails /dev/log symlink, do it by full path to avoid creating stray "log" symlinks if the mount fails. That apparently happens in some ezjail configs. PR: conf/143084 Submitted by: Dirk Engling Modified: stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Fri Feb 10 15:34:36 2012 (r231387) +++ stable/9/etc/rc.d/jail Fri Feb 10 15:54:17 2012 (r231388) @@ -601,10 +601,7 @@ jail_start() devfs_mount_jail "${_devdir}" ${_ruleset} # Transitional symlink for old binaries if [ ! -L "${_devdir}/log" ]; then - __pwd="`pwd`" - cd "${_devdir}" - ln -sf ../var/run/log log - cd "$__pwd" + ln -sf ../var/run/log "${_devdir}/log" fi fi From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 10 18:14:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD027106566B; Fri, 10 Feb 2012 18:14:25 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACDE18FC08; Fri, 10 Feb 2012 18:14:25 +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 q1AIEPMh086717; Fri, 10 Feb 2012 18:14:25 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIEPIx086715; Fri, 10 Feb 2012 18:14:25 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202101814.q1AIEPIx086715@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Feb 2012 18:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231392 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:14:25 -0000 Author: ken Date: Fri Feb 10 18:14:25 2012 New Revision: 231392 URL: http://svn.freebsd.org/changeset/base/231392 Log: MFC 231170 Update the mps(4) man page for the changes in the new LSI-supported driver. This should have been included in change 230592. The supported hardware section still needs some updating to reflect the current reality. Modified: stable/9/share/man/man4/mps.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mps.4 ============================================================================== --- stable/9/share/man/man4/mps.4 Fri Feb 10 17:49:14 2012 (r231391) +++ stable/9/share/man/man4/mps.4 Fri Feb 10 18:14:25 2012 (r231392) @@ -31,10 +31,10 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd February 7, 2012 .Dt MPS 4 .Os .Sh NAME @@ -58,7 +58,7 @@ The .Nm driver provides support for LSI Logic Fusion-MPT 2 .Tn SAS -controllers. +controllers and WarpDrive solid state storage cards. .Sh HARDWARE The .Nm @@ -90,6 +90,16 @@ driver instances, set the following tuna hw.mps.disable_msi=1 .Ed .Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp To disable MSI-X interrupts for all .Nm driver instances, set the following tunable value in @@ -98,19 +108,51 @@ driver instances, set the following tuna hw.mps.disable_msix=1 .Ed .Pp -To allow the driver to send multiple task management commands (like abort, -LUN reset, etc.), set the following variable: +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : .Bd -literal -offset indent -hw.mps.X.allow_multiple_tm_cmds=1 +dev.mps.X.disable_msix=1 .Ed .Pp -via -.Xr loader.conf 5 -or -.Xr sysctl 8 , -where X is the adapter number. -By default the driver only sends one task management command at a time, to -avoid causing a potential controller lock-up. +To set the maximum number of DMA chains allocated for all adapters, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.max_chains=NNNN +.Ed +.Pp +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mps.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mps.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mps.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O command seen since boot is shown in the +dev.mps.X.io_cmds_highwater +.Xr sysctl 8 +variable. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -142,7 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -154,20 +198,19 @@ The .Nm driver was originally written by .An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Logic Corporation. This man page was written by .An Ken Merry Aq ken@FreeBSD.org . .Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: +This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No IR (Integrated RAID) support. +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). .It -No userland utility support (e.g. -.Xr mptutil 8). -.It -Sometimes the driver gets into a state where devices arrive and depart multiple -times, without user intervention. +No userland utility available (e.g. +.Xr mptutil 8) .It -The error recovery code isn't complete. +The driver probes devices sequentially. +If your system has a large number of devices, the probe will take a while. .El From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 11 14:55:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 206F71065670; Sat, 11 Feb 2012 14:55:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2E7A8FC12; Sat, 11 Feb 2012 14:55:05 +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 q1BEt5kM035632; Sat, 11 Feb 2012 14:55:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEt5X4035630; Sat, 11 Feb 2012 14:55:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202111455.q1BEt5X4035630@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Feb 2012 14:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231522 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:55:06 -0000 Author: avg Date: Sat Feb 11 14:55:05 2012 New Revision: 231522 URL: http://svn.freebsd.org/changeset/base/231522 Log: MFC r230157: dadump: don't leak the periph lock on i/o error Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Feb 11 14:49:25 2012 (r231521) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Feb 11 14:55:05 2012 (r231522) @@ -1100,6 +1100,7 @@ dadump(void *arg, void *virtual, vm_offs /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); + cam_periph_unlock(periph); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("Aborting dump due to I/O error.\n"); @@ -1111,7 +1112,6 @@ dadump(void *arg, void *virtual, vm_offs csio.ccb_h.status, csio.scsi_status); return(EIO); } - cam_periph_unlock(periph); return(0); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 11 19:41:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE62C1065673; Sat, 11 Feb 2012 19:41:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82D78FC14; Sat, 11 Feb 2012 19:41:56 +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 q1BJfu4L044829; Sat, 11 Feb 2012 19:41:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BJfu1R044828; Sat, 11 Feb 2012 19:41:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202111941.q1BJfu1R044828@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 11 Feb 2012 19:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231527 - stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 19:41:57 -0000 Author: pfg Date: Sat Feb 11 19:41:56 2012 New Revision: 231527 URL: http://svn.freebsd.org/changeset/base/231527 Log: MFC: r230635 Set SVN text/plain property for some shell scripts that happen to have a .exe extension. While here fix the shebang of a shell script that was looking for /bin/bash. Reviewed by: gnn Approved by: jhb (mentor) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe (contents, props changed) Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 11 20:01:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C99106564A; Sat, 11 Feb 2012 20:01:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701B68FC08; Sat, 11 Feb 2012 20:01:04 +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 q1BK142U045661; Sat, 11 Feb 2012 20:01:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BK14jh045657; Sat, 11 Feb 2012 20:01:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202112001.q1BK14jh045657@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 11 Feb 2012 20:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231528 - stable/9/sys/fs/ext2fs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:01:04 -0000 Author: pfg Date: Sat Feb 11 20:01:03 2012 New Revision: 231528 URL: http://svn.freebsd.org/changeset/base/231528 Log: MFC: r231168 Update the data structures with some fields reserved for ext4 but that can be used in ext3 mode. Also adjust the internal inode to carry the birthtime, like in UFS, which is starting to get some use when big inodes are available. This is a prerequisite for new features that will be coming in the future. Approved by: jhb (mentor) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Feb 11 20:01:03 2012 (r231528) @@ -70,7 +70,7 @@ struct ext2fs_dinode { uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ - uint32_t e2di_ctime; /* 12: Create time */ + uint32_t e2di_ctime; /* 12: Change time */ uint32_t e2di_mtime; /* 16: Modification time */ uint32_t e2di_dtime; /* 20: Deletion time */ uint16_t e2di_gid; /* 24: Owner GID */ @@ -89,6 +89,8 @@ struct ext2fs_dinode { uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ + uint16_t e2di_extra_isize; + uint16_t e2di_pad1; }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Feb 11 20:01:03 2012 (r231528) @@ -123,7 +123,22 @@ struct ext2fs { char e3fs_reserved_char_pad; uint32_t e3fs_default_mount_opts; uint32_t e3fs_first_meta_bg; /* First metablock block group */ - uint32_t reserved2[190]; /* Padding to the end of the block */ + uint32_t e3fs_mkfs_time; /* when the fs was created */ + uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ + uint32_t e4fs_bcount_hi; /* block count */ + uint32_t e4fs_rbcount_hi; /* reserved blocks count */ + uint32_t e4fs_fbcount_hi; /* free blocks count */ + uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ + uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint32_t e4fs_flags; /* miscellaneous flags */ + uint16_t e4fs_raid_stride; /* RAID stride */ + uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint64_t e4fs_mmpblk; /* block for multi-mount protection */ + uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_char_pad2; + uint16_t e4fs_pad; + uint32_t reserved2[162]; /* Padding to the end of the block */ }; @@ -139,15 +154,15 @@ struct m_ext2fs { uint32_t e2fs_bsize; /* Block size */ uint32_t e2fs_bshift; /* calc of logical block no */ int32_t e2fs_bmask; /* calc of block offset */ - int32_t e2fs_bpg; /* Number of blocks per group */ + int32_t e2fs_bpg; /* Number of blocks per group */ int64_t e2fs_qbmask; /* = s_blocksize -1 */ uint32_t e2fs_fsbtodb; /* Shift to get disk block */ - uint32_t e2fs_ipg; /* Number of inodes per group */ - uint32_t e2fs_ipb; /* Number of inodes per block */ + uint32_t e2fs_ipg; /* Number of inodes per group */ + uint32_t e2fs_ipb; /* Number of inodes per block */ uint32_t e2fs_itpg; /* Number of inode table per group */ uint32_t e2fs_fsize; /* Size of fragments per block */ - uint32_t e2fs_fpb; /* Number of fragments per block */ - uint32_t e2fs_fpg; /* Number of fragments per group */ + uint32_t e2fs_fpb; /* Number of fragments per block */ + uint32_t e2fs_fpg; /* Number of fragments per group */ uint32_t e2fs_dbpg; /* Number of descriptor blocks per group */ uint32_t e2fs_descpb; /* Number of group descriptors per block */ uint32_t e2fs_gdbcount; /* Number of group descriptors */ @@ -161,7 +176,7 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ + int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/inode.h Sat Feb 11 20:01:03 2012 (r231528) @@ -85,11 +85,13 @@ struct inode { int16_t i_nlink; /* File link count. */ uint64_t i_size; /* File byte count. */ int32_t i_atime; /* Last access time. */ - int32_t i_atimensec; /* Last access time. */ int32_t i_mtime; /* Last modified time. */ - int32_t i_mtimensec; /* Last modified time. */ int32_t i_ctime; /* Last inode change time. */ + int32_t i_birthtime; /* Inode creation time. */ + int32_t i_mtimensec; /* Last modified time. */ + int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ + int32_t i_birthnsec; /* Inode creation time. */ int32_t i_db[NDADDR]; /* Direct disk blocks. */ int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 11 20:08:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228FF1065672; Sat, 11 Feb 2012 20:08:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9A28FC13; Sat, 11 Feb 2012 20:08:47 +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 q1BK8kpa045970; Sat, 11 Feb 2012 20:08:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BK8kAg045968; Sat, 11 Feb 2012 20:08:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112008.q1BK8kAg045968@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231529 - stable/9/bin/sh X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:08:47 -0000 Author: jilles Date: Sat Feb 11 20:08:46 2012 New Revision: 231529 URL: http://svn.freebsd.org/changeset/base/231529 Log: MFC r231001: sh: Fix swapped INTON/INTOFF. A possible consequence of this bug was a memory leak if SIGINT arrived during a 'set' command (listing variables). Modified: stable/9/bin/sh/var.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/var.c ============================================================================== --- stable/9/bin/sh/var.c Sat Feb 11 20:01:03 2012 (r231528) +++ stable/9/bin/sh/var.c Sat Feb 11 20:08:46 2012 (r231529) @@ -600,7 +600,7 @@ showvarscmd(int argc __unused, char **ar } } - INTON; + INTOFF; vars = ckmalloc(n * sizeof(*vars)); i = 0; for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) { @@ -625,7 +625,7 @@ showvarscmd(int argc __unused, char **ar out1c('\n'); } ckfree(vars); - INTOFF; + INTON; return 0; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 11 20:44:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65532106566B; Sat, 11 Feb 2012 20:44:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346388FC1E; Sat, 11 Feb 2012 20:44:17 +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 q1BKiH3W047339; Sat, 11 Feb 2012 20:44:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKiHc4047338; Sat, 11 Feb 2012 20:44:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112044.q1BKiHc4047338@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231533 - stable/9/bin/sh/funcs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:44:17 -0000 Author: jilles Date: Sat Feb 11 20:44:16 2012 New Revision: 231533 URL: http://svn.freebsd.org/changeset/base/231533 Log: MFC r230437: sh: Remove "kill" example function, which is superseded by the kill builtin. Deleted: stable/9/bin/sh/funcs/kill Modified: Directory Properties: stable/9/bin/sh/ (props changed)