From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 5 15:54:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4220E1065670; Sun, 5 Feb 2012 15:54:33 +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 2E8D78FC08; Sun, 5 Feb 2012 15:54: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 q15FsXih089714; Sun, 5 Feb 2012 15:54:33 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FsW9x089696; Sun, 5 Feb 2012 15:54:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051554.q15FsW9x089696@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231018 - in stable/8/sbin: hastctl hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:54:33 -0000 Author: trociny Date: Sun Feb 5 15:54:32 2012 New Revision: 231018 URL: http://svn.freebsd.org/changeset/base/231018 Log: MFC r229699, r229744, r229778, r229944, r229945, r229946, r230092, r230395, r230396, r230436, r230457, r230515, r230976: r229699 (pjd): Constify argument. r229744 (pjd): fork(2) returns -1 on failure, not some random negative number. 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/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c stable/8/sbin/hastd/activemap.c stable/8/sbin/hastd/control.c stable/8/sbin/hastd/ebuf.c stable/8/sbin/hastd/event.c stable/8/sbin/hastd/hast.conf.5 stable/8/sbin/hastd/hast_compression.c stable/8/sbin/hastd/hast_proto.c stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/hooks.c stable/8/sbin/hastd/lzf.h stable/8/sbin/hastd/metadata.c stable/8/sbin/hastd/nv.c stable/8/sbin/hastd/parse.y stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/proto.c stable/8/sbin/hastd/proto_common.c stable/8/sbin/hastd/proto_socketpair.c stable/8/sbin/hastd/proto_tcp.c stable/8/sbin/hastd/proto_uds.c stable/8/sbin/hastd/secondary.c stable/8/sbin/hastd/subr.c stable/8/sbin/hastd/subr.h stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastctl/hastctl.8 Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastctl/hastctl.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/activemap.c ============================================================================== --- stable/8/sbin/hastd/activemap.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/activemap.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/control.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/ebuf.c ============================================================================== --- stable/8/sbin/hastd/ebuf.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/ebuf.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/event.c ============================================================================== --- stable/8/sbin/hastd/event.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/event.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/hast.conf.5 ============================================================================== --- stable/8/sbin/hastd/hast.conf.5 Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast.conf.5 Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/hast_compression.c ============================================================================== --- stable/8/sbin/hastd/hast_compression.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast_compression.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/hast_proto.c ============================================================================== --- stable/8/sbin/hastd/hast_proto.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast_proto.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hastd.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/hooks.c ============================================================================== --- stable/8/sbin/hastd/hooks.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hooks.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/lzf.h ============================================================================== --- stable/8/sbin/hastd/lzf.h Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/lzf.h Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/metadata.c ============================================================================== --- stable/8/sbin/hastd/metadata.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/metadata.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/nv.c ============================================================================== --- stable/8/sbin/hastd/nv.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/nv.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/parse.y Sun Feb 5 15:54:32 2012 (r231018) @@ -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/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/primary.c Sun Feb 5 15:54:32 2012 (r231018) @@ -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-8@FreeBSD.ORG Sun Feb 5 19:10:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610671065677; Sun, 5 Feb 2012 19:10:49 +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 3061F8FC0A; Sun, 5 Feb 2012 19:10:49 +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 q15JAnox096630; Sun, 5 Feb 2012 19:10:49 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JAm7E096627; Sun, 5 Feb 2012 19:10:48 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051910.q15JAm7E096627@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231032 - in stable/8: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:10:49 -0000 Author: sbruno Date: Sun Feb 5 19:10:48 2012 New Revision: 231032 URL: http://svn.freebsd.org/changeset/base/231032 Log: MFC r230313, r230316, r230323, r230588 Support new raid controllers Modified: stable/8/share/man/man4/ciss.4 stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/ciss.4 ============================================================================== --- stable/8/share/man/man4/ciss.4 Sun Feb 5 18:55:20 2012 (r231031) +++ stable/8/share/man/man4/ciss.4 Sun Feb 5 19:10:48 2012 (r231032) @@ -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/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Sun Feb 5 18:55:20 2012 (r231031) +++ stable/8/sys/dev/ciss/ciss.c Sun Feb 5 19:10:48 2012 (r231032) @@ -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 } }; @@ -4530,7 +4537,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-8@FreeBSD.ORG Sun Feb 5 19:38:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9AD0106564A; Sun, 5 Feb 2012 19:38:22 +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 B3E478FC14; Sun, 5 Feb 2012 19:38: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 q15JcMFF097760; Sun, 5 Feb 2012 19:38:22 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JcMsW097758; Sun, 5 Feb 2012 19:38:22 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051938.q15JcMsW097758@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231037 - stable/8/sys/boot/i386/libi386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:38:22 -0000 Author: sbruno Date: Sun Feb 5 19:38:22 2012 New Revision: 231037 URL: http://svn.freebsd.org/changeset/base/231037 Log: MFC r230325 Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT Modified: stable/8/sys/boot/i386/libi386/pxe.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/boot/i386/libi386/pxe.c ============================================================================== --- stable/8/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:33:53 2012 (r231036) +++ stable/8/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:38:22 2012 (r231037) @@ -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-8@FreeBSD.ORG Sun Feb 5 20:18:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927D1106564A; Sun, 5 Feb 2012 20:18:54 +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 797BF8FC0C; Sun, 5 Feb 2012 20:18: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 q15KIsde099694; Sun, 5 Feb 2012 20:18:54 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KIsfU099690; Sun, 5 Feb 2012 20:18:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202052018.q15KIsfU099690@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 5 Feb 2012 20:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231048 - in stable/8/sys: conf dev/sound/pci gnu/dev/sound/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:18:54 -0000 Author: pfg Date: Sun Feb 5 20:18:53 2012 New Revision: 231048 URL: http://svn.freebsd.org/changeset/base/231048 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/8/sys/dev/sound/pci/cs461x_dsp.h - copied unchanged from r230897, head/sys/dev/sound/pci/cs461x_dsp.h Deleted: stable/8/sys/gnu/dev/sound/pci/csaimg.h Modified: stable/8/sys/conf/files stable/8/sys/dev/sound/pci/csa.c stable/8/sys/dev/sound/pci/csareg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Feb 5 20:09:50 2012 (r231047) +++ stable/8/sys/conf/files Sun Feb 5 20:18:53 2012 (r231048) @@ -1582,8 +1582,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/8/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/8/sys/dev/sound/pci/cs461x_dsp.h Sun Feb 5 20:18:53 2012 (r231048, 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-8@FreeBSD.ORG Mon Feb 6 10:35:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681D610656D0; Mon, 6 Feb 2012 10:35:22 +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 565A68FC0A; Mon, 6 Feb 2012 10:35: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 q16AZMNS031938; Mon, 6 Feb 2012 10:35:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AZMVK031936; Mon, 6 Feb 2012 10:35:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061035.q16AZMVK031936@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 10:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231072 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:35:22 -0000 Author: kib Date: Mon Feb 6 10:35:21 2012 New Revision: 231072 URL: http://svn.freebsd.org/changeset/base/231072 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/8/sys/kern/subr_syscall.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_syscall.c ============================================================================== --- stable/8/sys/kern/subr_syscall.c Mon Feb 6 10:23:11 2012 (r231071) +++ stable/8/sys/kern/subr_syscall.c Mon Feb 6 10:35:21 2012 (r231072) @@ -194,7 +194,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-8@FreeBSD.ORG Mon Feb 6 13:17:57 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67691065670; Mon, 6 Feb 2012 13:17:57 +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 9429B8FC1B; Mon, 6 Feb 2012 13:17: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 q16DHvIS037396; Mon, 6 Feb 2012 13:17:57 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DHvSL037395; Mon, 6 Feb 2012 13:17:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061317.q16DHvSL037395@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231083 - stable/8/tools/regression/bin/sh/builtins X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:17:57 -0000 Author: dumbbell Date: Mon Feb 6 13:17:57 2012 New Revision: 231083 URL: http://svn.freebsd.org/changeset/base/231083 Log: MFC r230211: sh: Test EXIT trap with multiple statements in it Reviewed by: jilles Added: stable/8/tools/regression/bin/sh/builtins/trap9.0 - copied unchanged from r230211, head/tools/regression/bin/sh/builtins/trap9.0 Modified: Directory Properties: stable/8/tools/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/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/8/tools/regression/bin/sh/builtins/trap9.0 Mon Feb 6 13:17:57 2012 (r231083, 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-8@FreeBSD.ORG Mon Feb 6 13:26:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B406106575F; Mon, 6 Feb 2012 13:26:13 +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 5F7D78FC18; Mon, 6 Feb 2012 13:26:13 +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 q16DQD9f037725; Mon, 6 Feb 2012 13:26:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DQDZv037721; Mon, 6 Feb 2012 13:26:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202061326.q16DQDZv037721@svn.freebsd.org> From: Christian Brueffer Date: Mon, 6 Feb 2012 13:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231084 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:26:13 -0000 Author: brueffer Date: Mon Feb 6 13:26:12 2012 New Revision: 231084 URL: http://svn.freebsd.org/changeset/base/231084 Log: MFC: r230787 Manpages for the buf_ring and drbr interfaces. Added: stable/8/share/man/man9/buf_ring.9 - copied unchanged from r230787, head/share/man/man9/buf_ring.9 stable/8/share/man/man9/drbr.9 - copied unchanged from r230787, head/share/man/man9/drbr.9 Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 6 13:17:57 2012 (r231083) +++ stable/8/share/man/man9/Makefile Mon Feb 6 13:26:12 2012 (r231084) @@ -13,6 +13,7 @@ MAN= accept_filter.9 \ boot.9 \ bpf.9 \ buf.9 \ + buf_ring.9 \ BUF_ISLOCKED.9 \ BUF_LOCK.9 \ BUF_LOCKFREE.9 \ @@ -100,6 +101,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 bpf_filter.9 \ bpf.9 bpfattach2.9 \ bpf.9 bpfdetach.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 @@ -605,6 +617,14 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 MLINKS+=DRIVER_MODULE.9 MULTI_DRIVER_MODULE.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/8/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/8/share/man/man9/buf_ring.9 Mon Feb 6 13:26:12 2012 (r231084, 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/8/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/8/share/man/man9/drbr.9 Mon Feb 6 13:26:12 2012 (r231084, 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-8@FreeBSD.ORG Mon Feb 6 13:36:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79184106564A; Mon, 6 Feb 2012 13:36:50 +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 660ED8FC16; Mon, 6 Feb 2012 13:36: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 q16DaonI038146; Mon, 6 Feb 2012 13:36:50 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Dao8R038140; Mon, 6 Feb 2012 13:36:50 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061336.q16Dao8R038140@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231086 - in stable/8: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:36:50 -0000 Author: dumbbell Date: Mon Feb 6 13:36:49 2012 New Revision: 231086 URL: http://svn.freebsd.org/changeset/base/231086 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/8/tools/regression/bin/sh/builtins/trap10.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap10.0 stable/8/tools/regression/bin/sh/builtins/trap11.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap11.0 Modified: stable/8/bin/sh/eval.c stable/8/bin/sh/eval.h stable/8/bin/sh/trap.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/eval.c ============================================================================== --- stable/8/bin/sh/eval.c Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/eval.c Mon Feb 6 13:36:49 2012 (r231086) @@ -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/8/bin/sh/eval.h ============================================================================== --- stable/8/bin/sh/eval.h Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/eval.h Mon Feb 6 13:36:49 2012 (r231086) @@ -69,6 +69,7 @@ int commandcmd(int, char **); #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/8/bin/sh/trap.c ============================================================================== --- stable/8/bin/sh/trap.c Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/trap.c Mon Feb 6 13:36:49 2012 (r231086) @@ -415,7 +415,7 @@ void dotrap(void) { int i; - int savestatus; + int savestatus, prev_evalskip, prev_skipcount; in_dotrap++; for (;;) { @@ -430,9 +430,35 @@ 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; + 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--; } @@ -485,6 +511,11 @@ exitshell(int status) } 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/8/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/8/tools/regression/bin/sh/builtins/trap10.0 Mon Feb 6 13:36:49 2012 (r231086, 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/8/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/8/tools/regression/bin/sh/builtins/trap11.0 Mon Feb 6 13:36:49 2012 (r231086, 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-8@FreeBSD.ORG Mon Feb 6 17:28:56 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EB72106566B; Mon, 6 Feb 2012 17:28:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EF78FC0A; Mon, 6 Feb 2012 17:28: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 q16HStwS046078; Mon, 6 Feb 2012 17:28:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16HStdM046076; Mon, 6 Feb 2012 17:28:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202061728.q16HStdM046076@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 6 Feb 2012 17:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231089 - stable/8/sys/fs/pseudofs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:28:56 -0000 Author: jh Date: Mon Feb 6 17:28:55 2012 New Revision: 231089 URL: http://svn.freebsd.org/changeset/base/231089 Log: MFC r229692: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) +++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:28:55 2012 (r231089) @@ -892,7 +892,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 6 18:47:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85771106567B; Mon, 6 Feb 2012 18:47:08 +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 73C7D8FC19; Mon, 6 Feb 2012 18:47: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 q16Il8w7048913; Mon, 6 Feb 2012 18:47:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Il8Gw048911; Mon, 6 Feb 2012 18:47:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061847.q16Il8Gw048911@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231097 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:47:08 -0000 Author: np Date: Mon Feb 6 18:47:07 2012 New Revision: 231097 URL: http://svn.freebsd.org/changeset/base/231097 Log: MFC r229714 Always release the inp lock before returning from tcp_detach. Modified: stable/8/sys/netinet/tcp_usrreq.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/8/sys/netinet/tcp_usrreq.c Mon Feb 6 18:46:49 2012 (r231096) +++ stable/8/sys/netinet/tcp_usrreq.c Mon Feb 6 18:47:07 2012 (r231097) @@ -202,8 +202,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-8@FreeBSD.ORG Mon Feb 6 21:23:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CB3B106566C; Mon, 6 Feb 2012 21:23:13 +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 09AE78FC12; Mon, 6 Feb 2012 21:23:13 +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 q16LNCmm054165; Mon, 6 Feb 2012 21:23:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LNCRQ054163; Mon, 6 Feb 2012 21:23:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202062123.q16LNCRQ054163@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 21:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:23:13 -0000 Author: np Date: Mon Feb 6 21:23:12 2012 New Revision: 231100 URL: http://svn.freebsd.org/changeset/base/231100 Log: MFC r222900 and r224768 r222900: cxgbetool: a tool for the cxgbe(4) driver. r224768: Move cxgbtool from usr.sbin to tools/tools. Added: stable/8/tools/tools/cxgbetool/ - copied from r222900, head/tools/tools/cxgbetool/ stable/8/tools/tools/cxgbtool/ - copied from r224768, head/tools/tools/cxgbtool/ Deleted: stable/8/usr.sbin/cxgbtool/ Modified: stable/8/tools/tools/README Directory Properties: stable/8/tools/tools/ (props changed) Modified: stable/8/tools/tools/README ============================================================================== --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool commitsdb A tool for reconstructing commit history using md5 checksums of the commit logs. crypto Test and exercise tools related to the crypto framework +cxgbetool A tool for the cxgbe(4) driver. +cxgbtool A tool for the cxgb(4) driver. diffburst OBSOLETE: equivalent functionality is available via split -p. For example: "split -p ^diff < patchfile". See split(1). editing Editor modes and the like to help editing FreeBSD code. From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 6 23:37:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1205) id 34D491065670; Mon, 6 Feb 2012 23:37:59 +0000 (UTC) Date: Mon, 6 Feb 2012 23:37:59 +0000 From: Navdeep Parhar To: Jason Hellenthal Message-ID: <20120206233759.GA63556@hub.freebsd.org> Mail-Followup-To: Jason Hellenthal , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org References: <201202062123.q16LNCRQ054163@svn.freebsd.org> <20120206233104.GA26403@DataIX.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120206233104.GA26403@DataIX.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 23:37:59 -0000 On Mon, Feb 06, 2012 at 06:31:05PM -0500, Jason Hellenthal wrote: > > Was this intentional ? cxgbtool to -> cxgbetool ? This could cause quite > the confusion. Two drivers, two tools: cxgbtool for cxgb(4), cxgbetool for cxgbe(4). This has always been the case. I just MFC'd the newer tool to 8 and moved the older tool to tools/tools too. Regards, Navdeep > > On Mon, Feb 06, 2012 at 09:23:12PM +0000, Navdeep Parhar wrote: > > Author: np > > Date: Mon Feb 6 21:23:12 2012 > > New Revision: 231100 > > URL: http://svn.freebsd.org/changeset/base/231100 > > > > Log: > > MFC r222900 and r224768 > > > > r222900: > > cxgbetool: a tool for the cxgbe(4) driver. > > > > r224768: > > Move cxgbtool from usr.sbin to tools/tools. > > > > Added: > > stable/8/tools/tools/cxgbetool/ > > - copied from r222900, head/tools/tools/cxgbetool/ > > stable/8/tools/tools/cxgbtool/ > > - copied from r224768, head/tools/tools/cxgbtool/ > > Deleted: > > stable/8/usr.sbin/cxgbtool/ > > Modified: > > stable/8/tools/tools/README > > Directory Properties: > > stable/8/tools/tools/ (props changed) > > > > Modified: stable/8/tools/tools/README > > ============================================================================== > > --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) > > +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) > > @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool > > commitsdb A tool for reconstructing commit history using md5 > > checksums of the commit logs. > > crypto Test and exercise tools related to the crypto framework > > +cxgbetool A tool for the cxgbe(4) driver. > > +cxgbtool A tool for the cxgb(4) driver. > > diffburst OBSOLETE: equivalent functionality is available via split -p. > > For example: "split -p ^diff < patchfile". See split(1). > > editing Editor modes and the like to help editing FreeBSD code. > > _______________________________________________ > > svn-src-stable-8@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" > > -- > ;s =; From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 6 23:57:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64F71065673; Mon, 6 Feb 2012 23:57:03 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 59BF78FC18; Mon, 6 Feb 2012 23:57:03 +0000 (UTC) Received: by iaeo4 with SMTP id o4so13756963iae.13 for ; Mon, 06 Feb 2012 15:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=y1FPBIyRIhLf4JppPPXkEjRVaAzdUj9wjMWA6bv58/o=; b=o1Jjtl7gzlxzaJSsXz5jV8bEu1Z2SKb0S1HfQCqeydy4d5eFKSKxLixVYGzdpN5A0R 4BZpguqUaRiOrPrgaPTf8hGfodNMYMtBCGufpK0quum0vXruzIaMVbfCGjvFUIkbdGHB Wt00oGR//8mrUhvZ1cLDg0amulD4E1Vy0xeSY= Received: by 10.42.28.131 with SMTP id n3mr7124601icc.38.1328571070910; Mon, 06 Feb 2012 15:31:10 -0800 (PST) Received: from DataIX.net (adsl-99-181-135-57.dsl.klmzmi.sbcglobal.net. [99.181.135.57]) by mx.google.com with ESMTPS id wn7sm1657302igc.0.2012.02.06.15.31.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 15:31:09 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q16NV5Fl089054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Feb 2012 18:31:06 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q16NV5si087536; Mon, 6 Feb 2012 18:31:05 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Mon, 6 Feb 2012 18:31:05 -0500 From: Jason Hellenthal To: Navdeep Parhar Message-ID: <20120206233104.GA26403@DataIX.net> References: <201202062123.q16LNCRQ054163@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202062123.q16LNCRQ054163@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 23:57:04 -0000 Was this intentional ? cxgbtool to -> cxgbetool ? This could cause quite the confusion. On Mon, Feb 06, 2012 at 09:23:12PM +0000, Navdeep Parhar wrote: > Author: np > Date: Mon Feb 6 21:23:12 2012 > New Revision: 231100 > URL: http://svn.freebsd.org/changeset/base/231100 > > Log: > MFC r222900 and r224768 > > r222900: > cxgbetool: a tool for the cxgbe(4) driver. > > r224768: > Move cxgbtool from usr.sbin to tools/tools. > > Added: > stable/8/tools/tools/cxgbetool/ > - copied from r222900, head/tools/tools/cxgbetool/ > stable/8/tools/tools/cxgbtool/ > - copied from r224768, head/tools/tools/cxgbtool/ > Deleted: > stable/8/usr.sbin/cxgbtool/ > Modified: > stable/8/tools/tools/README > Directory Properties: > stable/8/tools/tools/ (props changed) > > Modified: stable/8/tools/tools/README > ============================================================================== > --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) > +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) > @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool > commitsdb A tool for reconstructing commit history using md5 > checksums of the commit logs. > crypto Test and exercise tools related to the crypto framework > +cxgbetool A tool for the cxgbe(4) driver. > +cxgbtool A tool for the cxgb(4) driver. > diffburst OBSOLETE: equivalent functionality is available via split -p. > For example: "split -p ^diff < patchfile". See split(1). > editing Editor modes and the like to help editing FreeBSD code. > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- ;s =; From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 7 01:26:30 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084FE106566B; Tue, 7 Feb 2012 01:26:30 +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 E352A8FC0C; Tue, 7 Feb 2012 01:26: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 q171QTCG062359; Tue, 7 Feb 2012 01:26:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q171QT7C062353; Tue, 7 Feb 2012 01:26:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070126.q171QT7C062353@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 01:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231103 - in stable/8: 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 01:26:30 -0000 Author: np Date: Tue Feb 7 01:26:29 2012 New Revision: 231103 URL: http://svn.freebsd.org/changeset/base/231103 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/8/sys/dev/cxgbe/firmware/ - copied from r228561, head/sys/dev/cxgbe/firmware/ stable/8/sys/modules/cxgbe/firmware/ - copied from r228561, head/sys/modules/cxgbe/firmware/ Deleted: stable/8/sys/dev/cxgbe/common/t4fw_interface.h Modified: stable/8/share/man/man4/cxgbe.4 stable/8/sys/dev/cxgbe/adapter.h stable/8/sys/dev/cxgbe/common/common.h stable/8/sys/dev/cxgbe/common/t4_hw.c stable/8/sys/dev/cxgbe/common/t4_hw.h stable/8/sys/dev/cxgbe/offload.h stable/8/sys/dev/cxgbe/osdep.h stable/8/sys/dev/cxgbe/t4_ioctl.h stable/8/sys/dev/cxgbe/t4_l2t.c stable/8/sys/dev/cxgbe/t4_l2t.h stable/8/sys/dev/cxgbe/t4_main.c stable/8/sys/dev/cxgbe/t4_sge.c stable/8/sys/modules/cxgbe/Makefile stable/8/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/tools/tools/ (props changed) Modified: stable/8/share/man/man4/cxgbe.4 ============================================================================== --- stable/8/share/man/man4/cxgbe.4 Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/share/man/man4/cxgbe.4 Tue Feb 7 01:26:29 2012 (r231103) @@ -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/8/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/8/sys/dev/cxgbe/adapter.h Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/adapter.h Tue Feb 7 01:26:29 2012 (r231103) @@ -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); @@ -70,8 +72,9 @@ prefetch(void *x) #define CTLTYPE_U64 CTLTYPE_QUAD #endif -#if __FreeBSD_version >= 802507 -#define T4_DEVLOG 1 +#if (__FreeBSD_version >= 900030) || \ + ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000)) +#define SBUF_DRAIN 1 #endif #ifdef __amd64__ @@ -120,25 +123,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 }; @@ -154,13 +153,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) @@ -196,6 +198,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; @@ -204,11 +212,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 */ }; @@ -232,17 +237,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, @@ -262,26 +276,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 */ }; /* @@ -291,10 +314,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 */ @@ -307,9 +331,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; @@ -317,6 +356,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 */ @@ -327,8 +367,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 */ @@ -340,14 +382,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 */ @@ -364,20 +400,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 @@ -391,12 +421,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 */ @@ -404,20 +450,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; @@ -425,7 +479,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; @@ -454,27 +513,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) @@ -516,11 +595,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) @@ -599,29 +682,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/8/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/8/sys/dev/cxgbe/common/common.h Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/common/common.h Tue Feb 7 01:26:29 2012 (r231103) @@ -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/8/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/8/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/common/t4_hw.c Tue Feb 7 01:26:29 2012 (r231103) @@ -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); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 7 02:21:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D39D106567A; Tue, 7 Feb 2012 02:21:47 +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 37F6F8FC1E; Tue, 7 Feb 2012 02:21: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 q172Ll78064098; Tue, 7 Feb 2012 02:21:47 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172Llqu064096; Tue, 7 Feb 2012 02:21:47 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070221.q172Llqu064096@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 02:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231105 - stable/8/sys/dev/cxgb/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:21:47 -0000 Author: np Date: Tue Feb 7 02:21:46 2012 New Revision: 231105 URL: http://svn.freebsd.org/changeset/base/231105 Log: MFC r228825: Fix return value of function. Modified: stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/cxgb/common/cxgb_aq100x.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:17 2012 (r231104) +++ stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:46 2012 (r231105) @@ -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-8@FreeBSD.ORG Tue Feb 7 03:15:12 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 918D91065673; Tue, 7 Feb 2012 03:15:12 +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 7C10C8FC0C; Tue, 7 Feb 2012 03:15:12 +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 q173FCZl066133; Tue, 7 Feb 2012 03:15:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173FCSv066131; Tue, 7 Feb 2012 03:15:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070315.q173FCSv066131@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231107 - stable/8/usr.bin/vmstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:15:12 -0000 Author: emaste Date: Tue Feb 7 03:15:12 2012 New Revision: 231107 URL: http://svn.freebsd.org/changeset/base/231107 Log: MFC r219708: Reemove uptime validity check that hasn't been necessary since r151417 switched to clock_gettime. vmstat will now not exit with an error if run on a system with 10 years of uptime. Modified: stable/8/usr.bin/vmstat/vmstat.c Directory Properties: stable/8/usr.bin/vmstat/ (props changed) Modified: stable/8/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/8/usr.bin/vmstat/vmstat.c Tue Feb 7 02:57:36 2012 (r231106) +++ stable/8/usr.bin/vmstat/vmstat.c Tue Feb 7 03:15:12 2012 (r231107) @@ -408,14 +408,10 @@ static long getuptime(void) { struct timespec sp; - time_t uptime; (void)clock_gettime(CLOCK_MONOTONIC, &sp); - uptime = sp.tv_sec; - if (uptime <= 0 || uptime > 60*60*24*365*10) - errx(1, "time makes no sense; namelist must be wrong"); - return(uptime); + return(sp.tv_sec); } static void From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 7 03:37:29 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B22D106567D; Tue, 7 Feb 2012 03:37:29 +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 5B4E48FC0A; Tue, 7 Feb 2012 03:37: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 q173bTRl066896; Tue, 7 Feb 2012 03:37:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173bTTD066894; Tue, 7 Feb 2012 03:37:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070337.q173bTTD066894@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231109 - stable/8/usr.sbin/pkg_install/info X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:37:29 -0000 Author: emaste Date: Tue Feb 7 03:37:29 2012 New Revision: 231109 URL: http://svn.freebsd.org/changeset/base/231109 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/8/usr.sbin/pkg_install/info/show.c Directory Properties: stable/8/usr.sbin/pkg_install/info/ (props changed) Modified: stable/8/usr.sbin/pkg_install/info/show.c ============================================================================== --- stable/8/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:34:57 2012 (r231108) +++ stable/8/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:37:29 2012 (r231109) @@ -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-8@FreeBSD.ORG Tue Feb 7 04:06:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B50106566C; Tue, 7 Feb 2012 04:06:21 +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 701EC8FC12; Tue, 7 Feb 2012 04:06: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 q1746Lrn067983; Tue, 7 Feb 2012 04:06:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1746Lm3067981; Tue, 7 Feb 2012 04:06:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070406.q1746Lm3067981@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 04:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231113 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:06:21 -0000 Author: emaste Date: Tue Feb 7 04:06:21 2012 New Revision: 231113 URL: http://svn.freebsd.org/changeset/base/231113 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/8/usr.sbin/mfiutil/mfi_config.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:03:39 2012 (r231112) +++ stable/8/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:06:21 2012 (r231113) @@ -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-8@FreeBSD.ORG Tue Feb 7 07:56:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293B01065670; Tue, 7 Feb 2012 07:56: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 114E88FC0A; Tue, 7 Feb 2012 07:56: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 q177u06v075351; Tue, 7 Feb 2012 07:56:00 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q177u0LJ075349; Tue, 7 Feb 2012 07:56:00 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070756.q177u0LJ075349@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 07:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231117 - stable/8/tools/tools/cxgbetool X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 07:56:01 -0000 Author: np Date: Tue Feb 7 07:56:00 2012 New Revision: 231117 URL: http://svn.freebsd.org/changeset/base/231117 Log: MFC r222974: Add "context" subcommand to fetch and display SGE context. Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/8/tools/tools/ (props changed) Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/8/tools/tools/cxgbetool/cxgbetool.c Tue Feb 7 07:32:39 2012 (r231116) +++ stable/8/tools/tools/cxgbetool/cxgbetool.c Tue Feb 7 07:56:00 2012 (r231117) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define max(x, y) ((x) > (y) ? (x) : (y)) + static const char *progname, *nexus; struct reg_info { @@ -62,6 +64,15 @@ struct mod_regs { const struct reg_info *ri; }; +struct field_desc { + const char *name; /* Field name */ + unsigned short start; /* Start bit position */ + unsigned short end; /* End bit position */ + unsigned char shift; /* # of low order bits omitted and implicitly 0 */ + unsigned char hex; /* Print field in hex instead of decimal */ + unsigned char islog2; /* Field contains the base-2 log of the value */ +}; + #include "reg_defs_t4.c" #include "reg_defs_t4vf.c" @@ -70,6 +81,7 @@ usage(FILE *fp) { fprintf(fp, "Usage: %s [operation]\n", progname); fprintf(fp, + "\tcontext show an SGE context\n" "\tfilter [ ] ... set a filter\n" "\tfilter delete|clear delete a filter\n" "\tfilter list list all filters\n" @@ -1125,6 +1137,227 @@ filter_cmd(int argc, const char *argv[]) return set_filter(idx, argc - 1, argv + 1); } +/* + * Shows the fields of a multi-word structure. The structure is considered to + * consist of @nwords 32-bit words (i.e, it's an (@nwords * 32)-bit structure) + * whose fields are described by @fd. The 32-bit words are given in @words + * starting with the least significant 32-bit word. + */ +static void +show_struct(const uint32_t *words, int nwords, const struct field_desc *fd) +{ + unsigned int w = 0; + const struct field_desc *p; + + for (p = fd; p->name; p++) + w = max(w, strlen(p->name)); + + while (fd->name) { + unsigned long long data; + int first_word = fd->start / 32; + int shift = fd->start % 32; + int width = fd->end - fd->start + 1; + unsigned long long mask = (1ULL << width) - 1; + + data = (words[first_word] >> shift) | + ((uint64_t)words[first_word + 1] << (32 - shift)); + if (shift) + data |= ((uint64_t)words[first_word + 2] << (64 - shift)); + data &= mask; + if (fd->islog2) + data = 1 << data; + printf("%-*s ", w, fd->name); + printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift); + fd++; + } +} + +#define FIELD(name, start, end) { name, start, end, 0, 0, 0 } +#define FIELD1(name, start) FIELD(name, start, start) + +static void +show_sge_context(const struct t4_sge_context *p) +{ + static struct field_desc egress[] = { + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("DCAEgrQEn:", 173), + FIELD("DCACPUID:", 168, 172), + FIELD1("FCThreshOverride:", 167), + FIELD("WRLength:", 162, 166), + FIELD1("WRLengthKnown:", 161), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + { "FetchBurstMax:", 153, 154, 6, 0, 1 }, + FIELD("uPToken:", 133, 152), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc fl[] = { + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("DCAEgrQEn:", 173), + FIELD("DCACPUID:", 168, 172), + FIELD1("FCThreshOverride:", 167), + FIELD("WRLength:", 162, 166), + FIELD1("WRLengthKnown:", 161), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + { "FetchBurstMax:", 153, 154, 6, 0, 1 }, + FIELD1("FLMcongMode:", 152), + FIELD("MaxuPFLCredits:", 144, 151), + FIELD("FLMcontextID:", 133, 143), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc ingress[] = { + FIELD1("NoSnoop:", 145), + FIELD1("RelaxedOrdering:", 144), + FIELD1("GTSmode:", 143), + FIELD1("ISCSICoalescing:", 142), + FIELD1("Valid:", 141), + FIELD1("TimerPending:", 140), + FIELD1("DropRSS:", 139), + FIELD("PCIeChannel:", 137, 138), + FIELD1("SEInterruptArmed:", 136), + FIELD1("CongestionMgtEnable:", 135), + FIELD1("DCAIngQEnable:", 134), + FIELD("DCACPUID:", 129, 133), + FIELD1("UpdateScheduling:", 128), + FIELD("UpdateDelivery:", 126, 127), + FIELD1("InterruptSent:", 125), + FIELD("InterruptIDX:", 114, 124), + FIELD1("InterruptDestination:", 113), + FIELD1("InterruptArmed:", 112), + FIELD("RxIntCounter:", 106, 111), + FIELD("RxIntCounterThreshold:", 104, 105), + FIELD1("Generation:", 103), + { "BaseAddress:", 48, 102, 9, 1 }, + FIELD("PIDX:", 32, 47), + FIELD("CIDX:", 16, 31), + { "QueueSize:", 4, 15, 4, 0 }, + { "QueueEntrySize:", 2, 3, 4, 0, 1 }, + FIELD1("QueueEntryOverride:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc flm[] = { + FIELD1("NoSnoop:", 79), + FIELD1("RelaxedOrdering:", 78), + FIELD1("Valid:", 77), + FIELD("DCACPUID:", 72, 76), + FIELD1("DCAFLEn:", 71), + FIELD("EQid:", 54, 70), + FIELD("SplitEn:", 52, 53), + FIELD1("PadEn:", 51), + FIELD1("PackEn:", 50), + FIELD1("DBpriority:", 48), + FIELD("PackOffset:", 16, 47), + FIELD("CIDX:", 8, 15), + FIELD("PIDX:", 0, 7), + { NULL } + }; + static struct field_desc conm[] = { + FIELD1("CngDBPHdr:", 6), + FIELD1("CngDBPData:", 5), + FIELD1("CngIMSG:", 4), + FIELD("CngChMap:", 0, 3), + { NULL } + }; + + if (p->mem_id == SGE_CONTEXT_EGRESS) + show_struct(p->data, 6, (p->data[0] & 2) ? fl : egress); + else if (p->mem_id == SGE_CONTEXT_FLM) + show_struct(p->data, 3, flm); + else if (p->mem_id == SGE_CONTEXT_INGRESS) + show_struct(p->data, 5, ingress); + else if (p->mem_id == SGE_CONTEXT_CNM) + show_struct(p->data, 1, conm); +} + +#undef FIELD +#undef FIELD1 + +static int +get_sge_context(int argc, const char *argv[]) +{ + int rc; + char *p; + long cid; + struct t4_sge_context cntxt = {0}; + + if (argc != 2) { + warnx("sge_context: incorrect number of arguments."); + return (EINVAL); + } + + if (!strcmp(argv[0], "egress")) + cntxt.mem_id = SGE_CONTEXT_EGRESS; + else if (!strcmp(argv[0], "ingress")) + cntxt.mem_id = SGE_CONTEXT_INGRESS; + else if (!strcmp(argv[0], "fl")) + cntxt.mem_id = SGE_CONTEXT_FLM; + else if (!strcmp(argv[0], "cong")) + cntxt.mem_id = SGE_CONTEXT_CNM; + else { + warnx("unknown context type \"%s\"; known types are egress, " + "ingress, fl, and cong.", argv[0]); + return (EINVAL); + } + + p = str_to_number(argv[1], &cid, NULL); + if (*p) { + warnx("invalid context id \"%s\"", argv[1]); + return (EINVAL); + } + cntxt.cid = cid; + + rc = doit(CHELSIO_T4_GET_SGE_CONTEXT, &cntxt); + if (rc != 0) + return (rc); + + show_sge_context(&cntxt); + return (0); +} + static int loadfw(int argc, const char *argv[]) { @@ -1306,6 +1539,8 @@ run_cmd(int argc, const char *argv[]) rc = dump_regs(argc, argv); else if (!strcmp(cmd, "filter")) rc = filter_cmd(argc, argv); + else if (!strcmp(cmd, "context")) + rc = get_sge_context(argc, argv); else if (!strcmp(cmd, "loadfw")) rc = loadfw(argc, argv); else if (!strcmp(cmd, "memdump")) From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 7 09:40:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 911981065676; Tue, 7 Feb 2012 09:40:23 +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 7AF0E8FC12; Tue, 7 Feb 2012 09:40: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 q179eNXD078783; Tue, 7 Feb 2012 09:40:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179eNcF078781; Tue, 7 Feb 2012 09:40:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070940.q179eNcF078781@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231121 - stable/8/usr.sbin/boot0cfg X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:40:23 -0000 Author: kib Date: Tue Feb 7 09:40:22 2012 New Revision: 231121 URL: http://svn.freebsd.org/changeset/base/231121 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/8/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/8/usr.sbin/boot0cfg/ (props changed) Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/8/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:39:46 2012 (r231120) +++ stable/8/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:40:22 2012 (r231121) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.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 @@ -187,9 +190,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-8@FreeBSD.ORG Tue Feb 7 15:50:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45ADD1065670; Tue, 7 Feb 2012 15:50:15 +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 32B918FC15; Tue, 7 Feb 2012 15:50: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 q17FoF0i096004; Tue, 7 Feb 2012 15:50:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17FoE4r096000; Tue, 7 Feb 2012 15:50:14 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202071550.q17FoE4r096000@svn.freebsd.org> From: Olivier Houchard Date: Tue, 7 Feb 2012 15:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231131 - in stable/8/sys/arm: arm include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:50:15 -0000 Author: cognet Date: Tue Feb 7 15:50:14 2012 New Revision: 231131 URL: http://svn.freebsd.org/changeset/base/231131 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-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF50106564A; Tue, 7 Feb 2012 17:47:04 +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 9DF778FC16; Tue, 7 Feb 2012 17:47: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 q17Hl4H3000213; Tue, 7 Feb 2012 17:47:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hl4qK000211; Tue, 7 Feb 2012 17:47:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071747.q17Hl4qK000211@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231139 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:47:04 -0000 Author: mm Date: Tue Feb 7 17:47:04 2012 New Revision: 231139 URL: http://svn.freebsd.org/changeset/base/231139 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/8/usr.sbin/jail/jail.c Directory Properties: stable/8/usr.sbin/jail/ (props changed) Modified: stable/8/usr.sbin/jail/jail.c ============================================================================== --- stable/8/usr.sbin/jail/jail.c Tue Feb 7 17:46:02 2012 (r231138) +++ stable/8/usr.sbin/jail/jail.c Tue Feb 7 17:47:04 2012 (r231139) @@ -500,6 +500,7 @@ static void set_param(const char *name, char *value) { struct jailparam *param; + char path[PATH_MAX]; int i; static int paramlistsize; @@ -512,8 +513,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-8@FreeBSD.ORG Tue Feb 7 17:58:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64208106566C; Tue, 7 Feb 2012 17:58:00 +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 4EC698FC08; Tue, 7 Feb 2012 17:58: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 q17Hw0nA000743; Tue, 7 Feb 2012 17:58:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hw0bJ000733; Tue, 7 Feb 2012 17:58:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071758.q17Hw0bJ000733@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231142 - in stable/8: 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:58:00 -0000 Author: mm Date: Tue Feb 7 17:57:59 2012 New Revision: 231142 URL: http://svn.freebsd.org/changeset/base/231142 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/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:59 2012 (r231142) @@ -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-8@FreeBSD.ORG Tue Feb 7 19:12:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF937106566C; Tue, 7 Feb 2012 19:12: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 ACB7C8FC20; Tue, 7 Feb 2012 19:12: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 q17JCLVY003271; Tue, 7 Feb 2012 19:12:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JCL69003263; Tue, 7 Feb 2012 19:12:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071912.q17JCL69003263@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231146 - in stable/8/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:12:21 -0000 Author: jhb Date: Tue Feb 7 19:12:21 2012 New Revision: 231146 URL: http://svn.freebsd.org/changeset/base/231146 Log: MFC 228957: Implement linux_fadvise64() and linux_fadvise64_64() using kern_posix_fadvise(). Modified: stable/8/sys/amd64/linux32/linux.h stable/8/sys/amd64/linux32/linux32_dummy.c stable/8/sys/amd64/linux32/syscalls.master stable/8/sys/compat/linux/linux_file.c stable/8/sys/i386/linux/linux.h stable/8/sys/i386/linux/linux_dummy.c stable/8/sys/i386/linux/syscalls.master Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/amd64/linux32/linux.h ============================================================================== --- stable/8/sys/amd64/linux32/linux.h Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/linux.h Tue Feb 7 19:12:21 2012 (r231146) @@ -594,6 +594,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/8/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:12:21 2012 (r231146) @@ -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/8/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/8/sys/amd64/linux32/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/syscalls.master Tue Feb 7 19:12:21 2012 (r231146) @@ -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/8/sys/compat/linux/linux_file.c ============================================================================== --- stable/8/sys/compat/linux/linux_file.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/compat/linux/linux_file.c Tue Feb 7 19:12:21 2012 (r231146) @@ -1533,3 +1533,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/8/sys/i386/linux/linux.h ============================================================================== --- stable/8/sys/i386/linux/linux.h Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/linux.h Tue Feb 7 19:12:21 2012 (r231146) @@ -570,6 +570,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/8/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/8/sys/i386/linux/linux_dummy.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/linux_dummy.c Tue Feb 7 19:12:21 2012 (r231146) @@ -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/8/sys/i386/linux/syscalls.master ============================================================================== --- stable/8/sys/i386/linux/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/syscalls.master Tue Feb 7 19:12:21 2012 (r231146) @@ -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-8@FreeBSD.ORG Tue Feb 7 19:13:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A71810657D2; Tue, 7 Feb 2012 19:13:48 +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 4728A8FC14; Tue, 7 Feb 2012 19:13: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 q17JDmm4003399; Tue, 7 Feb 2012 19:13:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JDmgQ003388; Tue, 7 Feb 2012 19:13:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071913.q17JDmgQ003388@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231148 - in stable/8/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:13:48 -0000 Author: jhb Date: Tue Feb 7 19:13:47 2012 New Revision: 231148 URL: http://svn.freebsd.org/changeset/base/231148 Log: Regen. Modified: stable/8/sys/amd64/linux32/linux32_proto.h stable/8/sys/amd64/linux32/linux32_syscall.h stable/8/sys/amd64/linux32/linux32_syscalls.c stable/8/sys/amd64/linux32/linux32_sysent.c stable/8/sys/amd64/linux32/linux32_systrace_args.c stable/8/sys/i386/linux/linux_proto.h stable/8/sys/i386/linux/linux_syscall.h stable/8/sys/i386/linux/linux_syscalls.c stable/8/sys/i386/linux/linux_sysent.c stable/8/sys/i386/linux/linux_systrace_args.c Modified: stable/8/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z 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/8/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/8/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ const char *linux_syscallnames[] = { Modified: stable/8/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #include "opt_compat.h" @@ -269,7 +269,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ @@ -291,7 +291,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ Modified: stable/8/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:47 2012 (r231148) @@ -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/8/sys/i386/linux/linux_proto.h ============================================================================== --- stable/8/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z 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/8/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/8/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/8/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/8/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ const char *linux_syscallnames[] = { Modified: stable/8/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/8/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #include @@ -268,7 +268,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ @@ -290,7 +290,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ Modified: stable/8/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/8/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:47 2012 (r231148) @@ -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-8@FreeBSD.ORG Tue Feb 7 19:23:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15601065674; Tue, 7 Feb 2012 19:23:31 +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 B5E638FC1C; Tue, 7 Feb 2012 19:23: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 q17JNVLI003841; Tue, 7 Feb 2012 19:23:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JNVQZ003838; Tue, 7 Feb 2012 19:23:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071923.q17JNVQZ003838@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231151 - in stable/8/sys: i386/i386 mips/mips X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:23:32 -0000 Author: jhb Date: Tue Feb 7 19:23:31 2012 New Revision: 231151 URL: http://svn.freebsd.org/changeset/base/231151 Log: MFC 228962: Use curthread rather than PCPU_GET(curthread). 'curthread' uses special-case optimizations on several platforms and is preferred. Modified: stable/8/sys/i386/i386/sys_machdep.c stable/8/sys/mips/mips/gdb_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/8/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:08 2012 (r231150) +++ stable/8/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:31 2012 (r231151) @@ -522,7 +522,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/8/sys/mips/mips/gdb_machdep.c ============================================================================== --- stable/8/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:08 2012 (r231150) +++ stable/8/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:31 2012 (r231151) @@ -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-8@FreeBSD.ORG Tue Feb 7 19:41:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB221065672; Tue, 7 Feb 2012 19:41: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 9988F8FC13; Tue, 7 Feb 2012 19:41: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 q17JfLax004503; Tue, 7 Feb 2012 19:41:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JfLmq004500; Tue, 7 Feb 2012 19:41:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071941.q17JfLmq004500@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231154 - stable/8/sys/dev/ichwd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:41:21 -0000 Author: jhb Date: Tue Feb 7 19:41:21 2012 New Revision: 231154 URL: http://svn.freebsd.org/changeset/base/231154 Log: MFC 229598: Remove use of explicit bus space tags and handles and use methods that operate on resource objects instead. Modified: stable/8/sys/dev/ichwd/ichwd.c stable/8/sys/dev/ichwd/ichwd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.c Tue Feb 7 19:40:52 2012 (r231153) +++ stable/8/sys/dev/ichwd/ichwd.c Tue Feb 7 19:41:21 2012 (r231154) @@ -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/8/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.h Tue Feb 7 19:40:52 2012 (r231153) +++ stable/8/sys/dev/ichwd/ichwd.h Tue Feb 7 19:41:21 2012 (r231154) @@ -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-8@FreeBSD.ORG Tue Feb 7 19:45:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7938F106566B; Tue, 7 Feb 2012 19:45:16 +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 65B278FC08; Tue, 7 Feb 2012 19:45:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17JjG8e004679; Tue, 7 Feb 2012 19:45:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JjGcT004678; Tue, 7 Feb 2012 19:45:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071945.q17JjGcT004678@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231155 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/e1000 modules/sound/driver/emu10k1 modules/sound/driver/emu10kx X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:45:16 -0000 Author: jhb Date: Tue Feb 7 19:45:15 2012 New Revision: 231155 URL: http://svn.freebsd.org/changeset/base/231155 Log: Hoist mergeinfo for modules/sound/driver/* up to sys/. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 7 19:56:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5E1106567A; Tue, 7 Feb 2012 19:56:23 +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 38B158FC2F; Tue, 7 Feb 2012 19:56: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 q17JuNmn005153; Tue, 7 Feb 2012 19:56:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JuNaa005151; Tue, 7 Feb 2012 19:56:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071956.q17JuNaa005151@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231158 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:56:23 -0000 Author: jhb Date: Tue Feb 7 19:56:22 2012 New Revision: 231158 URL: http://svn.freebsd.org/changeset/base/231158 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/8/sys/net/if_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Tue Feb 7 19:55:58 2012 (r231157) +++ stable/8/sys/net/if_var.h Tue Feb 7 19:56:22 2012 (r231158) @@ -249,9 +249,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-8@FreeBSD.ORG Tue Feb 7 21:56:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61A71065670; 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 99A1D8FC12; 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 q17LuxuX009065; 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 q17Luxj2009063; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072156.q17Luxj2009063@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-8@freebsd.org X-SVN-Group: stable-8 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-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/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/9/sbin/newfs_msdos/ (props changed) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 20:54:44 2012 (r231161) +++ stable/8/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-8@FreeBSD.ORG Tue Feb 7 22:13:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9461065670; 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 2BA8C8FC16; Tue, 7 Feb 2012 22:13: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 q17MDYuh009687; Tue, 7 Feb 2012 22:13:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDXHL009685; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072213.q17MDXHL009685@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-8@freebsd.org X-SVN-Group: stable-8 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-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-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/8/usr.bin/newgrp/newgrp.c Directory Properties: stable/8/usr.bin/newgrp/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.bin/newgrp/newgrp.c Directory Properties: stable/9/usr.bin/newgrp/ (props changed) Modified: stable/8/usr.bin/newgrp/newgrp.c ============================================================================== --- stable/8/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:24 2012 (r231163) +++ stable/8/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-8@FreeBSD.ORG Tue Feb 7 22:13:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD815106566C; Tue, 7 Feb 2012 22:13:54 +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 BC2418FC13; Tue, 7 Feb 2012 22:13: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 q17MDsfH009767; Tue, 7 Feb 2012 22:13:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDsql009765; Tue, 7 Feb 2012 22:13:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202072213.q17MDsql009765@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 22:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231166 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:54 -0000 Author: jhb Date: Tue Feb 7 22:13:54 2012 New Revision: 231166 URL: http://svn.freebsd.org/changeset/base/231166 Log: MFC 229465: Use correct locking when traversing interface address list. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Feb 7 22:13:38 2012 (r231165) +++ stable/8/sys/netinet6/in6.c Tue Feb 7 22:13:54 2012 (r231166) @@ -2128,9 +2128,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; @@ -2148,10 +2146,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-8@FreeBSD.ORG Tue Feb 7 22:31:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44762106564A; Tue, 7 Feb 2012 22:31:17 +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 3285D8FC12; Tue, 7 Feb 2012 22:31: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 q17MVHJh010418; Tue, 7 Feb 2012 22:31:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MVHd5010416; Tue, 7 Feb 2012 22:31:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072231.q17MVHd5010416@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 22:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231167 - stable/8/contrib/smbfs/mount_smbfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:31:17 -0000 Author: delphij Date: Tue Feb 7 22:31:16 2012 New Revision: 231167 URL: http://svn.freebsd.org/changeset/base/231167 Log: MFC r225643,225644: Change the example of using smbfs in fstab to a password-less one, which is less likely to block a remote system from boot. Submitted by: Garrett Cooper PR: doc/160775 Modified: stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Directory Properties: stable/8/contrib/smbfs/ (props changed) Modified: stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 ============================================================================== --- stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Tue Feb 7 22:13:54 2012 (r231166) +++ stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Tue Feb 7 22:31:16 2012 (r231167) @@ -1,6 +1,6 @@ .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $ .\" $FreeBSD$ -.Dd January 21, 2008 +.Dd September 17, 2011 .Dt MOUNT_SMBFS 8 .Os .Sh NAME @@ -157,11 +157,11 @@ mount_smbfs -I samba.mydomain.com //gues mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp .Ed .Pp -It is possible to use +It is also possible to use .Xr fstab 5 -for smbfs mounts: +for smbfs mounts (the example below doesn't prompt for a password): .Pp -.Dl "//guest@samba/public /smb/public smbfs rw,noauto 0 0" +.Dl "//guest@samba/public /smb/public smbfs rw,noauto,-N 0 0" .Sh AUTHORS .An Boris Popov Aq bp@butya.kz , .Aq bp@FreeBSD.org From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 04:47:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17A3C10656DC; Wed, 8 Feb 2012 04:47:07 +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 011548FC0C; Wed, 8 Feb 2012 04:47: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 q184l6xJ022696; Wed, 8 Feb 2012 04:47:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q184l6QS022694; Wed, 8 Feb 2012 04:47:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080447.q184l6QS022694@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231179 - stable/8/sys/ia64/ia64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:47:07 -0000 Author: marcel Date: Wed Feb 8 04:47:06 2012 New Revision: 231179 URL: http://svn.freebsd.org/changeset/base/231179 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/8/sys/ia64/ia64/vm_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/ia64/ia64/vm_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:40:14 2012 (r231178) +++ stable/8/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:47:06 2012 (r231179) @@ -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-8@FreeBSD.ORG Wed Feb 8 07:31:55 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E741065670; Wed, 8 Feb 2012 07:31:55 +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 8D3458FC1A; Wed, 8 Feb 2012 07:31: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 q187VtYO028235; Wed, 8 Feb 2012 07:31:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q187VtNb028233; Wed, 8 Feb 2012 07:31:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202080731.q187VtNb028233@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Feb 2012 07:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231189 - stable/8/sys/vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 07:31:55 -0000 Author: mav Date: Wed Feb 8 07:31:55 2012 New Revision: 231189 URL: http://svn.freebsd.org/changeset/base/231189 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/8/sys/vm/swap_pager.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/swap_pager.c ============================================================================== --- stable/8/sys/vm/swap_pager.c Wed Feb 8 07:30:48 2012 (r231188) +++ stable/8/sys/vm/swap_pager.c Wed Feb 8 07:31:55 2012 (r231189) @@ -2484,7 +2484,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-8@FreeBSD.ORG Wed Feb 8 15:19:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67C4106566B; Wed, 8 Feb 2012 15:19:49 +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 94A038FC14; Wed, 8 Feb 2012 15:19:49 +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 q18FJniF048497; Wed, 8 Feb 2012 15:19:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18FJn8O048495; Wed, 8 Feb 2012 15:19:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081519.q18FJn8O048495@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 15:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231205 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:19:49 -0000 Author: kib Date: Wed Feb 8 15:19:49 2012 New Revision: 231205 URL: http://svn.freebsd.org/changeset/base/231205 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/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Wed Feb 8 15:07:19 2012 (r231204) +++ stable/8/sys/kern/vfs_subr.c Wed Feb 8 15:19:49 2012 (r231205) @@ -2501,6 +2501,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-8@FreeBSD.ORG Wed Feb 8 15:37:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3C81065670; Wed, 8 Feb 2012 15:37:35 +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 5B42C8FC0C; Wed, 8 Feb 2012 15:37: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 q18FbZmp049075; Wed, 8 Feb 2012 15:37:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18FbZiq049073; Wed, 8 Feb 2012 15:37:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081537.q18FbZiq049073@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 15:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231206 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:37:35 -0000 Author: bz Date: Wed Feb 8 15:37:34 2012 New Revision: 231206 URL: http://svn.freebsd.org/changeset/base/231206 Log: MFC r225030: While not explicitly allowed by RFC 2460, in case there is no translation technology involved (and that section is suggested to be removed by Errata 2843), single packet fragments do not harm. There is another errata and further drafts under discussion to clarify on these kinds of packets. Meanwhile add a sysctl to allow disabling this behaviour again. We will treat single packet fragment (a fragment header added when not needed) as if there was no fragment header. Submitted by: Matthew Luckie (mjl luckie.org.nz) (original version) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:19:49 2012 (r231205) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:37:34 2012 (r231206) @@ -103,6 +103,9 @@ static VNET_DEFINE(int, ipfw_vnet_ready) static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) +static VNET_DEFINE(int, fw_permit_single_frag6) = 1; +#define V_fw_permit_single_frag6 VNET(fw_permit_single_frag6) + #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; #else @@ -177,6 +180,9 @@ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); +SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, permit_single_frag6, + CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_permit_single_frag6), 0, + "Permit single packet IPv6 fragments"); #endif /* INET6 */ SYSEND @@ -838,10 +844,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header. + * For IPv6 offset == 0 means there is no Fragment Header or there + * is a single packet fragement (fragement header added without + * needed). We will treat a single packet fragment as if there + * was no fragment header (or log/block depending on the + * V_fw_permit_single_frag6 sysctl setting). * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG - * to be able to dectect the first fragment which would + * get the correct offset because we add IP6F_MORE_FRAG to be able + * to dectect the first of multiple fragments which would * otherwise have offset = 0. */ u_short offset = 0; @@ -1004,10 +1014,11 @@ do { \ offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0. */ + * fragment to be != 0 if there shall be more. */ offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; - if (offset == 0) { + if (V_fw_permit_single_frag6 == 0 && + offset == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (V_fw_deny_unknown_exthdrs) From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 16:03:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0BB106564A; Wed, 8 Feb 2012 16:03:06 +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 322988FC15; Wed, 8 Feb 2012 16:03: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 q18G36iB050106; Wed, 8 Feb 2012 16:03:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18G35gB050103; Wed, 8 Feb 2012 16:03:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081603.q18G35gB050103@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231208 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:03:06 -0000 Author: bz Date: Wed Feb 8 16:03:05 2012 New Revision: 231208 URL: http://svn.freebsd.org/changeset/base/231208 Log: MFC r225032,225034: ipfw internally checks for offset == 0 to determine whether the packet is a/the first fragment or not. For IPv6 we have added the "more fragments" flag as well to be able to determine on whether there will be more as we do not have the fragment header avaialble for logging, while for IPv4 this information can be derived directly from the IPv4 header. This allowed fragmented packets to bypass normal rules as proper masking was not done when checking offset. Split variables to not need masking for IPv6 to avoid further errors. After r225032 fix logging in a similar way masking the the IPv6 more fragments flag off so that offset == 0 checks work properly. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_log.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:38:36 2012 (r231207) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:03:05 2012 (r231208) @@ -844,17 +844,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header or there - * is a single packet fragement (fragement header added without - * needed). We will treat a single packet fragment as if there - * was no fragment header (or log/block depending on the + * For IPv6 offset|ip6f_mf == 0 means there is no Fragment Header + * or there is a single packet fragement (fragement header added + * without needed). We will treat a single packet fragment as if + * there was no fragment header (or log/block depending on the * V_fw_permit_single_frag6 sysctl setting). - * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG to be able - * to dectect the first of multiple fragments which would - * otherwise have offset = 0. */ u_short offset = 0; + u_short ip6f_mf = 0; /* * Local copies of addresses. They are only valid if we have @@ -1013,12 +1010,10 @@ do { \ proto = ((struct ip6_frag *)ulp)->ip6f_nxt; offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; - /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0 if there shall be more. */ - offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & + ip6f_mf = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; if (V_fw_permit_single_frag6 == 0 && - offset == 0) { + offset == 0 && ip6f_mf == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (V_fw_deny_unknown_exthdrs) @@ -1666,7 +1661,7 @@ do { \ case O_LOG: ipfw_log(f, hlen, args, m, - oif, offset, tablearg, ip); + oif, offset | ip6f_mf, tablearg, ip); match = 1; break; Modified: stable/8/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_log.c Wed Feb 8 15:38:36 2012 (r231207) +++ stable/8/sys/netinet/ipfw/ip_fw_log.c Wed Feb 8 16:03:05 2012 (r231208) @@ -328,10 +328,14 @@ ipfw_log(struct ip_fw *f, u_int hlen, st #ifdef INET6 struct ip6_hdr *ip6 = NULL; struct icmp6_hdr *icmp6; + u_short ip6f_mf; #endif src[0] = '\0'; dst[0] = '\0'; #ifdef INET6 + ip6f_mf = offset & IP6F_MORE_FRAG; + offset &= IP6F_OFF_MASK; + if (IS_IP6_FLOW_ID(&(args->f_id))) { char ip6buf[INET6_ADDRSTRLEN]; snprintf(src, sizeof(src), "[%s]", @@ -413,8 +417,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st " (frag %08x:%d@%d%s)", args->f_id.extra, ntohs(ip6->ip6_plen) - hlen, - ntohs(offset & IP6F_OFF_MASK) << 3, - (offset & IP6F_MORE_FRAG) ? "+" : ""); + ntohs(offset) << 3, ip6f_mf ? "+" : ""); } else #endif { From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 16:24:56 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6D03106564A; Wed, 8 Feb 2012 16:24:56 +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 C51FF8FC08; Wed, 8 Feb 2012 16:24: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 q18GOuwb050963; Wed, 8 Feb 2012 16:24:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GOuVr050961; Wed, 8 Feb 2012 16:24:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081624.q18GOuVr050961@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231210 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:24:56 -0000 Author: bz Date: Wed Feb 8 16:24:56 2012 New Revision: 231210 URL: http://svn.freebsd.org/changeset/base/231210 Log: MFC r225033: If we detect an IPv6 fragment header and it is not the first fragment, then terminate the loop as we will not find any further headers and for short fragments this could otherwise lead to a pullup error discarding the fragment. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:07:07 2012 (r231209) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:24:56 2012 (r231210) @@ -945,7 +945,7 @@ do { \ proto = ip6->ip6_nxt; /* Search extension headers to find upper layer protocols */ - while (ulp == NULL) { + while (ulp == NULL && offset == 0) { switch (proto) { case IPPROTO_ICMPV6: PULLUP_TO(hlen, ulp, struct icmp6_hdr); From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 16:44:55 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EE48106564A; Wed, 8 Feb 2012 16:44:55 +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 1D17E8FC18; Wed, 8 Feb 2012 16:44: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 q18GisRr051754; Wed, 8 Feb 2012 16:44:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GisSD051752; Wed, 8 Feb 2012 16:44:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081644.q18GisSD051752@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231212 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:44:55 -0000 Author: bz Date: Wed Feb 8 16:44:54 2012 New Revision: 231212 URL: http://svn.freebsd.org/changeset/base/231212 Log: MFC r225036: Hide IPv6 next header parsing warnings under the verbose sysctl so people can possibly disable it when their consoles are flooded, or enabled it for debugging. Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:26:01 2012 (r231211) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:44:54 2012 (r231212) @@ -990,9 +990,11 @@ do { \ ext_hd |= EXT_RTHDR2; break; default: - printf("IPFW2: IPV6 - Unknown Routing " - "Header type(%d)\n", - ((struct ip6_rthdr *)ulp)->ip6r_type); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Routing Header type(%d)\n", + ((struct ip6_rthdr *) + ulp)->ip6r_type); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -1014,8 +1016,9 @@ do { \ IP6F_MORE_FRAG; if (V_fw_permit_single_frag6 == 0 && offset == 0 && ip6f_mf == 0) { - printf("IPFW2: IPV6 - Invalid Fragment " - "Header\n"); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Invalid " + "Fragment Header\n"); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -1086,8 +1089,10 @@ do { \ break; default: - printf("IPFW2: IPV6 - Unknown Extension " - "Header(%d), ext_hd=%x\n", proto, ext_hd); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Extension Header(%d), ext_hd=%x\n", + proto, ext_hd); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); PULLUP_TO(hlen, ulp, struct ip6_ext); From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 17:03:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0087E106566B; Wed, 8 Feb 2012 17:03:13 +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 E2EC08FC16; Wed, 8 Feb 2012 17:03:12 +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 q18H3CfT052452; Wed, 8 Feb 2012 17:03:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18H3CoW052450; Wed, 8 Feb 2012 17:03:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081703.q18H3CoW052450@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231214 - stable/8/sys/dev/mfi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:03:13 -0000 Author: bz Date: Wed Feb 8 17:03:12 2012 New Revision: 231214 URL: http://svn.freebsd.org/changeset/base/231214 Log: MFC r225428: Shorten a variable access some using a cached value rather than casting the input argument again, making the code more readable. Reviewed by: jhb Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Feb 8 16:45:20 2012 (r231213) +++ stable/8/sys/dev/mfi/mfi.c Wed Feb 8 17:03:12 2012 (r231214) @@ -2154,8 +2154,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (ioc->mfi_sense_len) { /* get user-space sense ptr then copy out sense */ - bcopy(&((struct mfi_ioc_packet*)arg) - ->mfi_frame.raw[ioc->mfi_sense_off], + bcopy(&ioc->mfi_frame.raw[ioc->mfi_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); #ifdef __amd64__ From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 17:54:02 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1341065675; Wed, 8 Feb 2012 17:54:02 +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 AAF188FC08; Wed, 8 Feb 2012 17:54: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 q18Hs27H054100; Wed, 8 Feb 2012 17:54:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Hs2eK054096; Wed, 8 Feb 2012 17:54:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081754.q18Hs2eK054096@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231216 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:54:03 -0000 Author: bz Date: Wed Feb 8 17:54:02 2012 New Revision: 231216 URL: http://svn.freebsd.org/changeset/base/231216 Log: MFC r222845: Correct comments and debug logging in ipsec to better match reality. Modified: stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_ipsec.c stable/8/sys/netinet6/ip6_ipsec.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet/ip_input.c Wed Feb 8 17:54:02 2012 (r231216) @@ -510,7 +510,7 @@ tooshort: } #ifdef IPSEC /* - * Bypass packet filtering for packets from a tunnel (gif). + * Bypass packet filtering for packets previously handled by IPsec. */ if (ip_ipsec_filtertunnel(m)) goto passin; Modified: stable/8/sys/netinet/ip_ipsec.c ============================================================================== --- stable/8/sys/netinet/ip_ipsec.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet/ip_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) @@ -95,7 +95,7 @@ ip_ipsec_filtertunnel(struct mbuf *m) #if defined(IPSEC) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip4_ipsec_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) Modified: stable/8/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/8/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) @@ -95,7 +95,7 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_A /* * Check if we have to jump over firewall processing for this packet. - * Called from ip_input(). + * Called from ip6_input(). * 1 = jump over firewall, 0 = packet goes through firewall. */ int @@ -104,7 +104,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) #if defined(IPSEC) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip6_ipsec6_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) @@ -116,7 +116,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) /* * Check if this packet has an active SA and needs to be dropped instead * of forwarded. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = forward packet. */ int @@ -139,7 +139,7 @@ ip6_ipsec_fwd(struct mbuf *m) if (sp == NULL) { /* NB: can happen if error */ splx(s); /*XXX error stat???*/ - DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/ + DPRINTF(("%s: no SP for forwarding\n", __func__)); /*XXX*/ return 1; } @@ -161,7 +161,7 @@ ip6_ipsec_fwd(struct mbuf *m) * Check if protocol type doesn't have a further header and do IPSEC * decryption or reject right now. Protocols with further headers get * their IPSEC treatment within the protocol specific processing. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = continue processing packet. */ int @@ -204,7 +204,7 @@ ip6_ipsec_input(struct mbuf *m, int nxt) } else { /* XXX error stat??? */ error = EINVAL; - DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ + DPRINTF(("%s: no SP, packet discarded\n", __func__));/*XXX*/ return 1; } splx(s); From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 18:21:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA2B106564A; Wed, 8 Feb 2012 18:21:49 +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 5B6B08FC1E; Wed, 8 Feb 2012 18:21:49 +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 q18ILnMC055090; Wed, 8 Feb 2012 18:21:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18ILnDm055088; Wed, 8 Feb 2012 18:21:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081821.q18ILnDm055088@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231218 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:21:49 -0000 Author: bz Date: Wed Feb 8 18:21:48 2012 New Revision: 231218 URL: http://svn.freebsd.org/changeset/base/231218 Log: Remove sun4v from universe targets. Approved by: re Modified: stable/8/Makefile Modified: stable/8/Makefile ============================================================================== --- stable/8/Makefile Wed Feb 8 17:54:11 2012 (r231217) +++ stable/8/Makefile Wed Feb 8 18:21:48 2012 (r231218) @@ -284,7 +284,7 @@ toolchains: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 .if defined(UNIVERSE_TARGET) MAKE_JUST_WORLDS= YES From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 18:51:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF5C21065672; Wed, 8 Feb 2012 18:51:20 +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 936958FC14; Wed, 8 Feb 2012 18:51: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 q18IpK09056232; Wed, 8 Feb 2012 18:51:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IpK8c056229; Wed, 8 Feb 2012 18:51:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081851.q18IpK8c056229@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231222 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:51:20 -0000 Author: bz Date: Wed Feb 8 18:51:20 2012 New Revision: 231222 URL: http://svn.freebsd.org/changeset/base/231222 Log: MFC r228641: Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum offloading on vlans and document the new option. Modified: stable/8/sbin/ifconfig/ifconfig.8 stable/8/sbin/ifconfig/ifvlan.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:10 2012 (r231221) +++ stable/8/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:20 2012 (r231222) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 20, 2011 +.Dd December 17, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -408,10 +408,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/8/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/8/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:10 2012 (r231221) +++ stable/8/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:20 2012 (r231222) @@ -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-8@FreeBSD.ORG Wed Feb 8 19:31:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9385B106566B; Wed, 8 Feb 2012 19:31:33 +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 820FE8FC12; Wed, 8 Feb 2012 19:31: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 q18JVXxr058370; Wed, 8 Feb 2012 19:31:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18JVXwo058366; Wed, 8 Feb 2012 19:31:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081931.q18JVXwo058366@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 19:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231225 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 19:31:33 -0000 Author: bz Date: Wed Feb 8 19:31:32 2012 New Revision: 231225 URL: http://svn.freebsd.org/changeset/base/231225 Log: MFC r223359: Garbage collect never used global, sysctl, externs. Modified: stable/8/sys/net/route.c stable/8/sys/net/route.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Wed Feb 8 19:20:11 2012 (r231224) +++ stable/8/sys/net/route.c Wed Feb 8 19:31:32 2012 (r231225) @@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) -#if 0 -/* default fib for tunnels to use */ -u_int tunnel_fib = 0; -SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); -#endif - /* * handler for net.my_fibnum */ Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Wed Feb 8 19:20:11 2012 (r231224) +++ stable/8/sys/net/route.h Wed Feb 8 19:31:32 2012 (r231225) @@ -108,8 +108,6 @@ struct rt_metrics { #endif extern u_int rt_numfibs; /* number fo usable routing tables */ -extern u_int tunnel_fib; /* tunnels use these */ -extern u_int fwd_fib; /* packets being forwarded use these routes */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 22:27:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12657106566C; Wed, 8 Feb 2012 22:27:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001C08FC12; Wed, 8 Feb 2012 22:27: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 q18MR7xg067743; Wed, 8 Feb 2012 22:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18MR7O0067741; Wed, 8 Feb 2012 22:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202082227.q18MR7O0067741@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 8 Feb 2012 22:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231230 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:27:08 -0000 Author: hselasky Date: Wed Feb 8 22:27:07 2012 New Revision: 231230 URL: http://svn.freebsd.org/changeset/base/231230 Log: MFC r229317: Fix support for suspend and resume. Modified: stable/8/sys/dev/usb/controller/usb_controller.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Wed Feb 8 22:05:26 2012 (r231229) +++ stable/8/sys/dev/usb/controller/usb_controller.c Wed Feb 8 22:27:07 2012 (r231230) @@ -472,10 +472,18 @@ usb_bus_resume(struct usb_proc_msg *pm) if (bus->methods->set_hw_power != NULL) (bus->methods->set_hw_power) (bus); + /* restore USB configuration to index 0 */ err = usbd_set_config_index(udev, 0); if (err) device_printf(bus->bdev, "Could not configure root HUB\n"); + /* probe and attach */ + err = usb_probe_and_attach(udev, USB_IFACE_INDEX_ANY); + if (err) { + device_printf(bus->bdev, "Could not probe and " + "attach root HUB\n"); + } + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 22:29:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3835106566B; Wed, 8 Feb 2012 22:29:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13EB8FC14; Wed, 8 Feb 2012 22:29:41 +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 q18MTfOa067861; Wed, 8 Feb 2012 22:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18MTfC1067859; Wed, 8 Feb 2012 22:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202082229.q18MTfC1067859@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 8 Feb 2012 22:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231231 - stable/8/sys/dev/usb/serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:29:41 -0000 Author: hselasky Date: Wed Feb 8 22:29:41 2012 New Revision: 231231 URL: http://svn.freebsd.org/changeset/base/231231 Log: MFC r227285: Add support for new USB modem protocol. PR: usb/159919 Modified: stable/8/sys/dev/usb/serial/umodem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Wed Feb 8 22:27:07 2012 (r231230) +++ stable/8/sys/dev/usb/serial/umodem.c Wed Feb 8 22:29:41 2012 (r231231) @@ -127,7 +127,11 @@ static const STRUCT_USB_HOST_ID umodem_d /* Generic Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), - USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + /* Huawei Modem class match */ + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(0xFF)}, /* Kyocera AH-K3001V */ {USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)}, {USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)}, From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 23:13:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4037A1065670; Wed, 8 Feb 2012 23:13:22 +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 2E4D28FC08; Wed, 8 Feb 2012 23:13: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 q18NDMDu069325; Wed, 8 Feb 2012 23:13:22 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NDLb4069323; Wed, 8 Feb 2012 23:13:21 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202082313.q18NDLb4069323@svn.freebsd.org> From: Sean Farley Date: Wed, 8 Feb 2012 23:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231234 - stable/8/usr.sbin/cron/crontab X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:13:22 -0000 Author: scf Date: Wed Feb 8 23:13:21 2012 New Revision: 231234 URL: http://svn.freebsd.org/changeset/base/231234 Log: Merge from head to stable/8: r230655: Since April 2, 2006, Indiana has observed DST. Modified: stable/8/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/8/usr.sbin/cron/crontab/ (props changed) Modified: stable/8/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/8/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:12:05 2012 (r231233) +++ stable/8/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:13:21 2012 (r231234) @@ -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-8@FreeBSD.ORG Wed Feb 8 23:47:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2DF4106564A; Wed, 8 Feb 2012 23:47:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C468FC14; Wed, 8 Feb 2012 23:47: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 q18NlM2l070544; Wed, 8 Feb 2012 23:47:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NlMAb070541; Wed, 8 Feb 2012 23:47:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082347.q18NlMAb070541@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 23:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231237 - stable/8/sys/sun4v/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:47:22 -0000 Author: marius Date: Wed Feb 8 23:47:22 2012 New Revision: 231237 URL: http://svn.freebsd.org/changeset/base/231237 Log: Merge from r230889: Mark cpu_{halt,reset}() and hv_mach_{exit,sir}() as __dead2 as appropriate. This is a direct commit to stable/8. Modified: stable/8/sys/sun4v/include/cpu.h stable/8/sys/sun4v/include/hv_api.h Modified: stable/8/sys/sun4v/include/cpu.h ============================================================================== --- stable/8/sys/sun4v/include/cpu.h Wed Feb 8 23:34:47 2012 (r231236) +++ stable/8/sys/sun4v/include/cpu.h Wed Feb 8 23:47:22 2012 (r231237) @@ -53,8 +53,8 @@ extern void cpu_yield(void); extern char btext[]; extern char etext[]; -void cpu_halt(void); -void cpu_reset(void); +void cpu_halt(void) __dead2; +void cpu_reset(void) __dead2; void fork_trampoline(void); void swi_vm(void *v); Modified: stable/8/sys/sun4v/include/hv_api.h ============================================================================== --- stable/8/sys/sun4v/include/hv_api.h Wed Feb 8 23:34:47 2012 (r231236) +++ stable/8/sys/sun4v/include/hv_api.h Wed Feb 8 23:47:22 2012 (r231237) @@ -52,8 +52,8 @@ typedef uint64_t io_addr_t; * Section 10 Domain Services */ -extern void hv_mach_sir(void); -extern void hv_mach_exit(uint64_t exit_code); +extern void hv_mach_sir(void) __dead2; +extern void hv_mach_exit(uint64_t exit_code) __dead2; extern uint64_t hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep); extern uint64_t hv_mach_watchdog(uint64_t timeout, uint64_t *time_remaining); From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 8 23:57:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79EB106566C; Wed, 8 Feb 2012 23:57:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB1A88FC08; Wed, 8 Feb 2012 23:57: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 q18Nv3pM070900; Wed, 8 Feb 2012 23:57:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Nv3hJ070898; Wed, 8 Feb 2012 23:57:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082357.q18Nv3hJ070898@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 23:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231239 - stable/8/sys/sun4v/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:57:04 -0000 Author: marius Date: Wed Feb 8 23:57:03 2012 New Revision: 231239 URL: http://svn.freebsd.org/changeset/base/231239 Log: Given that sun4u uses sparc64/sparc64/ofw_machdep.c, use the sparc64 here also. This isn't exactly a clean approach though as ofw_machdep.h also includes some prototypes for functions that aren't actually shared between both architectures but just happen to have the same interface. Given that the sun4v support actually is dead and this is just to allow things to continue to compile it should be okay though. This is a direct commit to stable/8. Modified: stable/8/sys/sun4v/include/ofw_machdep.h Modified: stable/8/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sun4v/include/ofw_machdep.h Wed Feb 8 23:51:46 2012 (r231238) +++ stable/8/sys/sun4v/include/ofw_machdep.h Wed Feb 8 23:57:03 2012 (r231239) @@ -1,44 +1,7 @@ /*- - * Copyright (c) 2001 by Thomas Moestl . - * 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 ``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. + * This file is in the public domain. * * $FreeBSD$ */ -#ifndef _MACHINE_OFW_MACHDEP_H_ -#define _MACHINE_OFW_MACHDEP_H_ - -#include -#include -#include - -typedef uint64_t cell_t; - -int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); -void OF_getetheraddr(device_t, u_char *); -u_int OF_getscsinitid(device_t); -void cpu_shutdown(void *); -int ofw_entry(void *); -void ofw_exit(void *); - -#endif /* _MACHINE_OFW_MACHDEP_H_ */ +#include From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 9 01:18:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8638C106564A; Thu, 9 Feb 2012 01:18:23 +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 747048FC12; Thu, 9 Feb 2012 01:18: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 q191INwL073583; Thu, 9 Feb 2012 01:18:23 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q191INhG073581; Thu, 9 Feb 2012 01:18:23 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202090118.q191INhG073581@svn.freebsd.org> From: Sean Farley Date: Thu, 9 Feb 2012 01:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231242 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 01:18:23 -0000 Author: scf Date: Thu Feb 9 01:18:23 2012 New Revision: 231242 URL: http://svn.freebsd.org/changeset/base/231242 Log: Merge from head to stable/8: r230656: msdos was renamed to msdosfs in 2001 by r77577. Modified: stable/8/share/man/man4/umass.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/umass.4 ============================================================================== --- stable/8/share/man/man4/umass.4 Thu Feb 9 01:18:09 2012 (r231241) +++ stable/8/share/man/man4/umass.4 Thu Feb 9 01:18:23 2012 (r231242) @@ -234,7 +234,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-8@FreeBSD.ORG Thu Feb 9 06:50:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86B86106564A; Thu, 9 Feb 2012 06:50:44 +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 6FEAA8FC0C; Thu, 9 Feb 2012 06:50:44 +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 q196oiVc085922; Thu, 9 Feb 2012 06:50:44 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q196oids085917; Thu, 9 Feb 2012 06:50:44 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090650.q196oids085917@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 06:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231248 - in stable/8: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 06:50:44 -0000 Author: bapt Date: Thu Feb 9 06:50:43 2012 New Revision: 231248 URL: http://svn.freebsd.org/changeset/base/231248 Log: MFH r230307: fix SIGINFO-related data corruption bug Approved by: des (mentor) Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/common.h stable/8/lib/libfetch/http.c stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/lib/libfetch/ (props changed) stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/common.c Thu Feb 9 06:50:43 2012 (r231248) @@ -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/8/lib/libfetch/common.h ============================================================================== --- stable/8/lib/libfetch/common.h Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/common.h Thu Feb 9 06:50:43 2012 (r231248) @@ -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/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/http.c Thu Feb 9 06:50:43 2012 (r231248) @@ -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/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/usr.bin/fetch/fetch.c Thu Feb 9 06:50:43 2012 (r231248) @@ -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-8@FreeBSD.ORG Thu Feb 9 07:27:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB0F106564A; Thu, 9 Feb 2012 07:27:59 +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 960718FC14; Thu, 9 Feb 2012 07:27: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 q197Rxpk087286; Thu, 9 Feb 2012 07:27:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197Rxuc087284; Thu, 9 Feb 2012 07:27:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090727.q197Rxuc087284@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231249 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:27:59 -0000 Author: bz Date: Thu Feb 9 07:27:59 2012 New Revision: 231249 URL: http://svn.freebsd.org/changeset/base/231249 Log: MRC r223626: Compare port numbers correctly. They are stored by SRCPORT() in host byte order, so we need to compare them as such. Properly compare IPv6 addresses as well. This allows the, by default, 8 badaddrs slots per address family to work correctly and only print sendto() errors once. The change is no longer applicable to any latest upstream versions. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 06:50:43 2012 (r231248) +++ stable/8/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 07:27:59 2012 (r231249) @@ -2646,14 +2646,14 @@ sendpkt( for (slot = ERRORCACHESIZE; --slot >= 0; ) if(dest->ss_family == AF_INET) { - if (badaddrs[slot].port == ((struct sockaddr_in*)dest)->sin_port && + if (badaddrs[slot].port == SRCPORT(dest) && badaddrs[slot].addr.s_addr == ((struct sockaddr_in*)dest)->sin_addr.s_addr) break; } #ifdef INCLUDE_IPV6_SUPPORT else if (dest->ss_family == AF_INET6) { - if (badaddrs6[slot].port == ((struct sockaddr_in6*)dest)->sin6_port && - badaddrs6[slot].addr.s6_addr == ((struct sockaddr_in6*)dest)->sin6_addr.s6_addr) + if (badaddrs6[slot].port == SRCPORT(dest) && + !memcmp(&badaddrs6[slot].addr, &((struct sockaddr_in6*)dest)->sin6_addr, sizeof(struct in6_addr))) break; } #endif /* INCLUDE_IPV6_SUPPORT */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 9 07:40:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A70C1065672; Thu, 9 Feb 2012 07:40:14 +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 655168FC17; Thu, 9 Feb 2012 07:40:14 +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 q197eElD087840; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197eEaH087838; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090740.q197eEaH087838@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231252 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:40:14 -0000 Author: mav Date: Thu Feb 9 07:40:13 2012 New Revision: 231252 URL: http://svn.freebsd.org/changeset/base/231252 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/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:38:56 2012 (r231251) +++ stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:40:13 2012 (r231252) @@ -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-8@FreeBSD.ORG Thu Feb 9 07:45:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF93106566B; Thu, 9 Feb 2012 07:45:03 +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 184B78FC08; Thu, 9 Feb 2012 07:45: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 q197j2HW088102; Thu, 9 Feb 2012 07:45:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197j28m088100; Thu, 9 Feb 2012 07:45:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090745.q197j28m088100@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231254 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:45:03 -0000 Author: mav Date: Thu Feb 9 07:45:02 2012 New Revision: 231254 URL: http://svn.freebsd.org/changeset/base/231254 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/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Thu Feb 9 07:43:38 2012 (r231253) +++ stable/8/sys/cam/ata/ata_da.c Thu Feb 9 07:45:02 2012 (r231254) @@ -1032,7 +1032,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 && @@ -1572,7 +1572,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/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Feb 9 07:43:38 2012 (r231253) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Feb 9 07:45:02 2012 (r231254) @@ -1095,7 +1095,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) { @@ -1451,7 +1451,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); @@ -2299,7 +2299,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-8@FreeBSD.ORG Thu Feb 9 07:52:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F815106566B; Thu, 9 Feb 2012 07:52:46 +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 195338FC13; Thu, 9 Feb 2012 07:52: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 q197qjdZ088399; Thu, 9 Feb 2012 07:52:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197qjre088396; Thu, 9 Feb 2012 07:52:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090752.q197qjre088396@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231256 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:52:46 -0000 Author: bz Date: Thu Feb 9 07:52:45 2012 New Revision: 231256 URL: http://svn.freebsd.org/changeset/base/231256 Log: MFC r223667: In case ntp cannot resolve a hostname on startup it will queue the entry for resolving by a child process that, upon success, will add the entry to the config of the running running parent process. Unfortunately there are a couple of bugs with this, fixed in various later versions of upstream in potentially different ways due to other code changes: 1) Upon server [-46] the [-46] are used as FQDN for later resolving which does not work. Make sure we always pass the name (or IP there). 2) The intermediate file to carry the information to the child process does not know about -4/-6 restrictions, so that a dual-stacked host could resolve to an IPv6 address but that might be unreachable (see r223626) leading to no working synchronization ignoring a IPv4 record. Thus alter the intermediate format to also pass the address family (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process depending on -4 or -6. 3) Make the child process to parse the new intermediate file format and save the address family for getaddrinfo() hints flags. 4) Change child to always reload resolv.conf calling res_init() before trying to resolve names. This will pick up resolv.conf changes or new resolv.confs should they have not existed or been empty or unusable on ntp startup. This fix is more conditional in upstream versions but given FreeBSD has res_init there is no need for the configure logic as well. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/ntp/ntpd/ntp_config.c stable/8/contrib/ntp/ntpd/ntp_intres.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_config.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:52:44 2012 (r231255) +++ stable/8/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:52:45 2012 (r231256) @@ -414,7 +414,7 @@ enum gnn_type { static int getnetnum P((const char *, struct sockaddr_storage *, int, enum gnn_type)); static void save_resolve P((char *, int, int, int, int, u_int, int, - keyid_t, u_char *)); + keyid_t, u_char *, u_char)); static void do_resolve_internal P((void)); static void abort_resolve P((void)); #if !defined(VMS) && !defined(SYS_WINNT) @@ -870,9 +870,9 @@ getconfig( stoa(&peeraddr)); } } else if (errflg == -1) { - save_resolve(tokens[1], hmode, peerversion, + save_resolve(tokens[istart - 1], hmode, peerversion, minpoll, maxpoll, peerflags, ttl, - peerkey, peerkeystr); + peerkey, peerkeystr, peeraddr.ss_family); } break; @@ -2325,7 +2325,8 @@ save_resolve( u_int flags, int ttl, keyid_t keyid, - u_char *keystr + u_char *keystr, + u_char peeraf ) { #ifndef SYS_VXWORKS @@ -2365,11 +2366,11 @@ save_resolve( } #endif - (void)fprintf(res_fp, "%s %d %d %d %d %d %d %u %s\n", name, + (void)fprintf(res_fp, "%s %u %d %d %d %d %d %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #ifdef DEBUG if (debug > 1) - printf("config: %s %d %d %d %d %x %d %u %s\n", name, mode, + printf("config: %s %u %d %d %d %d %x %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif Modified: stable/8/contrib/ntp/ntpd/ntp_intres.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:52:44 2012 (r231255) +++ stable/8/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:52:45 2012 (r231256) @@ -34,6 +34,7 @@ #include #include +#include #include /**/ @@ -116,15 +117,16 @@ static int resolve_value; /* next value * is supposed to consist of entries in the following order */ #define TOK_HOSTNAME 0 -#define TOK_HMODE 1 -#define TOK_VERSION 2 -#define TOK_MINPOLL 3 -#define TOK_MAXPOLL 4 -#define TOK_FLAGS 5 -#define TOK_TTL 6 -#define TOK_KEYID 7 -#define TOK_KEYSTR 8 -#define NUMTOK 9 +#define TOK_PEERAF 1 +#define TOK_HMODE 2 +#define TOK_VERSION 3 +#define TOK_MINPOLL 4 +#define TOK_MAXPOLL 5 +#define TOK_FLAGS 6 +#define TOK_TTL 7 +#define TOK_KEYID 8 +#define TOK_KEYSTR 9 +#define NUMTOK 10 #define MAXLINESIZE 512 @@ -145,7 +147,7 @@ char *req_file; /* name of the file wit static void checkparent P((void)); static void removeentry P((struct conf_entry *)); static void addentry P((char *, int, int, int, int, u_int, - int, keyid_t, char *)); + int, keyid_t, char *, u_char)); static int findhostaddr P((struct conf_entry *)); static void openntp P((void)); static int request P((struct conf_peer *)); @@ -402,7 +404,8 @@ addentry( u_int flags, int ttl, keyid_t keyid, - char *keystr + char *keystr, + u_char peeraf ) { register char *cp; @@ -412,7 +415,7 @@ addentry( #ifdef DEBUG if (debug > 1) msyslog(LOG_INFO, - "intres: <%s> %d %d %d %d %x %d %x %s\n", name, + "intres: <%s> %u %d %d %d %d %x %d %x %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif @@ -427,6 +430,7 @@ addentry( ce->ce_peeraddr6 = in6addr_any; #endif ANYSOCK(&ce->peer_store); + ce->peer_store.ss_family = peeraf; /* Save AF for getaddrinfo hints. */ ce->ce_hmode = (u_char)mode; ce->ce_version = (u_char)version; ce->ce_minpoll = (u_char)minpoll; @@ -488,7 +492,8 @@ findhostaddr( #endif /* DEBUG */ memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; + hints.ai_family = entry->peer_store.ss_family; + hints.ai_socktype = SOCK_DGRAM; /* * If the IPv6 stack is not available look only for IPv4 addresses */ @@ -1022,6 +1027,13 @@ readconf( } } + if (intval[TOK_PEERAF] != AF_UNSPEC && intval[TOK_PEERAF] != + AF_INET && intval[TOK_PEERAF] != AF_INET6) { + msyslog(LOG_ERR, "invalid peer address family (%u) in " + "file %s", intval[TOK_PEERAF], name); + exit(1); + } + if (intval[TOK_HMODE] != MODE_ACTIVE && intval[TOK_HMODE] != MODE_CLIENT && intval[TOK_HMODE] != MODE_BROADCAST) { @@ -1078,7 +1090,7 @@ readconf( addentry(token[TOK_HOSTNAME], (int)intval[TOK_HMODE], (int)intval[TOK_VERSION], (int)intval[TOK_MINPOLL], (int)intval[TOK_MAXPOLL], flags, (int)intval[TOK_TTL], - intval[TOK_KEYID], token[TOK_KEYSTR]); + intval[TOK_KEYID], token[TOK_KEYSTR], (u_char)intval[TOK_PEERAF]); } } @@ -1100,6 +1112,9 @@ doconfigure( dores ? "with" : "without" ); #endif + if (dores) /* Reload /etc/resolv.conf - bug 1226 */ + res_init(); + ce = confentries; while (ce != NULL) { #ifdef DEBUG From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 9 08:41:57 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 037A51065673; Thu, 9 Feb 2012 08:41:57 +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 E21118FC14; Thu, 9 Feb 2012 08: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 q198fucs090222; Thu, 9 Feb 2012 08:41:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q198fuMt090220; Thu, 9 Feb 2012 08:41:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090841.q198fuMt090220@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 08:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231258 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 08:41:57 -0000 Author: bz Date: Thu Feb 9 08:41:56 2012 New Revision: 231258 URL: http://svn.freebsd.org/changeset/base/231258 Log: MFC r223739: Remove extra white space to comply with style for the rest of the struct. Modified: stable/8/sys/net/if_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Thu Feb 9 08:33:04 2012 (r231257) +++ stable/8/sys/net/if_var.h Thu Feb 9 08:41:56 2012 (r231258) @@ -197,14 +197,14 @@ struct ifnet { /* protected by if_addr_mtx */ void *if_pf_kif; void *if_lagg; /* lagg glue */ - u_char if_alloctype; /* if_type at time of allocation */ + u_char if_alloctype; /* if_type at time of allocation */ /* * Spare fields are added so that we can modify sensitive data * structures without changing the kernel binary interface, and must * be used with care where binary compatibility is required. */ - char if_cspare[3]; + char if_cspare[3]; char *if_description; /* interface description */ void *if_pspare[7]; int if_ispare[4]; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 9 09:20:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEF01065784; Thu, 9 Feb 2012 09:20:50 +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 A601B8FC16; Thu, 9 Feb 2012 09:20: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 q199KoAL091582; Thu, 9 Feb 2012 09:20:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199Ko7S091579; Thu, 9 Feb 2012 09:20:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090920.q199Ko7S091579@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231261 - stable/8/bin/df X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:20:50 -0000 Author: bapt Date: Thu Feb 9 09:20:50 2012 New Revision: 231261 URL: http://svn.freebsd.org/changeset/base/231261 Log: MFH r226502,r226503: factor out the common code and fix two display bugs Approved by: des (mentor) Modified: stable/8/bin/df/df.1 stable/8/bin/df/df.c Directory Properties: stable/8/bin/df/ (props changed) Modified: stable/8/bin/df/df.1 ============================================================================== --- stable/8/bin/df/df.1 Thu Feb 9 09:20:34 2012 (r231260) +++ stable/8/bin/df/df.1 Thu Feb 9 09:20:50 2012 (r231261) @@ -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/8/bin/df/df.c ============================================================================== --- stable/8/bin/df/df.c Thu Feb 9 09:20:34 2012 (r231260) +++ stable/8/bin/df/df.c Thu Feb 9 09:20:50 2012 (r231261) @@ -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-8@FreeBSD.ORG Thu Feb 9 09:23:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6E4106566C; Thu, 9 Feb 2012 09:23:37 +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 B57CB8FC12; Thu, 9 Feb 2012 09:23:37 +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 q199NbGL091718; Thu, 9 Feb 2012 09:23:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199Nb6m091716; Thu, 9 Feb 2012 09:23:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090923.q199Nb6m091716@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 09:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231262 - stable/8/usr.bin/top X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:23:37 -0000 Author: bz Date: Thu Feb 9 09:23:37 2012 New Revision: 231262 URL: http://svn.freebsd.org/changeset/base/231262 Log: MFC r224011: Fix indentation. Obtained from: Ed Maste at Sandvine Incorporated Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Thu Feb 9 09:20:50 2012 (r231261) +++ stable/8/usr.bin/top/machine.c Thu Feb 9 09:23:37 2012 (r231262) @@ -841,7 +841,7 @@ format_next_process(caddr_t handle, char (args = kvm_getargv(kd, pp, cmdlengthdelta)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && - pp->ki_ocomm[0]) { + pp->ki_ocomm[0]) { snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_ocomm); } else { From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 9 09:24:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3263310657F2; Thu, 9 Feb 2012 09:24:53 +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 39F578FC17; Thu, 9 Feb 2012 09:24: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 q199OrNk091831; Thu, 9 Feb 2012 09:24:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199OrRn091829; Thu, 9 Feb 2012 09:24:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090924.q199OrRn091829@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231264 - stable/8/usr.bin/ktrace X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:24:54 -0000 Author: bapt Date: Thu Feb 9 09:24:52 2012 New Revision: 231264 URL: http://svn.freebsd.org/changeset/base/231264 Log: MFH r226504: Make ktrace(1) build cleanly at WARNS level 6 Approved by: des (mentor) Modified: stable/8/usr.bin/ktrace/ktrace.c Directory Properties: stable/8/usr.bin/ktrace/ (props changed) Modified: stable/8/usr.bin/ktrace/ktrace.c ============================================================================== --- stable/8/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:33 2012 (r231263) +++ stable/8/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:52 2012 (r231264) @@ -47,15 +47,15 @@ static char sccsid[] = "@(#)ktrace.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include +#include #include -#include #include #include #include -#include +#include +#include #include #include #include @@ -64,21 +64,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) @@ -87,11 +88,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; @@ -100,15 +100,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); @@ -120,12 +119,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; @@ -134,10 +140,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); @@ -165,46 +170,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-8@FreeBSD.ORG Thu Feb 9 13:23:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD3E10656D3; Thu, 9 Feb 2012 13:23:45 +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 42EFE8FC14; Thu, 9 Feb 2012 13:23: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 q19DNjg9002652; Thu, 9 Feb 2012 13:23:45 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19DNj6m002650; Thu, 9 Feb 2012 13:23:45 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091323.q19DNj6m002650@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 13:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231272 - stable/8/rescue/rescue X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 13:23:45 -0000 Author: bapt Date: Thu Feb 9 13:23:44 2012 New Revision: 231272 URL: http://svn.freebsd.org/changeset/base/231272 Log: MFH r227531: Add netcat (nc) to /rescue. Approved by: des (mentor) Modified: stable/8/rescue/rescue/Makefile Directory Properties: stable/8/rescue/rescue/ (props changed) Modified: stable/8/rescue/rescue/Makefile ============================================================================== --- stable/8/rescue/rescue/Makefile Thu Feb 9 13:23:33 2012 (r231271) +++ stable/8/rescue/rescue/Makefile Thu Feb 9 13:23:44 2012 (r231272) @@ -199,7 +199,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-8@FreeBSD.ORG Thu Feb 9 14:16:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D72671065670; Thu, 9 Feb 2012 14:16:40 +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 BFFBD8FC12; Thu, 9 Feb 2012 14:16: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 q19EGe3i004712; Thu, 9 Feb 2012 14:16:40 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EGenl004705; Thu, 9 Feb 2012 14:16:40 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091416.q19EGenl004705@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 14:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231278 - in stable/8: etc/rc.d sbin/dhclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:16:41 -0000 Author: bapt Date: Thu Feb 9 14:16:40 2012 New Revision: 231278 URL: http://svn.freebsd.org/changeset/base/231278 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/8/etc/rc.d/dhclient stable/8/sbin/dhclient/Makefile stable/8/sbin/dhclient/dhclient.8 stable/8/sbin/dhclient/dhclient.c stable/8/sbin/dhclient/dhcpd.h stable/8/sbin/dhclient/errwarn.c Directory Properties: stable/8/etc/rc.d/ (props changed) stable/8/sbin/dhclient/ (props changed) Modified: stable/8/etc/rc.d/dhclient ============================================================================== --- stable/8/etc/rc.d/dhclient Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/etc/rc.d/dhclient Thu Feb 9 14:16:40 2012 (r231278) @@ -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/8/sbin/dhclient/Makefile ============================================================================== --- stable/8/sbin/dhclient/Makefile Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/Makefile Thu Feb 9 14:16:40 2012 (r231278) @@ -39,5 +39,7 @@ PROG= dhclient SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +DPADD= ${LIBUTIL} +LDADD= -lutil .include Modified: stable/8/sbin/dhclient/dhclient.8 ============================================================================== --- stable/8/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:40 2012 (r231278) @@ -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/8/sbin/dhclient/dhclient.c ============================================================================== --- stable/8/sbin/dhclient/dhclient.c Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhclient.c Thu Feb 9 14:16:40 2012 (r231278) @@ -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/8/sbin/dhclient/dhcpd.h ============================================================================== --- stable/8/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:40 2012 (r231278) @@ -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/8/sbin/dhclient/errwarn.c ============================================================================== --- stable/8/sbin/dhclient/errwarn.c Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/errwarn.c Thu Feb 9 14:16:40 2012 (r231278) @@ -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-8@FreeBSD.ORG Thu Feb 9 16:12:12 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C910510656D1; Thu, 9 Feb 2012 16:12:12 +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 B32718FC13; Thu, 9 Feb 2012 16:12:12 +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 q19GCCQJ008781; Thu, 9 Feb 2012 16:12:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GCC3P008779; Thu, 9 Feb 2012 16:12:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202091612.q19GCC3P008779@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 16:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231285 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:12:12 -0000 Author: bz Date: Thu Feb 9 16:12:12 2012 New Revision: 231285 URL: http://svn.freebsd.org/changeset/base/231285 Log: MFC r229127: Remove a declaration to a non-existent function. Modified: stable/8/sys/netinet6/scope6_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/scope6_var.h ============================================================================== --- stable/8/sys/netinet6/scope6_var.h Thu Feb 9 16:11:57 2012 (r231284) +++ stable/8/sys/netinet6/scope6_var.h Thu Feb 9 16:12:12 2012 (r231285) @@ -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-8@FreeBSD.ORG Thu Feb 9 16:54:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A6C106566B; Thu, 9 Feb 2012 16:54:07 +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 2A2D58FC08; Thu, 9 Feb 2012 16:54: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 q19Gs75E010295; Thu, 9 Feb 2012 16:54:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gs6us010288; Thu, 9 Feb 2012 16:54:06 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091654.q19Gs6us010288@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231288 - in stable/8/sys/boot: arm/at91/boot2 arm/ixp425/boot2 i386/boot2 i386/gptboot i386/zfsboot pc98/boot2 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:54:07 -0000 Author: bapt Date: Thu Feb 9 16:54:06 2012 New Revision: 231288 URL: http://svn.freebsd.org/changeset/base/231288 Log: MFH r226506: Look for /boot/config in addition to /boot.config Approved by: des (mentor) Modified: stable/8/sys/boot/arm/at91/boot2/boot2.c stable/8/sys/boot/arm/ixp425/boot2/boot2.c stable/8/sys/boot/i386/boot2/boot2.c stable/8/sys/boot/i386/gptboot/gptboot.c stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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/8/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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/8/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/8/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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" @@ -528,7 +529,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/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -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-8@FreeBSD.ORG Thu Feb 9 16:55:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B627E10657CE; Thu, 9 Feb 2012 16:55:50 +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 9F9298FC21; Thu, 9 Feb 2012 16:55: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 q19Gto1R010555; Thu, 9 Feb 2012 16:55:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GtoW5010553; Thu, 9 Feb 2012 16:55:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091655.q19GtoW5010553@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231291 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:50 -0000 Author: bapt Date: Thu Feb 9 16:55:50 2012 New Revision: 231291 URL: http://svn.freebsd.org/changeset/base/231291 Log: MFH r226166: Document some not-so-recently added trace points Approved by: des (mentor) Modified: stable/8/lib/libc/sys/ktrace.2 Directory Properties: stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/ktrace.2 ============================================================================== --- stable/8/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:41 2012 (r231290) +++ stable/8/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:50 2012 (r231291) @@ -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-8@FreeBSD.ORG Thu Feb 9 16:57:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC29A106567E; Thu, 9 Feb 2012 16:57: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 A684E8FC15; Thu, 9 Feb 2012 16: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 q19GvYfF010888; Thu, 9 Feb 2012 16:57:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GvY2t010885; Thu, 9 Feb 2012 16:57:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091657.q19GvY2t010885@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231293 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:57:35 -0000 Author: bapt Date: Thu Feb 9 16:57:34 2012 New Revision: 231293 URL: http://svn.freebsd.org/changeset/base/231293 Log: MFH r226119: Mention tdsignal(9) Approved by: des (mentor) Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/psignal.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Thu Feb 9 16:57:21 2012 (r231292) +++ stable/8/share/man/man9/Makefile Thu Feb 9 16:57:34 2012 (r231293) @@ -970,7 +970,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/8/share/man/man9/psignal.9 ============================================================================== --- stable/8/share/man/man9/psignal.9 Thu Feb 9 16:57:21 2012 (r231292) +++ stable/8/share/man/man9/psignal.9 Thu Feb 9 16:57:34 2012 (r231293) @@ -35,14 +35,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 @@ -52,8 +53,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 @@ -142,6 +145,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-8@FreeBSD.ORG Thu Feb 9 20:54:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F30A106564A; Thu, 9 Feb 2012 20:54:15 +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 1D9258FC13; Thu, 9 Feb 2012 20:54: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 q19KsE6I028905; Thu, 9 Feb 2012 20:54:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KsEtu028903; Thu, 9 Feb 2012 20:54:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092054.q19KsEtu028903@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231302 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:54:15 -0000 Author: bz Date: Thu Feb 9 20:54:14 2012 New Revision: 231302 URL: http://svn.freebsd.org/changeset/base/231302 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/8/sys/netinet6/in6_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6_var.h ============================================================================== --- stable/8/sys/netinet6/in6_var.h Thu Feb 9 20:54:04 2012 (r231301) +++ stable/8/sys/netinet6/in6_var.h Thu Feb 9 20:54:14 2012 (r231302) @@ -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-8@FreeBSD.ORG Thu Feb 9 20:57:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A7A10656FA; Thu, 9 Feb 2012 20:57:37 +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 141B68FC19; Thu, 9 Feb 2012 20:57:37 +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 q19Kvamo029478; Thu, 9 Feb 2012 20:57:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KvaZH029475; Thu, 9 Feb 2012 20:57:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092057.q19KvaZH029475@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231305 - stable/8/sys/net80211 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:57:37 -0000 Author: bz Date: Thu Feb 9 20:57:36 2012 New Revision: 231305 URL: http://svn.freebsd.org/changeset/base/231305 Log: MFC r229795: Correct comment for the IPv6 case to say "traffic class" not "TOS" as pointed out back in 2009. Modified: stable/8/sys/net80211/ieee80211_output.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net80211/ieee80211_output.c ============================================================================== --- stable/8/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:25 2012 (r231304) +++ stable/8/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:36 2012 (r231305) @@ -823,7 +823,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-8@FreeBSD.ORG Thu Feb 9 21:33:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD482106566B; Thu, 9 Feb 2012 21:33:36 +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 CBB498FC0C; Thu, 9 Feb 2012 21:33:36 +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 q19LXa7J033935; Thu, 9 Feb 2012 21:33:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19LXarg033933; Thu, 9 Feb 2012 21:33:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092133.q19LXarg033933@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 21:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231307 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:33:37 -0000 Author: bz Date: Thu Feb 9 21:33:36 2012 New Revision: 231307 URL: http://svn.freebsd.org/changeset/base/231307 Log: MFC r229546: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. Modified: stable/8/sys/netinet6/in6_ifattach.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/8/sys/netinet6/in6_ifattach.c Thu Feb 9 21:06:47 2012 (r231306) +++ stable/8/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:36 2012 (r231307) @@ -512,12 +512,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-8@FreeBSD.ORG Thu Feb 9 22:54:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00AA9106566C; Thu, 9 Feb 2012 22:54:08 +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 E340D8FC08; Thu, 9 Feb 2012 22:54: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 q19Ms72H041533; Thu, 9 Feb 2012 22:54:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ms7Wm041531; Thu, 9 Feb 2012 22:54:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092254.q19Ms7Wm041531@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231315 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:54:08 -0000 Author: bz Date: Thu Feb 9 22:54:07 2012 New Revision: 231315 URL: http://svn.freebsd.org/changeset/base/231315 Log: MFC r230387: Remove a superfluous INET6 check (no opt_inet6.h included anyway). Modified: stable/8/sys/netinet/if_ether.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Thu Feb 9 22:48:35 2012 (r231314) +++ stable/8/sys/netinet/if_ether.c Thu Feb 9 22:54:07 2012 (r231315) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) || defined(INET6) +#if defined(INET) #include #endif From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 00:01:51 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45CD9106566C; Fri, 10 Feb 2012 00:01:51 +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 340D18FC17; Fri, 10 Feb 2012 00:01: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 q1A01pg5044054; Fri, 10 Feb 2012 00:01:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A01pZW044052; Fri, 10 Feb 2012 00:01:51 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100001.q1A01pZW044052@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231318 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:01:51 -0000 Author: bz Date: Fri Feb 10 00:01:50 2012 New Revision: 231318 URL: http://svn.freebsd.org/changeset/base/231318 Log: MFC r230494: Remove unnecessary line break. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Thu Feb 9 23:19:09 2012 (r231317) +++ stable/8/sys/netinet6/in6.c Fri Feb 10 00:01:50 2012 (r231318) @@ -1275,8 +1275,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-8@FreeBSD.ORG Fri Feb 10 00:09:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936741065680; Fri, 10 Feb 2012 00:09:21 +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 81A7D8FC12; Fri, 10 Feb 2012 00:09: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 q1A09LKc044582; Fri, 10 Feb 2012 00:09:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A09Luv044580; Fri, 10 Feb 2012 00:09:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100009.q1A09Luv044580@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231322 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:09:21 -0000 Author: eadler Date: Fri Feb 10 00:09:21 2012 New Revision: 231322 URL: http://svn.freebsd.org/changeset/base/231322 Log: MFC r228344: - Add support for Support SEAGATE DAT Scopion 130 PR: kern/141934 Approved by: cperciva Modified: stable/8/sys/cam/scsi/scsi_sa.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:08:53 2012 (r231321) +++ stable/8/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:09:21 2012 (r231322) @@ -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-8@FreeBSD.ORG Fri Feb 10 00:24:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C375C106566C; Fri, 10 Feb 2012 00:24:41 +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 B1D038FC1C; Fri, 10 Feb 2012 00:24:41 +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 q1A0OfVh045209; Fri, 10 Feb 2012 00:24:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0Ofq9045207; Fri, 10 Feb 2012 00:24:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100024.q1A0Ofq9045207@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231325 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:24:41 -0000 Author: bz Date: Fri Feb 10 00:24:41 2012 New Revision: 231325 URL: http://svn.freebsd.org/changeset/base/231325 Log: MFC r230506: Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr(). Reviewed by: rwatson Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Feb 10 00:24:39 2012 (r231324) +++ stable/8/sys/netinet6/in6.c Fri Feb 10 00:24:41 2012 (r231325) @@ -1369,6 +1369,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) { @@ -1393,8 +1395,6 @@ cleanup: return; ia->ia_flags &= ~IFA_ROUTE; } - if (ifa0 != NULL) - ifa_free(ifa0); in6_unlink_ifa(ia, ifp); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 00:51:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00854106564A; Fri, 10 Feb 2012 00:51:33 +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 E32AD8FC19; Fri, 10 Feb 2012 00:51: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 q1A0pW6F046139; Fri, 10 Feb 2012 00:51:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0pWF1046137; Fri, 10 Feb 2012 00:51:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100051.q1A0pWF1046137@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231327 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:51:33 -0000 Author: bz Date: Fri Feb 10 00:51:32 2012 New Revision: 231327 URL: http://svn.freebsd.org/changeset/base/231327 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/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Fri Feb 10 00:51:23 2012 (r231326) +++ stable/8/sys/net/route.c Fri Feb 10 00:51:32 2012 (r231327) @@ -1502,10 +1502,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-8@FreeBSD.ORG Fri Feb 10 04:01:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690261065670; Fri, 10 Feb 2012 04:01:18 +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 55EC08FC16; Fri, 10 Feb 2012 04:01: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 q1A41IFu052543; Fri, 10 Feb 2012 04:01:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A41I9L052538; Fri, 10 Feb 2012 04:01:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202100401.q1A41I9L052538@svn.freebsd.org> From: Rick Macklem Date: Fri, 10 Feb 2012 04:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231332 - in stable/8/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:01:18 -0000 Author: rmacklem Date: Fri Feb 10 04:01:17 2012 New Revision: 231332 URL: http://svn.freebsd.org/changeset/base/231332 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/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clnode.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/nfsclient/nfs_bio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 04:01:17 2012 (r231332) @@ -469,7 +469,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); @@ -947,7 +947,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 @@ -1251,12 +1251,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); } @@ -1771,7 +1767,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/8/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 04:01:17 2012 (r231332) @@ -133,6 +133,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/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 04:01:17 2012 (r231332) @@ -189,6 +189,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/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/nfsclient/nfs_bio.c Fri Feb 10 04:01:17 2012 (r231332) @@ -467,7 +467,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); @@ -944,7 +944,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 @@ -1248,12 +1248,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); } @@ -1760,7 +1756,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-8@FreeBSD.ORG Fri Feb 10 04:10:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EC62106564A; Fri, 10 Feb 2012 04:10:13 +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 5CE498FC0C; Fri, 10 Feb 2012 04:10:13 +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 q1A4ADTl052872; Fri, 10 Feb 2012 04:10:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A4ADc2052870; Fri, 10 Feb 2012 04:10:13 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100410.q1A4ADc2052870@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 04:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231334 - stable/8/share/man/man7 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:10:13 -0000 Author: eadler Date: Fri Feb 10 04:10:13 2012 New Revision: 231334 URL: http://svn.freebsd.org/changeset/base/231334 Log: MFC r231111, r231331: ports(7) currently makes no mention of LOCALBASE: fix that PR: 159551 Approved by: gjb Modified: stable/8/share/man/man7/ports.7 Directory Properties: stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Fri Feb 10 04:08:22 2012 (r231333) +++ stable/8/share/man/man7/ports.7 Fri Feb 10 04:10:13 2012 (r231334) @@ -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-8@FreeBSD.ORG Fri Feb 10 06:02:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81506106564A; Fri, 10 Feb 2012 06:02:21 +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 5505A8FC13; Fri, 10 Feb 2012 06:02: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 q1A62Lg6056378; Fri, 10 Feb 2012 06:02:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A62L8X056376; Fri, 10 Feb 2012 06:02:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100602.q1A62L8X056376@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231337 - stable/8/usr.bin/top X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:02:21 -0000 Author: bz Date: Fri Feb 10 06:02:21 2012 New Revision: 231337 URL: http://svn.freebsd.org/changeset/base/231337 Log: MFC r224202: Constantly print the command name and if set include the thread name in per-thread mode. Discussed with: jhb Obtained from: Ed Maste at Sandvine Incorporated Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Fri Feb 10 05:05:42 2012 (r231336) +++ stable/8/usr.bin/top/machine.c Fri Feb 10 06:02:21 2012 (r231337) @@ -831,7 +831,8 @@ format_next_process(caddr_t handle, char if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_ocomm[0]) { - snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_ocomm); + snprintf(cmdbuf, cmdlengthdelta, "%s{%s}", pp->ki_comm, + pp->ki_ocomm); } else { snprintf(cmdbuf, cmdlengthdelta, "%s", pp->ki_comm); } @@ -843,7 +844,7 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_ocomm[0]) { snprintf(cmdbuf, cmdlengthdelta, - "{%s}", pp->ki_ocomm); + "[%s{%s}]", pp->ki_comm, pp->ki_ocomm); } else { snprintf(cmdbuf, cmdlengthdelta, "[%s]", pp->ki_comm); @@ -887,12 +888,23 @@ format_next_process(caddr_t handle, char dst--; *dst = '\0'; - if (strcmp(cmd, pp->ki_comm) != 0 ) - snprintf(cmdbuf, cmdlengthdelta, - "%s (%s)",argbuf, pp->ki_comm); - else - strlcpy(cmdbuf, argbuf, cmdlengthdelta); - + if (strcmp(cmd, pp->ki_comm) != 0 ) { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_ocomm[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s){%s}", argbuf, pp->ki_comm, + pp->ki_ocomm); + else + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s)", argbuf, pp->ki_comm); + } else { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_ocomm[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s{%s}", argbuf, pp->ki_ocomm); + else + strlcpy(cmdbuf, argbuf, cmdlengthdelta); + } free(argbuf); } } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 06:06:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981AA106566C; Fri, 10 Feb 2012 06:06:25 +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 864358FC12; Fri, 10 Feb 2012 06:06: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 q1A66PCf056578; Fri, 10 Feb 2012 06:06:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A66Pft056576; Fri, 10 Feb 2012 06:06:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100606.q1A66Pft056576@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231338 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:06:25 -0000 Author: bz Date: Fri Feb 10 06:06:25 2012 New Revision: 231338 URL: http://svn.freebsd.org/changeset/base/231338 Log: MFC r223259: Correct a typo in the function name. Modified: stable/8/share/man/man9/device_get_sysctl.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/device_get_sysctl.9 ============================================================================== --- stable/8/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:02:21 2012 (r231337) +++ stable/8/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:06:25 2012 (r231338) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2006 +.Dd June 18, 2011 .Dt DEVICE_GET_SYSCTL 9 .Os .Sh NAME @@ -49,7 +49,7 @@ This node can be accessed with the .Fn device_get_sysctl_tree function. The context for the node can be obtained with the -.Fn device_get_sysctl_ctl +.Fn device_get_sysctl_ctx function. .Sh SEE ALSO .Xr device 9 From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 06:12:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01BD106564A; Fri, 10 Feb 2012 06:12:48 +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 AEA208FC0A; Fri, 10 Feb 2012 06:12: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 q1A6CmOO056869; Fri, 10 Feb 2012 06:12:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6Cmin056867; Fri, 10 Feb 2012 06:12:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100612.q1A6Cmin056867@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231340 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:12:48 -0000 Author: bz Date: Fri Feb 10 06:12:48 2012 New Revision: 231340 URL: http://svn.freebsd.org/changeset/base/231340 Log: MFC r223334: Leave an extra comment about flowtable and IPv6 support rectifying a previous comment (r206024 in stable/8) to not forget things here in the future as well and merge the changes without conflicts. Modified: stable/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Fri Feb 10 06:06:30 2012 (r231339) +++ stable/8/sys/net/route.c Fri Feb 10 06:12:48 2012 (r231340) @@ -1188,6 +1188,7 @@ rtrequest1_fib(int req, struct rt_addrin rt0 = NULL; /* XXX * "flow-table" only support IPv4 at the moment. + * XXX-BZ as of r205066 it would support IPv6. */ #ifdef INET if (dst->sa_family == AF_INET) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 06:35:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FFD8106566C; Fri, 10 Feb 2012 06:35:15 +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 1D5C98FC19; Fri, 10 Feb 2012 06:35: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 q1A6ZEnE057726; Fri, 10 Feb 2012 06:35:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6ZEhX057724; Fri, 10 Feb 2012 06:35:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100635.q1A6ZEhX057724@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231343 - stable/8/sys/geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:35:15 -0000 Author: ae Date: Fri Feb 10 06:35:14 2012 New Revision: 231343 URL: http://svn.freebsd.org/changeset/base/231343 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/8/sys/geom/part/g_part_apm.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_apm.c ============================================================================== --- stable/8/sys/geom/part/g_part_apm.c Fri Feb 10 06:34:21 2012 (r231342) +++ stable/8/sys/geom/part/g_part_apm.c Fri Feb 10 06:35:14 2012 (r231343) @@ -231,6 +231,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); } @@ -437,9 +443,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); @@ -491,67 +497,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-8@FreeBSD.ORG Fri Feb 10 06:38:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DC71065674; Fri, 10 Feb 2012 06:38:58 +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 353CF8FC1E; Fri, 10 Feb 2012 06:38: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 q1A6cwWv057945; Fri, 10 Feb 2012 06:38:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6cwM0057943; Fri, 10 Feb 2012 06:38:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100638.q1A6cwM0057943@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231345 - stable/8/sys/geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:38:58 -0000 Author: ae Date: Fri Feb 10 06:38:57 2012 New Revision: 231345 URL: http://svn.freebsd.org/changeset/base/231345 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/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Feb 10 06:38:03 2012 (r231344) +++ stable/8/sys/geom/part/g_part.c Fri Feb 10 06:38:57 2012 (r231345) @@ -1144,6 +1144,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-8@FreeBSD.ORG Fri Feb 10 06:42:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3720106566B; Fri, 10 Feb 2012 06:42:01 +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 B7A738FC08; Fri, 10 Feb 2012 06:42: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 q1A6g17u058097; Fri, 10 Feb 2012 06:42:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6g1PI058085; Fri, 10 Feb 2012 06:42:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100642.q1A6g1PI058085@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:42:01 -0000 Author: bz Date: Fri Feb 10 06:42:00 2012 New Revision: 231346 URL: http://svn.freebsd.org/changeset/base/231346 Log: MFC r223735: Add infrastructure to allow all frames/packets received on an interface to be assigned to a non-default FIB instance. Submitted by: cjsp Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) (original versions) Reviewed by: julian Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: melifaro Added: stable/8/sbin/ifconfig/iffib.c - copied unchanged from r223735, head/sbin/ifconfig/iffib.c Modified: stable/8/sbin/ifconfig/Makefile stable/8/sbin/ifconfig/ifconfig.8 stable/8/share/man/man9/ifnet.9 stable/8/sys/kern/kern_jail.c stable/8/sys/net/if.c stable/8/sys/net/if.h stable/8/sys/net/if_debug.c stable/8/sys/net/if_var.h stable/8/sys/sys/priv.h stable/8/sys/sys/sockio.h Directory Properties: stable/8/sbin/ifconfig/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/ifconfig/Makefile ============================================================================== --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support SRCS+= ifclone.c # clone device support SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support +SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) @@ -294,6 +294,19 @@ Remove the interface from the given Fill interface index (lowermost 64bit of an IPv6 address) automatically. +.It Cm fib Ar fib_number +Specify interface FIB. +A FIB +.Ar fib_number +is assigned to all frames or packets received on that interface. +The FIB is not inherited, e.g. vlans or other sub-interfaces will use +the default FIB (0) irrespective of the parent interface's FIB. +The kernel needs to be tuned to support more than the default FIB +using the +.Va ROUTETABLES +kernel configuration option, or the +.Va net.fibs +tunable. .It Cm ipdst This is used to specify an Internet host who is willing to receive IP packets encapsulating IPX packets bound for a remote network. Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2011 Alexander V. Chernikov + * Copyright (c) 2011 Christian S.J. Peron + * Copyright (c) 2011 Bjoern A. Zeeb + * 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$ + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "ifconfig.h" + +static void +fib_status(int s) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) + return; + + /* Ignore if it is the default. */ + if (ifr.ifr_fib == 0) + return; + + printf("\tfib: %u\n", ifr.ifr_fib); +} + +static void +setiffib(const char *val, int dummy __unused, int s, + const struct afswtch *afp) +{ + unsigned long fib; + char *ep; + + fib = strtoul(val, &ep, 0); + if (*ep != '\0' || fib > UINT_MAX) { + warn("fib %s not valid", val); + return; + } + + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + ifr.ifr_fib = fib; + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) + warn("ioctl (SIOCSIFFIB)"); +} + +static struct cmd fib_cmds[] = { + DEF_CMD_ARG("fib", setiffib), +}; + +static struct afswtch af_fib = { + .af_name = "af_fib", + .af_af = AF_UNSPEC, + .af_other_status = fib_status, +}; + +static __constructor void +fib_ctor(void) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + size_t i; + + for (i = 0; i < N(fib_cmds); i++) + cmd_register(&fib_cmds[i]); + af_register(&af_fib); +#undef N +} Modified: stable/8/share/man/man9/ifnet.9 ============================================================================== --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2007 +.Dd July 3, 2011 .Dt IFNET 9 .Os .Sh NAME @@ -1156,11 +1156,12 @@ list. Caller must have appropriate privilege. (No call-down to driver.) .It Dv SIOCGIFCAP +.It Dv SIOCGIFFIB .It Dv SIOCGIFFLAGS .It Dv SIOCGIFMETRIC .It Dv SIOCGIFMTU .It Dv SIOCGIFPHYS -Get interface capabilities, flags, metric, MTU, medium selection. +Get interface capabilities, FIB, flags, metric, MTU, medium selection. (No call-down to driver.) .Pp .It Dv SIOCSIFCAP @@ -1179,6 +1180,12 @@ and .Va if_data.ifi_hwassist appropriately. .Pp +.It Dv SIOCSIFFIB +Sets interface FIB. +Caller must have appropriate privilege. +FIB values start at 0 and values greater or equals than +.Va net.fibs +are considered invalid. .It Dv SIOCSIFFLAGS Change interface flags. Caller must have appropriate privilege. Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in case PRIV_NET_LAGG: case PRIV_NET_GIF: case PRIV_NET_SETIFVNET: + case PRIV_NET_SETIFFIB: /* * 802.11-related privileges. Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) @@ -58,6 +58,8 @@ #include #include #include +#include + #include #include @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, free(odescrbuf, M_IFDESCR); break; + case SIOCGIFFIB: + ifr->ifr_fib = ifp->if_fib; + break; + + case SIOCSIFFIB: + error = priv_check(td, PRIV_NET_SETIFFIB); + if (error) + return (error); + if (ifr->ifr_fib >= rt_numfibs) + return (EINVAL); + + ifp->if_fib = ifr->ifr_fib; + break; + case SIOCSIFFLAGS: error = priv_check(td, PRIV_NET_SETIFFLAGS); if (error) Modified: stable/8/sys/net/if.h ============================================================================== --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) @@ -315,6 +315,7 @@ struct ifreq { int ifru_media; caddr_t ifru_data; int ifru_cap[2]; + u_int ifru_fib; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -331,6 +332,7 @@ struct ifreq { #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ Modified: stable/8/sys/net/if_debug.c ============================================================================== --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); IF_DB_PRINTF("%d", if_snd.altq_type); IF_DB_PRINTF("%x", if_snd.altq_flags); + IF_DB_PRINTF("%u", if_fib); #undef IF_DB_PRINTF } Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) @@ -207,7 +207,8 @@ struct ifnet { char if_cspare[3]; char *if_description; /* interface description */ void *if_pspare[7]; - int if_ispare[4]; + int if_ispare[3]; + u_int if_fib; /* interface FIB */ }; typedef void if_init_f_t(void *); Modified: stable/8/sys/sys/priv.h ============================================================================== --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) @@ -336,6 +336,7 @@ #define PRIV_NET_GIF 416 /* Administer gif interface. */ #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ /* * 802.11-related privileges. Modified: stable/8/sys/sys/sockio.h ============================================================================== --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) @@ -110,6 +110,9 @@ #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ + #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific parameters */ #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:19:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F55106566B; Fri, 10 Feb 2012 07:19:37 +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 520A58FC12; Fri, 10 Feb 2012 07:19:37 +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 q1A7Jb9N059554; Fri, 10 Feb 2012 07:19:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7JbVQ059545; Fri, 10 Feb 2012 07:19:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100719.q1A7JbVQ059545@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231352 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:19:37 -0000 Author: tuexen Date: Fri Feb 10 07:19:36 2012 New Revision: 231352 URL: http://svn.freebsd.org/changeset/base/231352 Log: MFC r216669: Improve plausibility check in sctp_handle_sack(). Allow cmt_on_off to support values 0 (no CMT), 1 (CMT), and 2 (CMT/RP). Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:19:36 2012 (r231352) @@ -76,12 +76,12 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_nets *net; /*- - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -242,7 +242,7 @@ sctp_cwnd_update_after_sack(struct sctp_ * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -262,10 +262,9 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -284,7 +283,7 @@ sctp_cwnd_update_after_sack(struct sctp_ * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -705,12 +704,12 @@ sctp_hs_cwnd_update_after_fr(struct sctp struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -863,7 +862,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -883,10 +882,9 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -905,7 +903,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -1349,7 +1347,7 @@ sctp_htcp_cwnd_update_after_sack(struct * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -1369,10 +1367,9 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -1391,7 +1388,7 @@ sctp_htcp_cwnd_update_after_sack(struct * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); measure_achieved_throughput(stcb, net); } else { @@ -1427,12 +1424,12 @@ sctp_htcp_cwnd_update_after_fr(struct sc struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:19:36 2012 (r231352) @@ -2476,7 +2476,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ ) { - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) && (stcb->asoc.send_sack == 0) && (stcb->asoc.numduptsns == 0) && @@ -3242,7 +3242,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* CMT DAC algo: finding out if SACK is a mixed SACK */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->saw_newack) @@ -3353,7 +3353,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to @@ -3419,7 +3419,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent++; } strike_flag = 1; - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If @@ -3480,7 +3480,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to @@ -3560,7 +3560,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t SCTP_STAT_INCR(sctps_sendmultfastretrans); } sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { /* * CMT: Using RTX_SSTHRESH policy for CMT. * If CMT is being used, then pick dest with @@ -4776,7 +4776,7 @@ sctp_handle_sack(struct mbuf *m, int off /*******************************************/ /* cancel ALL T3-send timer if accum moved */ /*******************************************/ - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->new_pseudo_cumack) sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, @@ -4797,10 +4797,7 @@ sctp_handle_sack(struct mbuf *m, int off /********************************************/ asoc->last_acked_seq = cum_ack; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - if (tp1 == NULL) - goto done_with_it; - do { + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack, MAX_TSN)) { break; @@ -4810,26 +4807,17 @@ sctp_handle_sack(struct mbuf *m, int off printf("Warning, tp1->sent == %d and its now acked?\n", tp1->sent); } - tp2 = TAILQ_NEXT(tp1, sctp_next); TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) asoc->pr_sctp_cnt--; } - if (TAILQ_EMPTY(&asoc->sent_queue) && - (asoc->total_flight > 0)) { -#ifdef INVARIANTS - panic("Warning flight size is postive and should be 0"); -#else - SCTP_PRINTF("Warning flight size incorrect should be 0 is %d\n", - asoc->total_flight); -#endif - asoc->total_flight = 0; - } + asoc->sent_queue_cnt--; if (tp1->data) { /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); + tp1->data = NULL; if (asoc->peer_supports_prsctp && PR_SCTP_BUF_ENABLED(tp1->flags)) { asoc->sent_queue_cnt_removeable--; } @@ -4842,14 +4830,18 @@ sctp_handle_sack(struct mbuf *m, int off 0, SCTP_LOG_FREE_SENT); } - tp1->data = NULL; - asoc->sent_queue_cnt--; sctp_free_a_chunk(stcb, tp1); wake_him++; - tp1 = tp2; - } while (tp1 != NULL); - -done_with_it: + } + if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { +#ifdef INVARIANTS + panic("Warning flight size is postive and should be 0"); +#else + SCTP_PRINTF("Warning flight size incorrect should be 0 is %d\n", + asoc->total_flight); +#endif + asoc->total_flight = 0; + } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -5077,7 +5069,7 @@ done_with_it: * to be done. Setting this_sack_lowest_newack to the cum_ack will * automatically ensure that. */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac) && (cmt_dac_flag == 0)) { this_sack_lowest_newack = cum_ack; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:19:36 2012 (r231352) @@ -623,7 +623,7 @@ sctp_handle_heartbeat_ack(struct sctp_he * timer is running, for the destination, stop the timer because a * PF-heartbeat was received. */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:19:36 2012 (r231352) @@ -3686,7 +3686,7 @@ sctp_lowlevel_chunk_output(struct sctp_i * Stop any running T3 * timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_OUTPUT1, "Destination %p moved from PF to unreachable.\n", @@ -7325,7 +7325,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb (net == stcb->asoc.primary_destination)) { /* ran dry for primary network net */ SCTP_STAT_INCR(sctps_primary_randry); - } else if (stcb->asoc.sctp_cmt_on_off == 1) { + } else if (stcb->asoc.sctp_cmt_on_off > 0) { /* ran dry with CMT on */ SCTP_STAT_INCR(sctps_cmt_randry); } @@ -7526,7 +7526,7 @@ sctp_med_chunk_output(struct sctp_inpcb *reason_code = 8; return (0); } - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { /* get the last start point */ start_at = asoc->last_net_cmt_send_started; if (start_at == NULL) { @@ -8028,7 +8028,7 @@ again_one_more_time: } } /* JRI: if dest is in PF state, do not send data to it */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && (net->dest_state & SCTP_ADDR_PF)) { goto no_data_fill; @@ -8036,7 +8036,7 @@ again_one_more_time: if (net->flight_size >= net->cwnd) { goto no_data_fill; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_RECV_BUFFER_SPLITTING) && (net->flight_size > max_rwnd_per_dest)) { goto no_data_fill; @@ -8047,7 +8047,7 @@ again_one_more_time: * net. For now, this is better than nothing and it disabled * by default... */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_SEND_BUFFER_SPLITTING) && (max_send_per_dest > 0) && (net->flight_size > max_send_per_dest)) { @@ -8268,7 +8268,7 @@ no_data_fill: * restart it. */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); - } else if ((asoc->sctp_cmt_on_off == 1) && + } else if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && pf_hbflag && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) && @@ -9576,7 +9576,7 @@ sctp_chunk_output(struct sctp_inpcb *inp */ if (net->ref_count > 1) sctp_move_chunks_from_net(stcb, net); - } else if ((asoc->sctp_cmt_on_off == 1) && + } else if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* @@ -10073,7 +10073,7 @@ sctp_send_sack(struct sctp_tcb *stcb) else flags = 0; - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /*- * CMT DAC algorithm: If 2 (i.e., 0x10) packets have been Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:19:36 2012 (r231352) @@ -325,9 +325,9 @@ struct sctp_sysctl { #define SCTPCTL_OUTGOING_STREAMS_DEFAULT SCTP_OSTREAM_INITIAL /* cmt_on_off: CMT on/off flag */ -#define SCTPCTL_CMT_ON_OFF_DESC "CMT on/off flag" +#define SCTPCTL_CMT_ON_OFF_DESC "CMT settings" #define SCTPCTL_CMT_ON_OFF_MIN 0 -#define SCTPCTL_CMT_ON_OFF_MAX 1 +#define SCTPCTL_CMT_ON_OFF_MAX 2 #define SCTPCTL_CMT_ON_OFF_DEFAULT 0 /* EY - nr_sack_on_off: NR_SACK on/off flag */ Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 07:19:36 2012 (r231352) @@ -215,7 +215,7 @@ sctp_threshold_management(struct sctp_in * not in PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", @@ -850,7 +850,7 @@ start_again: /* * CMT: Do not allow FRs on retransmitted TSNs. */ - if (stcb->asoc.sctp_cmt_on_off == 1) { + if (stcb->asoc.sctp_cmt_on_off > 0) { chk->no_fr_allowed = 1; } #ifdef THIS_SHOULD_NOT_BE_DONE @@ -1005,7 +1005,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * addition, find an alternate destination with PF-based * find_alt_net(). */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) { net->dest_state |= SCTP_ADDR_PF; @@ -1014,7 +1014,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net); } alt = sctp_find_alternate_net(stcb, net, 2); - } else if (stcb->asoc.sctp_cmt_on_off == 1) { + } else if (stcb->asoc.sctp_cmt_on_off > 0) { /* * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being * used, then pick dest with largest ssthresh for any @@ -1129,7 +1129,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net->dest_state |= SCTP_ADDR_WAS_PRIMARY; } } - } else if ((stcb->asoc.sctp_cmt_on_off == 1) && + } else if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:19:36 2012 (r231352) @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", @@ -2840,17 +2840,17 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { - if (av->assoc_value != 0) - stcb->asoc.sctp_cmt_on_off = 1; - else - stcb->asoc.sctp_cmt_on_off = 0; + stcb->asoc.sctp_cmt_on_off = av->assoc_value; + if (stcb->asoc.sctp_cmt_on_off > 2) { + stcb->asoc.sctp_cmt_on_off = 2; + } SCTP_TCB_UNLOCK(stcb); } else { SCTP_INP_WLOCK(inp); - if (av->assoc_value != 0) - inp->sctp_cmt_on_off = 1; - else - inp->sctp_cmt_on_off = 0; + inp->sctp_cmt_on_off = av->assoc_value; + if (inp->sctp_cmt_on_off > 2) { + inp->sctp_cmt_on_off = 2; + } SCTP_INP_WUNLOCK(inp); } } else { Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 07:19:36 2012 (r231352) @@ -426,7 +426,7 @@ sctp6_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:21:30 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B490106564A; Fri, 10 Feb 2012 07:21:30 +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 F350E8FC08; Fri, 10 Feb 2012 07:21: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 q1A7LTIp059664; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7LTQt059661; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100721.q1A7LTQt059661@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231353 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:21:30 -0000 Author: tuexen Date: Fri Feb 10 07:21:29 2012 New Revision: 231353 URL: http://svn.freebsd.org/changeset/base/231353 Log: MFC r216672: Provide a possibility to configure the inital congestion window to the value defined in RFC 4960. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:21:29 2012 (r231353) @@ -52,15 +52,19 @@ sctp_set_initial_cc_param(struct sctp_tc uint32_t cwnd_in_mtu; assoc = &stcb->asoc; - /* - * We take the minimum of the burst limit and the initial congestion - * window. The initial congestion window is at least two times the - * MTU. - */ cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); - if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) - cwnd_in_mtu = assoc->max_burst; - net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + if (cwnd_in_mtu == 0) { + /* Using 0 means that the value of RFC 4960 is used. */ + net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit and the initial + * congestion window. + */ + if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) + cwnd_in_mtu = assoc->max_burst; + net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } net->ssthresh = assoc->peers_rwnd; if (SCTP_BASE_SYSCTL(sctp_logging_level) & Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:21:29 2012 (r231353) @@ -500,7 +500,7 @@ struct sctp_sysctl { /* Initial congestion window in MTU */ #define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" -#define SCTPCTL_INITIAL_CWND_MIN 1 +#define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:23:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E852D106566C; Fri, 10 Feb 2012 07:23:42 +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 BC51D8FC0A; Fri, 10 Feb 2012 07:23: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 q1A7NgiT059789; Fri, 10 Feb 2012 07:23:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7NgdR059785; Fri, 10 Feb 2012 07:23:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100723.q1A7NgdR059785@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231354 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:23:43 -0000 Author: tuexen Date: Fri Feb 10 07:23:42 2012 New Revision: 231354 URL: http://svn.freebsd.org/changeset/base/231354 Log: MFC r216821: Fix three bugs related to the sequence number wrap-around affecting the processing of ECNE and ASCONF chunks. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:23:42 2012 (r231354) @@ -632,7 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_SEQ) || + if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || serial_num == asoc->asconf_seq_in) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:23:42 2012 (r231354) @@ -2946,7 +2946,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_SEQ)) + if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) break; lchk = TAILQ_NEXT(lchk, sctp_next); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:23:42 2012 (r231354) @@ -6477,7 +6477,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_SEQ)) { + if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_TSN)) { /* Not Acked yet */ break; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:26:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A778106564A; Fri, 10 Feb 2012 07:26:46 +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 EB7A58FC0C; Fri, 10 Feb 2012 07:26: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 q1A7QjHr059931; Fri, 10 Feb 2012 07:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7Qj3P059925; Fri, 10 Feb 2012 07:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100726.q1A7Qj3P059925@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231355 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:26:46 -0000 Author: tuexen Date: Fri Feb 10 07:26:45 2012 New Revision: 231355 URL: http://svn.freebsd.org/changeset/base/231355 Log: MFC r216822: Code cleanup: Use LIST_FOREACH, LIST_FOREACH_SAFE, TAILQ_FOREACH, TAILQ_FOREACH_SAFE where appropriate. No functional change. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:26:45 2012 (r231355) @@ -656,19 +656,16 @@ sctp_handle_asconf(struct mbuf *m, unsig /* delete old cache */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); - ack = TAILQ_FIRST(&stcb->asoc.asconf_ack_sent); - while (ack != NULL) { - ack_next = TAILQ_NEXT(ack, next); + TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) break; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: delete old(%u) < first(%u)\n", ack->serial_number, serial_num); - TAILQ_REMOVE(&stcb->asoc.asconf_ack_sent, ack, next); + TAILQ_REMOVE(&asoc->asconf_ack_sent, ack, next); if (ack->data != NULL) { sctp_m_freem(ack->data); } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack); - ack = ack_next; } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, @@ -1264,9 +1261,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * struct sockaddr *sa; /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, &ifa->address.sa) == 0) continue; @@ -1480,9 +1475,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ return (-1); } /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, sa) == 0) continue; @@ -1836,9 +1829,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i */ if (last_error_id == 0) last_error_id--;/* set to "max" value */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { if (aa->sent == 1) { /* * implicitly successful or failed if correlation_id @@ -2098,14 +2089,11 @@ sctp_asconf_iterator_ep_end(struct sctp_ } } } else if (l->action == SCTP_DEL_IP_ADDRESS) { - laddr = LIST_FIRST(&inp->sctp_addr_list); - while (laddr) { - nladdr = LIST_NEXT(laddr, sctp_nxt_addr); + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { /* remove only after all guys are done */ if (laddr->ifa == ifa) { sctp_del_local_addr_ep(inp, ifa); } - laddr = nladdr; } } } @@ -2285,12 +2273,10 @@ sctp_asconf_iterator_end(void *ptr, uint { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; - struct sctp_laddr *l, *l_next; + struct sctp_laddr *l, *nl; asc = (struct sctp_asconf_iterator *)ptr; - l = LIST_FIRST(&asc->list_of_work); - while (l != NULL) { - l_next = LIST_NEXT(l, sctp_nxt_addr); + LIST_FOREACH_SAFE(l, &asc->list_of_work, sctp_nxt_addr, nl) { ifa = l->ifa; if (l->action == SCTP_ADD_IP_ADDRESS) { /* Clear the defer use flag */ @@ -2299,7 +2285,6 @@ sctp_asconf_iterator_end(void *ptr, uint sctp_free_ifa(ifa); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), l); SCTP_DECR_LADDR_COUNT(); - l = l_next; } SCTP_FREE(asc, SCTP_M_ASC_IT); } @@ -2394,11 +2379,7 @@ sctp_is_addr_pending(struct sctp_tcb *st add_cnt = del_cnt = 0; last_param_type = 0; - for (chk = TAILQ_FIRST(&stcb->asoc.asconf_send_queue); chk != NULL; - chk = nchk) { - /* get next chk */ - nchk = TAILQ_NEXT(chk, sctp_next); - + TAILQ_FOREACH_SAFE(chk, &stcb->asoc.asconf_send_queue, sctp_next, nchk) { if (chk->data == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: No mbuf data?\n"); continue; Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 07:26:45 2012 (r231355) @@ -77,9 +77,9 @@ static int __sctp_thread_based_iterator_ static void sctp_cleanup_itqueue(void) { - struct sctp_iterator *it; + struct sctp_iterator *it, *nit; - while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { + TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:26:45 2012 (r231355) @@ -344,13 +344,12 @@ sctp_mark_non_revokable(struct sctp_asso static void sctp_service_reassembly(struct sctp_tcb *stcb, struct sctp_association *asoc) { - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *nchk; uint16_t nxt_todel; uint16_t stream_no; int end = 0; int cntDel; - - struct sctp_queued_to_read *control, *ctl, *ctlat; + struct sctp_queued_to_read *control, *ctl, *nctl; if (stcb == NULL) return; @@ -362,8 +361,7 @@ sctp_service_reassembly(struct sctp_tcb /* socket above is long gone or going.. */ abandon: asoc->fragmented_delivery_inprogress = 0; - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); asoc->size_on_reasm_queue -= chk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); @@ -378,16 +376,11 @@ abandon: /* Now free the address and data */ sctp_free_a_chunk(stcb, chk); /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); } return; } SCTP_TCB_LOCK_ASSERT(stcb); - do { - chk = TAILQ_FIRST(&asoc->reasmqueue); - if (chk == NULL) { - return; - } + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { if (chk->rec.data.TSN_seq != (asoc->tsn_last_delivered + 1)) { /* Can't deliver more :< */ return; @@ -496,33 +489,26 @@ abandon: strm = &asoc->strmin[stream_no]; nxt_todel = strm->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strm->inqueue); - if (ctl && (nxt_todel == ctl->sinfo_ssn)) { - while (ctl != NULL) { - /* Deliver more if we can. */ - if (nxt_todel == ctl->sinfo_ssn) { - ctlat = TAILQ_NEXT(ctl, next); - TAILQ_REMOVE(&strm->inqueue, ctl, next); - asoc->size_on_all_streams -= ctl->length; - sctp_ucount_decr(asoc->cnt_on_all_streams); - strm->last_sequence_delivered++; - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, - &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - ctl = ctlat; - } else { - break; - } - nxt_todel = strm->last_sequence_delivered + 1; + TAILQ_FOREACH_SAFE(ctl, &strm->inqueue, next, nctl) { + /* Deliver more if we can. */ + if (nxt_todel == ctl->sinfo_ssn) { + TAILQ_REMOVE(&strm->inqueue, ctl, next); + asoc->size_on_all_streams -= ctl->length; + sctp_ucount_decr(asoc->cnt_on_all_streams); + strm->last_sequence_delivered++; + sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_add_to_readq(stcb->sctp_ep, stcb, + ctl, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } else { + break; } + nxt_todel = strm->last_sequence_delivered + 1; } break; } - /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - } while (chk); + } } /* @@ -626,12 +612,10 @@ protocol_error: control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = TAILQ_FIRST(&strm->inqueue); - while (control != NULL) { + TAILQ_FOREACH_SAFE(control, &strm->inqueue, next, at) { /* all delivered */ nxt_todel = strm->last_sequence_delivered + 1; if (nxt_todel == control->sinfo_ssn) { - at = TAILQ_NEXT(control, next); TAILQ_REMOVE(&strm->inqueue, control, next); asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); @@ -652,7 +636,6 @@ protocol_error: &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = at; continue; } break; @@ -756,7 +739,7 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (0); } tsn = chk->rec.data.TSN_seq; - while (chk) { + TAILQ_FOREACH(chk, &asoc->reasmqueue, sctp_next) { if (tsn != chk->rec.data.TSN_seq) { return (0); } @@ -765,7 +748,6 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (1); } tsn++; - chk = TAILQ_NEXT(chk, sctp_next); } return (0); } @@ -2090,14 +2072,14 @@ failed_pdapi_express_del: /* first one on */ TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); } else { - struct sctp_queued_to_read *ctlOn; + struct sctp_queued_to_read *ctlOn, + *nctlOn; unsigned char inserted = 0; - ctlOn = TAILQ_FIRST(&asoc->pending_reply_queue); - while (ctlOn) { + TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { if (compare_with_wrap(control->sinfo_tsn, ctlOn->sinfo_tsn, MAX_TSN)) { - ctlOn = TAILQ_NEXT(ctlOn, next); + continue; } else { /* found it */ TAILQ_INSERT_BEFORE(ctlOn, control, next); @@ -2166,27 +2148,27 @@ finish_express_del: * pending_reply space 3: distribute any chunks in * pending_reply_queue. */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ liste = TAILQ_FIRST(&asoc->resetHead); - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); - if (ctl && (liste == NULL)) { + if (TAILQ_EMPTY(&asoc->resetHead)) { /* All can be removed */ - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag); if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } - } else if (ctl) { - /* more than one in queue */ - while (!compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + } else { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { + if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + break; + } /* * if ctl->sinfo_tsn is <= liste->tsn we can * process it which is the NOT of @@ -2197,7 +2179,6 @@ finish_express_del: if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } } /* @@ -3143,8 +3124,7 @@ sctp_check_for_revoked(struct sctp_tcb * struct sctp_tmit_chunk *tp1; int tot_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, MAX_TSN)) { /* @@ -3196,7 +3176,6 @@ sctp_check_for_revoked(struct sctp_tcb * } if (tp1->sent == SCTP_DATAGRAM_UNSENT) break; - tp1 = TAILQ_NEXT(tp1, sctp_next); } if (tot_revoked > 0) { /* @@ -3252,12 +3231,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (stcb->asoc.peer_supports_prsctp) { (void)SCTP_GETTIME_TIMEVAL(&now); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { strike_flag = 0; if (tp1->no_fr_allowed) { /* this one had a timeout or something */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { @@ -3283,7 +3260,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), SCTP_SO_NOT_LOCKED); } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3300,7 +3276,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t /* Continue strikin FWD-TSN chunks */ tp1->rec.data.fwd_tsn_cnt++; } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3313,7 +3288,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * CMT, no data sent to this dest can be marked for * FR using this SACK. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { @@ -3325,7 +3299,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this SACK. This step covers part of the DAC algo * and the HTNA algo as well. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3546,7 +3519,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* Make sure to flag we had a FR */ tp1->whoTo->net_ack++; - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3660,8 +3632,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t atomic_add_int(&alt->ref_count, 1); } } - tp1 = TAILQ_NEXT(tp1, sctp_next); - } /* while (tp1) */ + } if (tot_retrans > 0) { /* @@ -3686,8 +3657,7 @@ sctp_try_advance_peer_ack_point(struct s if (asoc->peer_supports_prsctp == 0) { return (NULL); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && tp1->sent != SCTP_DATAGRAM_RESEND) { /* no chance to advance, out of here */ @@ -3711,7 +3681,6 @@ sctp_try_advance_peer_ack_point(struct s (void)SCTP_GETTIME_TIMEVAL(&now); now_filled = 1; } - tp2 = TAILQ_NEXT(tp1, sctp_next); /* * now we got a chunk which is marked for another * retransmission to a PR-stream but has run out its chances @@ -3763,11 +3732,6 @@ sctp_try_advance_peer_ack_point(struct s */ break; } - /* - * If we hit here we just dumped tp1, move to next tsn on - * sent queue. - */ - tp1 = tp2; } return (a_adv); } @@ -3961,9 +3925,7 @@ sctp_express_handle_sack(struct sctp_tcb stcb->asoc.overall_error_count = 0; if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { - tp2 = TAILQ_NEXT(tp1, sctp_next); + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, MAX_TSN) || cumack == tp1->rec.data.TSN_seq) { @@ -4051,6 +4013,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); + tp1->data = NULL; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, @@ -4060,10 +4023,8 @@ sctp_express_handle_sack(struct sctp_tcb 0, SCTP_LOG_FREE_SENT); } - tp1->data = NULL; asoc->sent_queue_cnt--; sctp_free_a_chunk(stcb, tp1); - tp1 = tp2; } else { break; } @@ -4612,8 +4573,7 @@ sctp_handle_sack(struct mbuf *m, int off net->will_exit_fast_recovery = 0; } /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, MAX_TSN) || last_tsn == tp1->rec.data.TSN_seq) { @@ -4725,7 +4685,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { break; } - tp1 = TAILQ_NEXT(tp1, sctp_next); } biggest_tsn_newly_acked = biggest_tsn_acked = last_tsn; /* always set this up to cum-ack */ @@ -4899,36 +4858,32 @@ sctp_handle_sack(struct mbuf *m, int off } else if (asoc->saw_sack_with_frags) { int cnt_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - if (tp1 != NULL) { - /* Peer revoked all dg's marked or acked */ - TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (tp1->sent == SCTP_DATAGRAM_ACKED) { - tp1->sent = SCTP_DATAGRAM_SENT; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, - tp1->whoTo->flight_size, - tp1->book_size, - (uintptr_t) tp1->whoTo, - tp1->rec.data.TSN_seq); - } - sctp_flight_size_increase(tp1); - sctp_total_flight_increase(stcb, tp1); - tp1->rec.data.chunk_was_revoked = 1; - /* - * To ensure that this increase in - * flightsize, which is artificial, - * does not throttle the sender, we - * also increase the cwnd - * artificially. - */ - tp1->whoTo->cwnd += tp1->book_size; - cnt_revoked++; + /* Peer revoked all dg's marked or acked */ + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { + if (tp1->sent == SCTP_DATAGRAM_ACKED) { + tp1->sent = SCTP_DATAGRAM_SENT; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, + tp1->whoTo->flight_size, + tp1->book_size, + (uintptr_t) tp1->whoTo, + tp1->rec.data.TSN_seq); } + sctp_flight_size_increase(tp1); + sctp_total_flight_increase(stcb, tp1); + tp1->rec.data.chunk_was_revoked = 1; + /* + * To ensure that this increase in + * flightsize, which is artificial, does not + * throttle the sender, we also increase the + * cwnd artificially. + */ + tp1->whoTo->cwnd += tp1->book_size; + cnt_revoked++; } - if (cnt_revoked) { - reneged_all = 1; - } + } + if (cnt_revoked) { + reneged_all = 1; } asoc->saw_sack_with_frags = 0; } @@ -5346,9 +5301,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * First deliver anything prior to and including the stream no that * came in */ - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || (tt == ctl->sinfo_ssn)) { /* this is deliverable now */ @@ -5367,16 +5320,13 @@ sctp_kick_prsctp_reorder_queue(struct sc /* no more delivery now. */ break; } - ctl = nctl; } /* * now we must deliver things in queue the normal way if any are * now ready. */ tt = strmin->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (tt == ctl->sinfo_ssn) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); @@ -5396,7 +5346,6 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { break; } - ctl = nctl; } } @@ -5405,87 +5354,73 @@ sctp_flush_reassm_for_str_seq(struct sct struct sctp_association *asoc, uint16_t stream, uint16_t seq) { - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. + * Do not toss it if on a different stream or marked for + * unordered delivery in which case the stream sequence + * number has no meaning. */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - /* - * Do not toss it if on a different stream or marked - * for unordered delivery in which case the stream - * sequence number has no meaning. - */ - if ((chk->rec.data.stream_number != stream) || - ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { - chk = at; - continue; + if ((chk->rec.data.stream_number != stream) || + ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { + continue; + } + if (chk->rec.data.stream_seq == seq) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; } - if (chk->rec.data.stream_seq == seq) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { - /* - * If the stream_seq is > than the purging - * one, we are done + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - chk = at; + sctp_free_a_chunk(stcb, chk); + } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + /* + * If the stream_seq is > than the purging one, we + * are done + */ + break; } } } @@ -5524,7 +5459,7 @@ sctp_handle_forward_tsn(struct sctp_tcb unsigned int i, fwd_sz, cumack_set_flag, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; cumack_set_flag = 0; @@ -5618,77 +5553,64 @@ sctp_handle_forward_tsn(struct sctp_tcb if (asoc->fragmented_delivery_inprogress) { sctp_service_reassembly(stcb, asoc); } - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ - /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. - */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else { - /* - * Ok we have gone beyond the end of the - * fwd-tsn's mark. + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { + if ((compare_with_wrap(new_cum_tsn, + chk->rec.data.TSN_seq, MAX_TSN)) || + (new_cum_tsn == chk->rec.data.TSN_seq)) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; + } + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; } - chk = at; + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + sctp_free_a_chunk(stcb, chk); + } else { + /* + * Ok we have gone beyond the end of the fwd-tsn's + * mark. + */ + break; } } /*******************************************************/ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:26:45 2012 (r231355) @@ -193,7 +193,7 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp; + struct sctp_stream_queue_pending *sp, *nsp; struct sctp_stream_out *strq; struct sctp_association *asoc; @@ -205,15 +205,9 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - if (!TAILQ_EMPTY(&asoc->out_wheel)) { - /* Check to see if some data queued */ - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - is_there_another: - /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - continue; - } + TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { + /* sa_ignore FREED_MEMORY */ + TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -230,7 +224,7 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); @@ -241,10 +235,9 @@ sctp_is_there_unsent_data(struct sctp_tc sp->data = NULL; } sctp_free_a_strmoq(stcb, sp); - goto is_there_another; } else { unsent_data++; - continue; + break; } } } @@ -280,38 +273,32 @@ sctp_process_init(struct sctp_init_chunk if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) { unsigned int newcnt; struct sctp_stream_out *outs; - struct sctp_stream_queue_pending *sp; - struct sctp_tmit_chunk *chk, *chk_next; + struct sctp_stream_queue_pending *sp, *nsp; + struct sctp_tmit_chunk *chk, *nchk; /* abandon the upper streams */ newcnt = ntohs(init->num_inbound_streams); - if (!TAILQ_EMPTY(&asoc->send_queue)) { - chk = TAILQ_FIRST(&asoc->send_queue); - while (chk) { - chk_next = TAILQ_NEXT(chk, sctp_next); - if (chk->rec.data.stream_number >= newcnt) { - TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); - asoc->send_queue_cnt--; - if (chk->data != NULL) { - sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } + TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { + if (chk->rec.data.stream_number >= newcnt) { + TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); + asoc->send_queue_cnt--; + if (chk->data != NULL) { + sctp_free_bufspace(stcb, asoc, chk, 1); + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); - /* sa_ignore FREED_MEMORY */ } - chk = chk_next; + sctp_free_a_chunk(stcb, chk); + /* sa_ignore FREED_MEMORY */ } } if (asoc->strmout) { for (i = newcnt; i < asoc->pre_open_streams; i++) { outs = &asoc->strmout[i]; - sp = TAILQ_FIRST(&outs->outqueue); - while (sp) { + TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, @@ -328,7 +315,6 @@ sctp_process_init(struct sctp_init_chunk /* Free the chunk */ sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&outs->outqueue); } } } @@ -355,18 +341,16 @@ sctp_process_init(struct sctp_init_chunk if (asoc->strmin != NULL) { /* Free the old ones */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; for (i = 0; i < asoc->streamincnt; i++) { - ctl = TAILQ_FIRST(&asoc->strmin[i].inqueue); - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[i].inqueue, next, nctl) { TAILQ_REMOVE(&asoc->strmin[i].inqueue, ctl, next); sctp_free_remote_addr(ctl->whoFrom); ctl->whoFrom = NULL; sctp_m_freem(ctl->data); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:28:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E10106564A; Fri, 10 Feb 2012 07:28:38 +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 856808FC0C; Fri, 10 Feb 2012 07:28: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 q1A7ScP7060038; Fri, 10 Feb 2012 07:28:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7ScvS060030; Fri, 10 Feb 2012 07:28:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100728.q1A7ScvS060030@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231356 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:28:38 -0000 Author: tuexen Date: Fri Feb 10 07:28:37 2012 New Revision: 231356 URL: http://svn.freebsd.org/changeset/base/231356 Log: MFC 216825: Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros and use them instead of the generic compare_with_wrap. Retire compare_with_wrap. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:28:37 2012 (r231356) @@ -632,8 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || - serial_num == asoc->asconf_seq_in) { + if (SCTP_TSN_GE(asoc->asconf_seq_in, serial_num)) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: got duplicate serial number = %xh\n", Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:28:37 2012 (r231356) @@ -322,7 +322,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_VERSION_NUMBER 0x3 #define MAX_TSN 0xffffffff -#define MAX_SEQ 0xffff /* how many executions every N tick's */ #define SCTP_ITERATOR_MAX_AT_ONCE 20 @@ -906,10 +905,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAX_DATA_BUNDLING 256 /* modular comparison */ -/* True if a > b (mod = M) */ -#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ - ((b > a) && ((b - a) > ((M >> 1) + 1)))) - +/* See RFC 1982 for details. */ +#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ + ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) +#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ + ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:28:37 2012 (r231356) @@ -298,7 +298,7 @@ sctp_mark_non_revokable(struct sctp_asso return; } cumackp1 = asoc->cumulative_tsn + 1; - if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + if (SCTP_TSN_GT(cumackp1, tsn)) { /* * this tsn is behind the cum ack and thus we don't need to * worry about it being moved from one to the other. @@ -315,13 +315,12 @@ sctp_mark_non_revokable(struct sctp_asso } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == asoc->highest_tsn_inside_map) { /* We must back down to see what the new highest is */ - for (i = tsn - 1; (compare_with_wrap(i, asoc->mapping_array_base_tsn, MAX_TSN) || - (i == asoc->mapping_array_base_tsn)); i--) { + for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { asoc->highest_tsn_inside_map = i; @@ -558,9 +557,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) control->sinfo_stream, (uint32_t) strm->last_sequence_delivered, (uint32_t) nxt_todel); - if (compare_with_wrap(strm->last_sequence_delivered, - control->sinfo_ssn, MAX_SEQ) || - (strm->last_sequence_delivered == control->sinfo_ssn)) { + if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); @@ -646,9 +643,7 @@ protocol_error: * Ok, we did not deliver this guy, find the correct place * to put it on the queue. */ - if ((compare_with_wrap(asoc->cumulative_tsn, - control->sinfo_tsn, MAX_TSN)) || - (control->sinfo_tsn == asoc->cumulative_tsn)) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, control->sinfo_tsn)) { goto protocol_error; } if (TAILQ_EMPTY(&strm->inqueue)) { @@ -659,8 +654,7 @@ protocol_error: TAILQ_INSERT_HEAD(&strm->inqueue, control, next); } else { TAILQ_FOREACH(at, &strm->inqueue, next) { - if (compare_with_wrap(at->sinfo_ssn, - control->sinfo_ssn, MAX_SEQ)) { + if (SCTP_SSN_GT(at->sinfo_ssn, control->sinfo_ssn)) { /* * one in queue is bigger than the * new one, insert before this one @@ -991,8 +985,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } /* Find its place */ TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(at->rec.data.TSN_seq, - chk->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(at->rec.data.TSN_seq, chk->rec.data.TSN_seq)) { /* * one in queue is bigger than the new one, insert * before this one @@ -1383,8 +1376,7 @@ sctp_does_tsn_belong_to_reasm(struct sct uint32_t tsn_est; TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(TSN_seq, - at->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(TSN_seq, at->rec.data.TSN_seq)) { /* is it one bigger? */ tsn_est = at->rec.data.TSN_seq + 1; if (tsn_est == TSN_seq) { @@ -1467,8 +1459,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } SCTP_LTRACE_CHK(stcb->sctp_ep, stcb, ch->ch.chunk_type, tsn); - if (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN) || - asoc->cumulative_tsn == tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* It is a duplicate */ SCTP_STAT_INCR(sctps_recvdupdata); if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) { @@ -1492,7 +1483,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } } - if (compare_with_wrap(tsn, *high_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, *high_tsn)) { *high_tsn = tsn; } /* See if we have received this one already */ @@ -1564,8 +1555,8 @@ sctp_process_a_data_chunk(struct sctp_tc #endif } /* now is it in the mapping array of what we have accepted? */ - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { /* Nope not in the valid range dump it */ sctp_set_rwnd(stcb, asoc); if ((asoc->cnt_on_all_streams + @@ -1610,7 +1601,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_STAT_INCR(sctps_badsid); SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == (asoc->cumulative_tsn + 1)) { @@ -1646,9 +1637,7 @@ sctp_process_a_data_chunk(struct sctp_tc if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && (TAILQ_EMPTY(&asoc->resetHead)) && (chunk_flags & SCTP_DATA_UNORDERED) == 0 && - (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered, - strmseq, MAX_SEQ) || - asoc->strmin[strmno].last_sequence_delivered == strmseq)) { + SCTP_SSN_GE(asoc->strmin[strmno].last_sequence_delivered, strmseq)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); @@ -1759,7 +1748,7 @@ sctp_process_a_data_chunk(struct sctp_tc goto failed_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -1813,7 +1802,7 @@ failed_express_del: goto failed_pdapi_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } SCTP_STAT_INCR(sctps_recvexpressm); @@ -1847,12 +1836,12 @@ failed_pdapi_express_del: control = NULL; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } } else { SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map)) { asoc->highest_tsn_inside_map = tsn; } } @@ -2062,8 +2051,7 @@ failed_pdapi_express_del: * singletons I must worry about. */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(tsn, liste->tsn, MAX_TSN))) - ) { + SCTP_TSN_GT(tsn, liste->tsn)) { /* * yep its past where we need to reset... go * ahead and queue it. @@ -2077,8 +2065,7 @@ failed_pdapi_express_del: unsigned char inserted = 0; TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { - if (compare_with_wrap(control->sinfo_tsn, - ctlOn->sinfo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(control->sinfo_tsn, ctlOn->sinfo_tsn)) { continue; } else { /* found it */ @@ -2139,9 +2126,7 @@ finish_express_del: } /* check the special flag for stream resets */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(asoc->cumulative_tsn, liste->tsn, MAX_TSN)) || - (asoc->cumulative_tsn == liste->tsn)) - ) { + SCTP_TSN_GE(asoc->cumulative_tsn, liste->tsn)) { /* * we have finished working through the backlogged TSN's now * time to reset streams. 1: call reset function. 2: free @@ -2166,7 +2151,7 @@ finish_express_del: } } else { TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + if (SCTP_TSN_GT(ctl->sinfo_tsn, liste->tsn)) { break; } /* @@ -2275,8 +2260,8 @@ sctp_slide_mapping_arrays(struct sctp_tc } asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - 1); - if (compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map)) { #ifdef INVARIANTS panic("huh, cumack 0x%x greater than high-tsn 0x%x in map", asoc->cumulative_tsn, asoc->highest_tsn_inside_map); @@ -2291,9 +2276,7 @@ sctp_slide_mapping_arrays(struct sctp_tc asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn; #endif } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2411,9 +2394,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i uint32_t highest_tsn; asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2439,7 +2420,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i int is_a_gap; /* is there a gap now ? */ - is_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * CMT DAC algorithm: increase number of packets received @@ -2576,12 +2557,12 @@ sctp_process_data(struct mbuf **mm, int m = *mm; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * setup where we got the last DATA packet from for any SACK that * may need to go out. Don't bump the net. This is done ONLY when a @@ -2889,8 +2870,8 @@ sctp_process_segment_range(struct sctp_t * via previous Gap Ack Blocks... * i.e. ACKED or RESEND. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - *biggest_newly_acked_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + *biggest_newly_acked_tsn)) { *biggest_newly_acked_tsn = tp1->rec.data.TSN_seq; } /*- @@ -2903,9 +2884,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->rec.data.chunk_was_revoked == 0) tp1->whoTo->saw_newack = 1; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { tp1->whoTo->this_sack_highest_newack = tp1->rec.data.TSN_seq; } @@ -2989,9 +2969,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->sent <= SCTP_DATAGRAM_RESEND) { (*ecn_seg_sums) += tp1->rec.data.ect_nonce; (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - stcb->asoc.this_sack_highest_gap, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + stcb->asoc.this_sack_highest_gap)) { stcb->asoc.this_sack_highest_gap = tp1->rec.data.TSN_seq; } @@ -3031,10 +3010,9 @@ sctp_process_segment_range(struct sctp_t } break; } /* if (tp1->TSN_seq == theTSN) */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, theTSN, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, theTSN)) { break; - + } tp1 = TAILQ_NEXT(tp1, sctp_next); if ((tp1 == NULL) && (circled == 0)) { circled++; @@ -3092,7 +3070,7 @@ sctp_handle_segments(struct mbuf *m, int /* This gap report is not in order, so restart. */ tp1 = TAILQ_FIRST(&asoc->sent_queue); } - if (compare_with_wrap((last_tsn + frag_end), *biggest_tsn_acked, MAX_TSN)) { + if (SCTP_TSN_GT((last_tsn + frag_end), *biggest_tsn_acked)) { *biggest_tsn_acked = last_tsn + frag_end; } if (i < num_seg) { @@ -3125,19 +3103,16 @@ sctp_check_for_revoked(struct sctp_tcb * int tot_revoked = 0; TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cumack)) { /* * ok this guy is either ACK or MARKED. If it is * ACKED it has been previously acked but not this * time i.e. revoked. If it is MARKED it was ACK'ed * again. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked)) { break; - - + } if (tp1->sent == SCTP_DATAGRAM_ACKED) { /* it has been revoked */ tp1->sent = SCTP_DATAGRAM_SENT; @@ -3244,8 +3219,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent, SCTP_FR_LOG_CHECK_STRIKE); } - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN) || + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked) || tp1->sent == SCTP_DATAGRAM_UNSENT) { /* done */ break; @@ -3264,8 +3238,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t } } } - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->this_sack_highest_gap, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->this_sack_highest_gap)) { /* we are beyond the tsn in the sack */ break; } @@ -3289,8 +3262,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * FR using this SACK. */ continue; - } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { + } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { /* * CMT: New acks were receieved for data sent to * this dest. But no new acks were seen for data @@ -3341,7 +3314,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(16 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3373,9 +3346,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t #endif ) { - if ((compare_with_wrap(biggest_tsn_newly_acked, - tp1->rec.data.fast_retran_tsn, MAX_TSN)) || - (biggest_tsn_newly_acked == + if (SCTP_TSN_GE(biggest_tsn_newly_acked, tp1->rec.data.fast_retran_tsn)) { /* * Strike the TSN, since this ack is @@ -3415,8 +3386,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, - tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, + tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(32 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3434,8 +3405,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * JRI: TODO: remove code for HTNA algo. CMT's SFR * algo covers HTNA. */ - } else if (compare_with_wrap(tp1->rec.data.TSN_seq, - biggest_tsn_newly_acked, MAX_TSN)) { + } else if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + biggest_tsn_newly_acked)) { /* * We don't strike these: This is the HTNA * algorithm i.e. we don't strike If our TSN is @@ -3468,7 +3439,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(48 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3715,10 +3686,7 @@ sctp_try_advance_peer_ack_point(struct s */ if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { /* advance PeerAckPoint goes forward */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->advanced_peer_ack_point, - MAX_TSN)) { - + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; a_adv = tp1; } else if (tp1->rec.data.TSN_seq == asoc->advanced_peer_ack_point) { @@ -3843,7 +3811,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif asoc = &stcb->asoc; old_rwnd = asoc->peers_rwnd; - if (compare_with_wrap(asoc->last_acked_seq, cumack, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, cumack)) { /* old ack */ return; } else if (asoc->last_acked_seq == cumack) { @@ -3882,8 +3850,7 @@ sctp_express_handle_sack(struct sctp_tcb } else { send_s = asoc->sending_seq; } - if ((cumack == send_s) || - compare_with_wrap(cumack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cumack, send_s)) { #ifndef INVARIANTS struct mbuf *oper; @@ -3923,12 +3890,10 @@ sctp_express_handle_sack(struct sctp_tcb __LINE__); } stcb->asoc.overall_error_count = 0; - if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->last_acked_seq)) { /* process the new consecutive TSN first */ TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, - MAX_TSN) || - cumack == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(cumack, tp1->rec.data.TSN_seq)) { if (tp1->sent == SCTP_DATAGRAM_UNSENT) { printf("Warning, an unsent is now acked?\n"); } @@ -4095,8 +4060,7 @@ sctp_express_handle_sack(struct sctp_tcb asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -4108,7 +4072,7 @@ sctp_express_handle_sack(struct sctp_tcb } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * Now we must calculate what the base is. @@ -4316,7 +4280,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cumack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cumack; } /* PR-Sctp issues need to be addressed too */ @@ -4327,15 +4291,13 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE * stuff is put into SCTP for cross checking. */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* * ECN Nonce: Disable Nonce Sum check when @@ -4473,8 +4435,7 @@ sctp_handle_sack(struct mbuf *m, int off tp1 = NULL; send_s = asoc->sending_seq; } - if (cum_ack == send_s || - compare_with_wrap(cum_ack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cum_ack, send_s)) { struct mbuf *oper; /* @@ -4512,7 +4473,7 @@ sctp_handle_sack(struct mbuf *m, int off /**********************/ /* 1) check the range */ /**********************/ - if (compare_with_wrap(asoc->last_acked_seq, last_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, last_tsn)) { /* acking something behind */ return; } @@ -4574,9 +4535,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, - MAX_TSN) || - last_tsn == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(last_tsn, tp1->rec.data.TSN_seq)) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { /* * ECN Nonce: Add the nonce to the sender's @@ -4718,8 +4677,7 @@ sctp_handle_sack(struct mbuf *m, int off * validate the biggest_tsn_acked in the gap acks if * strict adherence is wanted. */ - if ((biggest_tsn_acked == send_s) || - (compare_with_wrap(biggest_tsn_acked, send_s, MAX_TSN))) { + if (SCTP_TSN_GE(biggest_tsn_acked, send_s)) { /* * peer is either confused or we are under * attack. We must abort. @@ -4757,8 +4715,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->last_acked_seq = cum_ack; TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } if (tp1->sent == SCTP_DATAGRAM_UNSENT) { @@ -4835,9 +4792,7 @@ sctp_handle_sack(struct mbuf *m, int off } if (asoc->fast_retran_loss_recovery && accum_moved) { - if (compare_with_wrap(asoc->last_acked_seq, - asoc->fast_recovery_tsn, MAX_TSN) || - asoc->last_acked_seq == asoc->fast_recovery_tsn) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->fast_recovery_tsn)) { /* Setup so we will exit RFC2582 fast recovery */ will_exit_fast_recovery = 1; } @@ -5057,8 +5012,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -5070,7 +5024,7 @@ sctp_handle_sack(struct mbuf *m, int off } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * now we must calculate what the base is. @@ -5097,9 +5051,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->fast_retran_loss_recovery = 0; } if ((asoc->sat_t3_loss_recovery) && - ((compare_with_wrap(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn, - MAX_TSN) || - (asoc->last_acked_seq == asoc->sat_t3_recovery_tsn)))) { + SCTP_TSN_GE(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn)) { /* end satellite t3 loss recovery */ asoc->sat_t3_loss_recovery = 0; } @@ -5217,7 +5169,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cum_ack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cum_ack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cum_ack; } /* C2. try to further move advancedPeerAckPoint ahead */ @@ -5228,8 +5180,7 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE @@ -5240,8 +5191,7 @@ again: 0xee, cum_ack, asoc->advanced_peer_ack_point, old_adv_peer_ack_point); } - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* @@ -5302,8 +5252,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * came in */ TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { - if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || - (tt == ctl->sinfo_ssn)) { + if (SCTP_SSN_GE(tt, ctl->sinfo_ssn)) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); /* subtract pending on streams */ @@ -5378,8 +5327,7 @@ sctp_flush_reassm_for_str_seq(struct sct if (chk->rec.data.stream_seq == seq) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5389,11 +5337,8 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5415,7 +5360,7 @@ sctp_flush_reassm_for_str_seq(struct sct chk->data = NULL; } sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we * are done @@ -5475,8 +5420,7 @@ sctp_handle_forward_tsn(struct sctp_tcb /*************************************************************/ new_cum_tsn = ntohl(fwd->new_cumulative_tsn); - if (compare_with_wrap(asoc->cumulative_tsn, new_cum_tsn, MAX_TSN) || - asoc->cumulative_tsn == new_cum_tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, new_cum_tsn)) { /* Already got there ... */ return; } @@ -5537,7 +5481,7 @@ sctp_handle_forward_tsn(struct sctp_tcb if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) && !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); - if (compare_with_wrap(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i; } } @@ -5563,13 +5507,10 @@ sctp_handle_forward_tsn(struct sctp_tcb * queue. */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { + if (SCTP_TSN_GE(new_cum_tsn, chk->rec.data.TSN_seq)) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5579,11 +5520,8 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5681,17 +5619,15 @@ sctp_handle_forward_tsn(struct sctp_tcb stcb->asoc.control_pdapi = sv; break; } else if ((ctl->sinfo_stream == stseq->stream) && - (compare_with_wrap(ctl->sinfo_ssn, stseq->sequence, MAX_SEQ))) { + SCTP_SSN_GT(ctl->sinfo_ssn, stseq->sequence)) { /* We are past our victim SSN */ break; } } strm = &asoc->strmin[stseq->stream]; - if (compare_with_wrap(stseq->sequence, - strm->last_sequence_delivered, MAX_SEQ)) { + if (SCTP_SSN_GT(stseq->sequence, strm->last_sequence_delivered)) { /* Update the sequence number */ - strm->last_sequence_delivered = - stseq->sequence; + strm->last_sequence_delivered = stseq->sequence; } /* now kick the stream the new way */ /* sa_ignore NO_NULL_CHK */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:28:37 2012 (r231356) @@ -2924,14 +2924,15 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) + if (SCTP_TSN_GT(lchk->rec.data.TSN_seq, tsn)) { break; + } } if (net == NULL) /* default is we use the primary */ net = stcb->asoc.primary_destination; - if (compare_with_wrap(tsn, stcb->asoc.last_cwr_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { /* * JRS - Use the congestion control given in the pluggable * CC module @@ -2972,8 +2973,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun * don't need to worry about more than one! */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (compare_with_wrap(ntohl(cp->tsn), ntohl(ecne->tsn), - MAX_TSN) || (cp->tsn == ecne->tsn)) { + if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3062,8 +3062,7 @@ process_chunk_drop(struct sctp_tcb *stcb /* found it */ break; } - if (compare_with_wrap(tp1->rec.data.TSN_seq, tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, tsn)) { /* not found */ tp1 = NULL; break; @@ -3670,8 +3669,7 @@ sctp_handle_str_reset_request_out(struct if (trunc) { sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_DENIED); asoc->last_reset_action[0] = SCTP_STREAM_RESET_DENIED; - } else if ((tsn == asoc->cumulative_tsn) || - (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN))) { + } else if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* we can do it now */ sctp_reset_in_stream(stcb, number_entries, req->list_of_streams); sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_PERFORMED); @@ -4615,8 +4613,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) @@ -4709,8 +4706,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && (num_nr_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) { @@ -5355,8 +5351,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } else if ((ecn_bits & SCTP_ECT0_BIT) == SCTP_ECT0_BIT) { @@ -5365,8 +5360,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } @@ -5383,8 +5377,7 @@ sctp_process_ecn_marked_b(struct sctp_tc * chunk to the output chunk queue. The incoming CWR will * remove this chunk. */ - if (compare_with_wrap(high_tsn, stcb->asoc.last_echo_tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, stcb->asoc.last_echo_tsn)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); stcb->asoc.last_echo_tsn = high_tsn; @@ -5623,12 +5616,12 @@ sctp_common_input_processing(struct mbuf int was_a_gap; uint32_t highest_tsn; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map)) { highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; } else { highest_tsn = stcb->asoc.highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); stcb->asoc.send_sack = 1; sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:28:37 2012 (r231356) @@ -6468,7 +6468,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), asoc->asconf_seq_out_acked, MAX_TSN)) { + if (SCTP_TSN_GT(ntohl(acp->serial_number), asoc->asconf_seq_out_acked)) { /* Not Acked yet */ break; } @@ -6516,8 +6516,7 @@ sctp_clean_up_datalist(struct sctp_tcb * } /* on to the sent queue */ tp1 = TAILQ_LAST(&asoc->sent_queue, sctpchunk_listhead); - if ((tp1) && (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN))) { + if ((tp1) && SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { struct sctp_tmit_chunk *tpp; /* need to move back */ @@ -6528,8 +6527,7 @@ sctp_clean_up_datalist(struct sctp_tcb * goto all_done; } tp1 = tpp; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { goto back_up_more; } TAILQ_INSERT_AFTER(&asoc->sent_queue, tp1, data_list[i], sctp_next); @@ -10002,7 +10000,7 @@ sctp_send_sack(struct sctp_tcb *stcb) if (a_chk->whoTo) { atomic_add_int(&a_chk->whoTo->ref_count, 1); } - if (compare_with_wrap(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map)) { highest_tsn = asoc->highest_tsn_inside_map; } else { highest_tsn = asoc->highest_tsn_inside_nr_map; @@ -10097,15 +10095,15 @@ sctp_send_sack(struct sctp_tcb *stcb) } } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } if (((type == SCTP_SELECTIVE_ACK) && - compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || + SCTP_TSN_GT(highest_tsn, asoc->cumulative_tsn)) || ((type == SCTP_NR_SELECTIVE_ACK) && - compare_with_wrap(asoc->highest_tsn_inside_map, asoc->cumulative_tsn, MAX_TSN))) { + SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->cumulative_tsn))) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->mapping_array[i]; @@ -10177,12 +10175,12 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn)) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->nr_mapping_array[i]; @@ -11075,8 +11073,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { /* found a previous ECN_CWR update it if needed */ cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (compare_with_wrap(high_tsn, ntohl(cwr->tsn), - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { cwr->tsn = htonl(high_tsn); } return; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:28:37 2012 (r231356) @@ -6475,8 +6475,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, cnt = 0; /* First look in the re-assembly queue */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if (compare_with_wrap(chk->rec.data.TSN_seq, - cumulative_tsn_p1, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.TSN_seq, asoc->mapping_array_base_tsn); @@ -6494,8 +6493,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* Ok that was fun, now we will drain all the inbound streams? */ for (strmat = 0; strmat < asoc->streamincnt; strmat++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:30:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A3B106566C; Fri, 10 Feb 2012 07:30: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 A2F678FC23; Fri, 10 Feb 2012 07:30: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 q1A7UFBL060139; Fri, 10 Feb 2012 07:30:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7UFAE060137; Fri, 10 Feb 2012 07:30:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100730.q1A7UFAE060137@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231357 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:30:15 -0000 Author: tuexen Date: Fri Feb 10 07:30:15 2012 New Revision: 231357 URL: http://svn.freebsd.org/changeset/base/231357 Log: MFC r216878: Fix a typo. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:28:37 2012 (r231356) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:30:15 2012 (r231357) @@ -417,7 +417,7 @@ union sctp_notification { #define SCTP_AUTHENTICATION_EVENT 0x0008 #define SCTP_STREAM_RESET_EVENT 0x0009 #define SCTP_SENDER_DRY_EVENT 0x000a -#define SCTP__NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ +#define SCTP_NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ /* * socket option structs */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:31:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45E3106566B; Fri, 10 Feb 2012 07:31:50 +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 B82188FC12; Fri, 10 Feb 2012 07:31: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 q1A7Vo8S060230; Fri, 10 Feb 2012 07:31:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7Vo5P060228; Fri, 10 Feb 2012 07:31:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100731.q1A7Vo5P060228@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231358 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:31:51 -0000 Author: tuexen Date: Fri Feb 10 07:31:50 2012 New Revision: 231358 URL: http://svn.freebsd.org/changeset/base/231358 Log: MFC r216887: Bugfix: Make sure that the COMM_UP notificatin is delivered first also on the passive side. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:30:15 2012 (r231357) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:31:50 2012 (r231358) @@ -2311,6 +2311,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; + int send_int_conf = 0; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie: handling COOKIE-ECHO\n"); @@ -2630,8 +2631,7 @@ sctp_handle_cookie_echo(struct mbuf *m, netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED; (void)sctp_set_primary_addr((*stcb), (struct sockaddr *)NULL, netl); - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, - (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + send_int_conf = 1; } } if (*stcb) { @@ -2655,6 +2655,10 @@ sctp_handle_cookie_echo(struct mbuf *m, * socket, no need to do anything. I THINK!! */ sctp_ulp_notify(notification, *stcb, 0, (void *)&sac_restart_id, SCTP_SO_NOT_LOCKED); + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } return (m); } oso = (*inp_p)->sctp_socket; @@ -2768,7 +2772,10 @@ sctp_handle_cookie_echo(struct mbuf *m, /* Switch over to the new guy */ *inp_p = inp; sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } /* * Pull it from the incomplete queue and wake the * guy @@ -2787,8 +2794,14 @@ sctp_handle_cookie_echo(struct mbuf *m, return (m); } } - if ((notification) && ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) { - sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + if (notification) { + sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + } + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } } return (m); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:42:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DE6106564A; Fri, 10 Feb 2012 07:42: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 E4D178FC0C; Fri, 10 Feb 2012 07:42: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 q1A7gcDs060623; Fri, 10 Feb 2012 07:42:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7gcoE060617; Fri, 10 Feb 2012 07:42:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100742.q1A7gcoE060617@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231359 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:42:39 -0000 Author: tuexen Date: Fri Feb 10 07:42:38 2012 New Revision: 231359 URL: http://svn.freebsd.org/changeset/base/231359 Log: MFC r215817: Adds new dtrace for cwnd functions and lay's groundwork for future dtrace points (rwnd flightsize etc). From rrs@. Added: stable/8/sys/netinet/sctp_dtrace_declare.h - copied unchanged from r215817, head/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h - copied unchanged from r215817, head/sys/netinet/sctp_dtrace_define.h Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:42:38 2012 (r231359) @@ -42,6 +42,7 @@ #include #include #include +#include #include __FBSDID("$FreeBSD$"); @@ -67,6 +68,9 @@ 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); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); @@ -102,6 +106,9 @@ sctp_cwnd_update_after_fr(struct sctp_tc net->ssthresh = 2 * net->mtu; } net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, fr, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); @@ -159,6 +166,7 @@ sctp_cwnd_update_after_sack(struct sctp_ int accum_moved, int reneged_all, int will_exit) { struct sctp_nets *net; + int old_cwnd; /******************************/ /* update cwnd and Early FR */ @@ -250,7 +258,11 @@ sctp_cwnd_update_after_sack(struct sctp_ (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; + old_cwnd = net->cwnd; net->cwnd = net->mtu * asoc->sctp_cmt_pf; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); /* @@ -293,13 +305,26 @@ sctp_cwnd_update_after_sack(struct sctp_ /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { + old_cwnd = net->cwnd; net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_SS); } } else { + old_cwnd = net->cwnd; net->cwnd += net->net_ack; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, SCTP_CWND_LOG_FROM_SS); @@ -321,7 +346,13 @@ sctp_cwnd_update_after_sack(struct sctp_ if ((net->flight_size + net->net_ack >= net->cwnd) && (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; + old_cwnd = net->cwnd; net->cwnd += net->mtu; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -367,7 +398,11 @@ sctp_cwnd_update_after_timeout(struct sc net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); net->cwnd = net->mtu; net->partial_bytes_acked = 0; - + SDT_PROBE(sctp, cwnd, net, to, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->cwnd - old_cwnd, SCTP_CWND_LOG_FROM_RTX); } @@ -386,6 +421,11 @@ sctp_cwnd_update_after_ecn_echo(struct s net->RTO <<= 1; } net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } @@ -495,6 +535,11 @@ sctp_cwnd_update_after_packet_dropped(st } if (net->cwnd - old_cwnd != 0) { /* log only changes */ + SDT_PROBE(sctp, cwnd, net, pd, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); @@ -511,7 +556,11 @@ sctp_cwnd_update_after_output(struct sct if (net->ssthresh < net->cwnd) net->ssthresh = net->cwnd; net->cwnd = (net->flight_size + (burst_limit * net->mtu)); - + SDT_PROBE(sctp, cwnd, net, bl, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); } @@ -533,6 +582,11 @@ sctp_cwnd_update_after_fr_timer(struct s if (net->cwnd < net->ssthresh) /* still in SS move to CA */ net->ssthresh = net->cwnd - 1; + SDT_PROBE(sctp, cwnd, net, fr, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); } Copied: stable/8/sys/netinet/sctp_dtrace_declare.h (from r215817, head/sys/netinet/sctp_dtrace_declare.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 07:42:38 2012 (r231359, copy of r215817, head/sys/netinet/sctp_dtrace_declare.h) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * 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. + * + * 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. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + */ +#include +__FBSDID("$FreeBSD$"); +#ifndef __sctp_dtrace_declare_h__ +#include "opt_kdtrace.h" +#include +#include + +/* Declare the SCTP provider */ +SDT_PROVIDER_DECLARE(sctp); + +/* The probes we have so far: */ + +/* One to track a net's cwnd */ +/* initial */ +SDT_PROBE_DECLARE(sctp, cwnd, net, init); +/* update at a ack -- increase */ +SDT_PROBE_DECLARE(sctp, cwnd, net, ack); +/* update at a fast retransmit -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, fr); +/* update at a time-out -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, to); +/* update at a burst-limit -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, bl); +/* update at a ECN -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); +/* update at a Packet-Drop -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, pd); + +/* One to track an associations rwnd */ +SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); + +/* One to track a net's flight size */ +SDT_PROBE_DECLARE(sctp, flightsize, net, val); + +/* One to track an associations flight size */ +SDT_PROBE_DECLARE(sctp, flightsize, assoc, val); + + + + + + +#endif Copied: stable/8/sys/netinet/sctp_dtrace_define.h (from r215817, head/sys/netinet/sctp_dtrace_define.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 07:42:38 2012 (r231359, copy of r215817, head/sys/netinet/sctp_dtrace_define.h) @@ -0,0 +1,201 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * 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. + * + * 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. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + */ +#include +__FBSDID("$FreeBSD$"); +#ifndef __sctp_dtrace_define_h__ +#include "opt_kdtrace.h" +#include +#include + +SDT_PROVIDER_DEFINE(sctp); + +/********************************************************/ +/* Cwnd probe - tracks changes in the congestion window on a netp */ +/********************************************************/ +/* Initial */ +SDT_PROBE_DEFINE(sctp, cwnd, net, init, init); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 4, "int"); + + +/* ACK-INCREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, ack, ack); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 4, "int"); + +/* FastRetransmit-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 4, "int"); + + +/* TimeOut-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, to, to); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 4, "int"); + + +/* BurstLimit-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, bl, bl); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 4, "int"); + + +/* ECN-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, ecn, ecn); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 4, "int"); + + +/* PacketDrop-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, pd, pd); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 4, "int"); + + + +/********************************************************/ +/* Rwnd probe - tracks changes in the receiver window for an assoc */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, rwnd, assoc, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 1, "uint32_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 2, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 3, "int"); + +/********************************************************/ +/* flight probe - tracks changes in the flight size on a net or assoc */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, flightsize, net, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 2, "uintptr_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 4, "int"); +/********************************************************/ +/* The total flight version */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, flightsize, assoc, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 1, "uint32_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 2, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 3, "int"); + +#endif Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:42:38 2012 (r231359) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:42:38 2012 (r231359) @@ -942,7 +942,7 @@ struct sctpstat { uint32_t sctps_wu_sacks_sent; /* Window Update only sacks sent */ uint32_t sctps_sends_with_flags; /* number of sends with * sinfo_flags !=0 */ - uint32_t sctps_sends_with_unord; /* number of unordered sends */ + uint32_t sctps_sends_with_unord; /* number of unordered sends */ uint32_t sctps_sends_with_eof; /* number of sends with EOF flag set */ uint32_t sctps_sends_with_abort; /* number of sends with ABORT * flag set */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:44:04 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25978106566B; Fri, 10 Feb 2012 07:44: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 12FBC8FC14; Fri, 10 Feb 2012 07:44: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 q1A7i3Ij060726; Fri, 10 Feb 2012 07:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7i3rC060724; Fri, 10 Feb 2012 07:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100744.q1A7i3rC060724@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231360 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:44:04 -0000 Author: tuexen Date: Fri Feb 10 07:44:03 2012 New Revision: 231360 URL: http://svn.freebsd.org/changeset/base/231360 Log: MFC r217469: Add support for resource pooling to CMT. An original version of the patch was developed by Martin Becke and Thomas Dreibholz. Modified: stable/8/sys/netinet/sctp_cc_functions.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:42:38 2012 (r231359) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:44:03 2012 (r231360) @@ -66,6 +66,13 @@ sctp_set_initial_cc_param(struct sctp_tc cwnd_in_mtu = assoc->max_burst; net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } + if (stcb->asoc.sctp_cmt_on_off == 2) { + /* In case of resource pooling initialize appropriately */ + net->cwnd /= assoc->numnets; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } net->ssthresh = assoc->peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, @@ -82,7 +89,17 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_association *asoc) { struct sctp_nets *net; + uint32_t t_ssthresh, t_cwnd; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (asoc->sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /*- * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) @@ -101,9 +118,23 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_tmit_chunk *lchk; int old_cwnd = net->cwnd; - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < (net->mtu * 2)) { - net->ssthresh = 2 * net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < (net->mtu * 2)) { + net->ssthresh = 2 * net->mtu; + } } net->cwnd = net->ssthresh; SDT_PROBE(sctp, cwnd, net, fr, @@ -167,7 +198,17 @@ sctp_cwnd_update_after_sack(struct sctp_ { struct sctp_nets *net; int old_cwnd; + uint32_t t_ssthresh, t_cwnd, incr; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -178,11 +219,8 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -304,32 +342,39 @@ sctp_cwnd_update_after_sack(struct sctp_ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { - old_cwnd = net->cwnd; - net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->mtu, - SCTP_CWND_LOG_FROM_SS); + old_cwnd = net->cwnd; + if (stcb->asoc.sctp_cmt_on_off == 2) { + uint32_t limit; + + limit = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + incr = (uint32_t) (((uint64_t) net->net_ack * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr > limit) { + incr = limit; + } + if (incr == 0) { + incr = 1; } } else { - old_cwnd = net->cwnd; - net->cwnd += net->net_ack; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->net_ack, - SCTP_CWND_LOG_FROM_SS); + incr = net->net_ack; + if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { + incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); } } + net->cwnd += incr; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, incr, + SCTP_CWND_LOG_FROM_SS); + } + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -338,6 +383,8 @@ sctp_cwnd_update_after_sack(struct sctp_ } } else { /* We are in congestion avoidance */ + uint32_t incr; + /* * Add to pba */ @@ -347,7 +394,17 @@ sctp_cwnd_update_after_sack(struct sctp_ (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; old_cwnd = net->cwnd; - net->cwnd += net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + incr = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr == 0) { + incr = 1; + } + } else { + incr = net->mtu; + } + net->cwnd += incr; SDT_PROBE(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -394,8 +451,32 @@ void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; + uint32_t t_ssthresh, t_cwnd; - net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + struct sctp_nets *lnet; + + TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { + t_ssthresh += lnet->ssthresh; + t_cwnd += lnet->cwnd; + } + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + } net->cwnd = net->mtu; net->partial_bytes_acked = 0; SDT_PROBE(sctp, cwnd, net, to, @@ -844,11 +925,8 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -1329,11 +1407,8 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:47:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804C51065670; Fri, 10 Feb 2012 07:47:34 +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 6D4A08FC08; Fri, 10 Feb 2012 07:47: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 q1A7lYeF060888; Fri, 10 Feb 2012 07:47:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7lYeb060883; Fri, 10 Feb 2012 07:47:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100747.q1A7lYeb060883@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231361 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:47:34 -0000 Author: tuexen Date: Fri Feb 10 07:47:34 2012 New Revision: 231361 URL: http://svn.freebsd.org/changeset/base/231361 Log: MFC r217611: Cleanup the management of CC functions. Deleted: stable/8/sys/netinet/sctp_cc_functions.h Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:47:34 2012 (r231361) @@ -41,12 +41,11 @@ #include #include #include -#include #include #include __FBSDID("$FreeBSD$"); -void +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -84,7 +83,7 @@ sctp_set_initial_cc_param(struct sctp_tc } } -void +static void sctp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -191,7 +190,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } -void +static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -447,7 +446,7 @@ skip_cwnd_update: } } -void +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -489,7 +488,7 @@ sctp_cwnd_update_after_timeout(struct sc } } -void +static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -512,7 +511,7 @@ sctp_cwnd_update_after_ecn_echo(struct s } } -void +static void sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t * bottle_bw, uint32_t * on_queue) @@ -628,7 +627,7 @@ sctp_cwnd_update_after_packet_dropped(st } } -void +static void sctp_cwnd_update_after_output(struct sctp_tcb *stcb, struct sctp_nets *net, int burst_limit) { @@ -647,7 +646,7 @@ sctp_cwnd_update_after_output(struct sct } } -void +static void sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -836,7 +835,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s } } -void +static void sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -908,7 +907,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp } } -void +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) @@ -1374,7 +1373,7 @@ htcp_init(struct sctp_tcb *stcb, struct net->htcp_ca.last_cong = sctp_get_tick_count(); } -void +static void sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { /* @@ -1390,7 +1389,7 @@ sctp_htcp_set_initial_cc_param(struct sc } } -void +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) @@ -1550,7 +1549,7 @@ skip_cwnd_update: } } -void +static void sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -1629,7 +1628,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc } } -void +static void sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1645,7 +1644,7 @@ sctp_htcp_cwnd_update_after_timeout(stru } } -void +static void sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1669,7 +1668,7 @@ sctp_htcp_cwnd_update_after_fr_timer(str } } -void +static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1691,3 +1690,36 @@ sctp_htcp_cwnd_update_after_ecn_echo(str sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } } + +struct sctp_cc_functions sctp_cc_functions[] = { + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + } +}; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:47:34 2012 (r231361) @@ -2516,13 +2516,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_sender = SCTP_SWS_SENDER_DEF; m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); - if ((SCTP_BASE_SYSCTL(sctp_default_cc_module) >= SCTP_CC_RFC2581) && - (SCTP_BASE_SYSCTL(sctp_default_cc_module) <= SCTP_CC_HTCP)) { - m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); - } else { - /* sysctl done with invalid value, set to 2581 */ - m->sctp_default_cc_module = SCTP_CC_RFC2581; - } + m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:47:34 2012 (r231361) @@ -48,11 +48,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +extern struct sctp_cc_functions sctp_cc_functions[]; void sctp_init(void) @@ -2867,75 +2867,26 @@ sctp_setopt(struct socket *so, int optna SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { switch (av->assoc_value) { - /* - * JRS - Standard TCP congestion - * control - */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - High Speed TCP congestion - * control (Floyd) - */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - All other values are - * invalid - */ + stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; + stcb->asoc.congestion_control_module = av->assoc_value; + break; default: - { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - SCTP_TCB_UNLOCK(stcb); - break; - } + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; } + SCTP_TCB_UNLOCK(stcb); } else { switch (av->assoc_value) { case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; + SCTP_INP_WUNLOCK(inp); break; default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 07:47:34 2012 (r231361) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include /* for sctp_deliver_data() */ #include #include -#include #include @@ -55,6 +54,8 @@ __FBSDID("$FreeBSD$"); #define KTR_SCTP KTR_SUBSYS #endif +extern struct sctp_cc_functions sctp_cc_functions[]; + void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) @@ -1044,67 +1045,17 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - /* - * JRS - Pick the default congestion control module based on the - * sysctl. - */ switch (m->sctp_ep.sctp_default_cc_module) { - /* JRS - Standard TCP congestion control */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - High Speed TCP congestion control (Floyd) */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - break; - } - /* JRS - By default, use RFC2581 */ + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; + break; default: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } + stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; + stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; + break; } /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:49:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5294106566B; Fri, 10 Feb 2012 07:49:57 +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 D33FB8FC0C; Fri, 10 Feb 2012 07:49: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 q1A7nvsp061003; Fri, 10 Feb 2012 07:49:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7nvKg060999; Fri, 10 Feb 2012 07:49:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100749.q1A7nvKg060999@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231362 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:49:58 -0000 Author: tuexen Date: Fri Feb 10 07:49:57 2012 New Revision: 231362 URL: http://svn.freebsd.org/changeset/base/231362 Log: MFC r217635: Fix it so we align with new socket API draft for state's in destination (i.e. ACTIVE/INACTIVE/UNCONFIRMED) From rrs@. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:49:57 2012 (r231362) @@ -506,8 +506,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ -#define SCTP_ADDR_PF 0x800 -#define SCTP_REACHABLE_MASK 0x203 +#define SCTP_ADDR_PF 0x800 /* bound address types (e.g. valid address types to allow) */ #define SCTP_BOUND_V6 0x01 Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:49:57 2012 (r231362) @@ -233,31 +233,10 @@ struct sctp_paddr_change { #define SCTP_ADDR_MADE_PRIM 0x0005 #define SCTP_ADDR_CONFIRMED 0x0006 -/* - * CAUTION: these are user exposed SCTP addr reachability states must be - * compatible with SCTP_ADDR states in sctp_constants.h - */ -#ifdef SCTP_ACTIVE -#undef SCTP_ACTIVE -#endif #define SCTP_ACTIVE 0x0001 /* SCTP_ADDR_REACHABLE */ - -#ifdef SCTP_INACTIVE -#undef SCTP_INACTIVE -#endif #define SCTP_INACTIVE 0x0002 /* SCTP_ADDR_NOT_REACHABLE */ - -#ifdef SCTP_UNCONFIRMED -#undef SCTP_UNCONFIRMED -#endif #define SCTP_UNCONFIRMED 0x0200 /* SCTP_ADDR_UNCONFIRMED */ -#ifdef SCTP_NOHEARTBEAT -#undef SCTP_NOHEARTBEAT -#endif -#define SCTP_NOHEARTBEAT 0x0040 /* SCTP_ADDR_NOHB */ - - /* remote error events */ struct sctp_remote_error { uint16_t sre_type; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:49:57 2012 (r231362) @@ -2341,7 +2341,16 @@ flags_out: } if ((stcb) && (net)) { - paddri->spinfo_state = net->dest_state & (SCTP_REACHABLE_MASK | SCTP_ADDR_NOHB); + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* Its unconfirmed */ + paddri->spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* The Active */ + paddri->spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + paddri->spinfo_state = SCTP_INACTIVE; + } paddri->spinfo_cwnd = net->cwnd; paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; paddri->spinfo_rto = net->RTO; @@ -2409,7 +2418,16 @@ flags_out: * Again the user can get info from sctp_constants.h * for what the state of the network is. */ - sstat->sstat_primary.spinfo_state = net->dest_state & SCTP_REACHABLE_MASK; + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* Its active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } sstat->sstat_primary.spinfo_cwnd = net->cwnd; sstat->sstat_primary.spinfo_srtt = net->lastsa; sstat->sstat_primary.spinfo_rto = net->RTO; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:51:28 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F029A106564A; Fri, 10 Feb 2012 07:51:28 +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 DE79F8FC14; Fri, 10 Feb 2012 07:51:28 +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 q1A7pSKX061098; Fri, 10 Feb 2012 07:51:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7pS0V061096; Fri, 10 Feb 2012 07:51:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100751.q1A7pS0V061096@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231363 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:51:29 -0000 Author: tuexen Date: Fri Feb 10 07:51:28 2012 New Revision: 231363 URL: http://svn.freebsd.org/changeset/base/231363 Log: MFC r217638: Improve comments. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:49:57 2012 (r231362) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:51:28 2012 (r231363) @@ -2342,13 +2342,13 @@ flags_out: if ((stcb) && (net)) { if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* Its unconfirmed */ + /* It's unconfirmed */ paddri->spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* The Active */ + /* It's active */ paddri->spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ paddri->spinfo_state = SCTP_INACTIVE; } paddri->spinfo_cwnd = net->cwnd; @@ -2422,10 +2422,10 @@ flags_out: /* It's unconfirmed */ sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* Its active */ + /* It's active */ sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; } sstat->sstat_primary.spinfo_cwnd = net->cwnd; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 07:52:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211AE106566C; Fri, 10 Feb 2012 07:52:52 +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 0F4F08FC08; Fri, 10 Feb 2012 07:52: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 q1A7qpWC061190; Fri, 10 Feb 2012 07:52:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7qpx4061188; Fri, 10 Feb 2012 07:52:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100752.q1A7qpx4061188@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231364 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:52:52 -0000 Author: tuexen Date: Fri Feb 10 07:52:51 2012 New Revision: 231364 URL: http://svn.freebsd.org/changeset/base/231364 Log: MFC r217742: Remove unnecessary checking of variable. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 07:51:28 2012 (r231363) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 07:52:51 2012 (r231364) @@ -1045,18 +1045,8 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - switch (m->sctp_ep.sctp_default_cc_module) { - case SCTP_CC_RFC2581: - case SCTP_CC_HSTCP: - case SCTP_CC_HTCP: - stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; - stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; - break; - default: - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; - break; - } + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; /* * Now the stream parameters, here we allocate space for all streams From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 09:42:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 05519106564A; Fri, 10 Feb 2012 09:42:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 9286614E91E; Fri, 10 Feb 2012 09:42:25 +0000 (UTC) Message-ID: <4F34E681.3050105@FreeBSD.org> Date: Fri, 10 Feb 2012 01:42:25 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Baptiste Daroussin References: <201202091416.q19EGenl004705@svn.freebsd.org> In-Reply-To: <201202091416.q19EGenl004705@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231278 - in stable/8: etc/rc.d sbin/dhclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:42:26 -0000 ALWAYS ALWAYS ALWAYS merge things in /etc in foo/etc. You should have known this because you thoroughly read http://wiki.freebsd.org/SubversionPrimer, especially the section on merging. Your mentor should have told you this, and ensured that you were doing it right when he reviewed your diff. On 02/09/2012 06:16, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Feb 9 14:16:40 2012 > New Revision: 231278 > URL: http://svn.freebsd.org/changeset/base/231278 > > Log: > MFH r226345, r226464, r226879: > Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs > > Approved by: des (mentor) -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 09:47:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FCB01065670; Fri, 10 Feb 2012 09:47:00 +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 23DAE8FC0A; Fri, 10 Feb 2012 09:47: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 q1A9kx2x065064; Fri, 10 Feb 2012 09:47:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9kx6W065063; Fri, 10 Feb 2012 09:46:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202100946.q1A9kx6W065063@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 09:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231366 - in stable/8/etc: . rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:47:00 -0000 Author: dougb Date: Fri Feb 10 09:46:59 2012 New Revision: 231366 URL: http://svn.freebsd.org/changeset/base/231366 Log: Pull up mergeinfo from r226345,226464,226879 to etc/ where it belongs Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/rc.d/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 10:18:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6064C106564A; Fri, 10 Feb 2012 10:18: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 4DAAF8FC0C; Fri, 10 Feb 2012 10:18: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 q1AAIVph066407; Fri, 10 Feb 2012 10:18:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAIUTC066391; Fri, 10 Feb 2012 10:18:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101018.q1AAIUTC066391@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231372 - stable/8/etc/rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:18:31 -0000 Author: dougb Date: Fri Feb 10 10:18:30 2012 New Revision: 231372 URL: http://svn.freebsd.org/changeset/base/231372 Log: MFC r208307: This change does the following for the scripts that run up through FILESYSTEMS (the default early_late_divider): 1. Move sysctl to run first 2. Move as many BEFOREs to REQUIREs as possible. 3. Minor effect, move hostid_save from right before mdconfig to right after. A lot of the early scripts make use of sysctl one way or another so running this first makes a lot of sense given that system-critical values are often placed in sysctl.conf. (More details in original log.) In addition to the changes from this revision, tweak a few other rcorder elements in order to minimize the differences between the order before and after this change, mostly related to scripts still in this branch that are no longer in HEAD. Modified: stable/8/etc/rc.d/SERVERS stable/8/etc/rc.d/addswap stable/8/etc/rc.d/auto_linklocal stable/8/etc/rc.d/cleanvar stable/8/etc/rc.d/ddb stable/8/etc/rc.d/dumpon stable/8/etc/rc.d/hostid stable/8/etc/rc.d/hostid_save stable/8/etc/rc.d/initrandom stable/8/etc/rc.d/mdconfig stable/8/etc/rc.d/mountcritlocal stable/8/etc/rc.d/netif stable/8/etc/rc.d/savecore stable/8/etc/rc.d/sysctl stable/8/etc/rc.d/zvol Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/SERVERS ============================================================================== --- stable/8/etc/rc.d/SERVERS Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/SERVERS Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig +# REQUIRE: mountcritremote abi ldconfig savecore # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: stable/8/etc/rc.d/addswap ============================================================================== --- stable/8/etc/rc.d/addswap Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/addswap Fri Feb 10 10:18:30 2012 (r231372) @@ -7,7 +7,6 @@ # PROVIDE: addswap # REQUIRE: FILESYSTEMS -# BEFORE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/auto_linklocal ============================================================================== --- stable/8/etc/rc.d/auto_linklocal Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/auto_linklocal Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: auto_linklocal # REQUIRE: root -# BEFORE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/cleanvar ============================================================================== --- stable/8/etc/rc.d/cleanvar Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/cleanvar Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: cleanvar -# REQUIRE: FILESYSTEMS var +# REQUIRE: FILESYSTEMS var addswap . /etc/rc.subr Modified: stable/8/etc/rc.d/ddb ============================================================================== --- stable/8/etc/rc.d/ddb Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/ddb Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,7 @@ # PROVIDE: ddb # REQUIRE: dumpon -# BEFORE: disks savecore initrandom +# BEFORE: disks # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/dumpon ============================================================================== --- stable/8/etc/rc.d/dumpon Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/dumpon Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,8 @@ # # PROVIDE: dumpon -# BEFORE: disks savecore initrandom +# REQUIRE: zvol +# BEFORE: disks # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/hostid ============================================================================== --- stable/8/etc/rc.d/hostid Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/hostid Fri Feb 10 10:18:30 2012 (r231372) @@ -28,7 +28,7 @@ # # PROVIDE: hostid -# BEFORE: fsck +# REQUIRE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/hostid_save ============================================================================== --- stable/8/etc/rc.d/hostid_save Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/hostid_save Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: hostid_save # REQUIRE: root -# BEFORE: mountcritlocal # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/initrandom ============================================================================== --- stable/8/etc/rc.d/initrandom Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/initrandom Fri Feb 10 10:18:30 2012 (r231372) @@ -4,6 +4,7 @@ # # PROVIDE: initrandom +# REQUIRE: dumpon ddb # BEFORE: disks # KEYWORD: nojail Modified: stable/8/etc/rc.d/mdconfig ============================================================================== --- stable/8/etc/rc.d/mdconfig Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/mdconfig Fri Feb 10 10:18:30 2012 (r231372) @@ -28,8 +28,7 @@ # # PROVIDE: mdconfig -# REQUIRE: localswap -# BEFORE: mountcritlocal +# REQUIRE: localswap root . /etc/rc.subr Modified: stable/8/etc/rc.d/mountcritlocal ============================================================================== --- stable/8/etc/rc.d/mountcritlocal Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/mountcritlocal Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritlocal -# REQUIRE: root +# REQUIRE: root hostid_save mdconfig # KEYWORD: nojail shutdown . /etc/rc.subr Modified: stable/8/etc/rc.d/netif ============================================================================== --- stable/8/etc/rc.d/netif Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/netif Fri Feb 10 10:18:30 2012 (r231372) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: ipfilter ipfs auto_linklocal # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/savecore ============================================================================== --- stable/8/etc/rc.d/savecore Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/savecore Fri Feb 10 10:18:30 2012 (r231372) @@ -4,8 +4,7 @@ # # PROVIDE: savecore -# REQUIRE: syslogd -# BEFORE: SERVERS +# REQUIRE: dumpon ddb syslogd # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/sysctl ============================================================================== --- stable/8/etc/rc.d/sysctl Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/sysctl Fri Feb 10 10:18:30 2012 (r231372) @@ -4,8 +4,6 @@ # # PROVIDE: sysctl -# REQUIRE: root -# BEFORE: DAEMON . /etc/rc.subr Modified: stable/8/etc/rc.d/zvol ============================================================================== --- stable/8/etc/rc.d/zvol Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/zvol Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: zvol # REQUIRE: hostid -# BEFORE: fsck # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 10:23:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D36F1065676; Fri, 10 Feb 2012 10:23:21 +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 5B7558FC15; Fri, 10 Feb 2012 10:23: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 q1AANLq7066674; Fri, 10 Feb 2012 10:23:21 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AANL1B066672; Fri, 10 Feb 2012 10:23:21 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101023.q1AANL1B066672@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231374 - stable/8/etc/rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:23:21 -0000 Author: dougb Date: Fri Feb 10 10:23:20 2012 New Revision: 231374 URL: http://svn.freebsd.org/changeset/base/231374 Log: MFC r228191: Ensure kldxref is run first. Modified: stable/8/etc/rc.d/kld Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/kld ============================================================================== --- stable/8/etc/rc.d/kld Fri Feb 10 10:22:42 2012 (r231373) +++ stable/8/etc/rc.d/kld Fri Feb 10 10:23:20 2012 (r231374) @@ -27,7 +27,7 @@ # $FreeBSD$ # # PROVIDE: kld -# REQUIRE: FILESYSTEMS +# REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 13:15:12 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3FC106566B; Fri, 10 Feb 2012 13:15:12 +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 A56B18FC0A; Fri, 10 Feb 2012 13:15:12 +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 q1ADFCCO074784; Fri, 10 Feb 2012 13:15:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADFBxS074767; Fri, 10 Feb 2012 13:15:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202101315.q1ADFBxS074767@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 13:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231380 - in stable/8/sys: dev/iicbus dev/lmc dev/ppbus dev/usb/net net netgraph X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:15:12 -0000 Author: bz Date: Fri Feb 10 13:15:11 2012 New Revision: 231380 URL: http://svn.freebsd.org/changeset/base/231380 Log: MFC r223741: Tag mbufs of all incoming frames or packets with the interface's FIB setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig). Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian Modified: stable/8/sys/dev/iicbus/if_ic.c stable/8/sys/dev/lmc/if_lmc.c stable/8/sys/dev/ppbus/if_plip.c stable/8/sys/dev/usb/net/uhso.c stable/8/sys/net/if_arcsubr.c stable/8/sys/net/if_atmsubr.c stable/8/sys/net/if_ethersubr.c stable/8/sys/net/if_fddisubr.c stable/8/sys/net/if_fwsubr.c stable/8/sys/net/if_gif.c stable/8/sys/net/if_iso88025subr.c stable/8/sys/net/if_spppfr.c stable/8/sys/net/if_spppsubr.c stable/8/sys/net/if_stf.c stable/8/sys/net/if_tun.c stable/8/sys/netgraph/ng_iface.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iicbus/if_ic.c ============================================================================== --- stable/8/sys/dev/iicbus/if_ic.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/iicbus/if_ic.c Fri Feb 10 13:15:11 2012 (r231380) @@ -311,6 +311,7 @@ icintr(device_t dev, int event, char *pt top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, sc->ic_ifp, 0); if (top) { mtx_unlock(&sc->ic_lock); + M_SETFIB(top, sc->ic_ifp->if_fib); netisr_dispatch(NETISR_IP, top); mtx_lock(&sc->ic_lock); } Modified: stable/8/sys/dev/lmc/if_lmc.c ============================================================================== --- stable/8/sys/dev/lmc/if_lmc.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/lmc/if_lmc.c Fri Feb 10 13:15:11 2012 (r231380) @@ -2527,6 +2527,7 @@ lmc_raw_input(struct ifnet *ifp, struct { softc_t *sc = IFP2SC(ifp); + M_SETFIB(mbuf, ifp->if_fib); # if INET if (mbuf->m_data[0]>>4 == 4) netisr_dispatch(NETISR_IP, mbuf); Modified: stable/8/sys/dev/ppbus/if_plip.c ============================================================================== --- stable/8/sys/dev/ppbus/if_plip.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/ppbus/if_plip.c Fri Feb 10 13:15:11 2012 (r231380) @@ -585,6 +585,8 @@ lp_intr(void *arg) if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + M_SETFIB(top, sc->sc_ifp->if_fib); + /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); ppb_lock(ppbus); @@ -637,6 +639,8 @@ lp_intr(void *arg) if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + M_SETFIB(top, sc->sc_ifp->if_fib); + /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); ppb_lock(ppbus); Modified: stable/8/sys/dev/usb/net/uhso.c ============================================================================== --- stable/8/sys/dev/usb/net/uhso.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/usb/net/uhso.c Fri Feb 10 13:15:11 2012 (r231380) @@ -1756,6 +1756,7 @@ uhso_if_rxflush(void *arg) /* Dispatch to IP layer */ BPF_MTAP(sc->sc_ifp, m); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); m = m0 != NULL ? m0 : NULL; mtx_lock(&sc->sc_mtx); Modified: stable/8/sys/net/if_arcsubr.c ============================================================================== --- stable/8/sys/net/if_arcsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_arcsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -608,6 +608,7 @@ arc_input(struct ifnet *ifp, struct mbuf m_freem(m); return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_atmsubr.c ============================================================================== --- stable/8/sys/net/if_atmsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_atmsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -332,6 +332,7 @@ atm_input(struct ifnet *ifp, struct atm_ return; } } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_ethersubr.c ============================================================================== --- stable/8/sys/net/if_ethersubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_ethersubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -692,6 +692,8 @@ ether_input(struct ifnet *ifp, struct mb m_adj(m, ETHER_VLAN_ENCAP_LEN); } + M_SETFIB(m, ifp->if_fib); + /* Allow ng_ether(4) to claim this frame. */ if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_input_p != NULL, Modified: stable/8/sys/net/if_fddisubr.c ============================================================================== --- stable/8/sys/net/if_fddisubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_fddisubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -550,6 +550,7 @@ fddi_input(ifp, m) ifp->if_noproto++; goto dropanyway; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/8/sys/net/if_fwsubr.c ============================================================================== --- stable/8/sys/net/if_fwsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_fwsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -627,6 +627,7 @@ firewire_input(struct ifnet *ifp, struct return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_gif.c ============================================================================== --- stable/8/sys/net/if_gif.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_gif.c Fri Feb 10 13:15:11 2012 (r231380) @@ -609,6 +609,7 @@ gif_input(m, af, ifp) ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_iso88025subr.c ============================================================================== --- stable/8/sys/net/if_iso88025subr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_iso88025subr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -680,6 +680,7 @@ iso88025_input(ifp, m) break; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/8/sys/net/if_spppfr.c ============================================================================== --- stable/8/sys/net/if_spppfr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_spppfr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -280,6 +280,8 @@ drop: ++ifp->if_ierrors; if (! (ifp->if_flags & IFF_UP)) goto drop; + M_SETFIB(m, ifp->if_fib); + /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/8/sys/net/if_spppsubr.c ============================================================================== --- stable/8/sys/net/if_spppsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_spppsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -737,6 +737,7 @@ sppp_input(struct ifnet *ifp, struct mbu goto drop; SPPP_UNLOCK(sp); + M_SETFIB(m, ifp->if_fib); /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/8/sys/net/if_stf.c ============================================================================== --- stable/8/sys/net/if_stf.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_stf.c Fri Feb 10 13:15:11 2012 (r231380) @@ -781,6 +781,7 @@ in_stf_input(m, off) */ ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(NETISR_IPV6, m); } Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_tun.c Fri Feb 10 13:15:11 2012 (r231380) @@ -930,6 +930,7 @@ tunwrite(struct cdev *dev, struct uio *u ifp->if_ibytes += m->m_pkthdr.len; ifp->if_ipackets++; CURVNET_SET(ifp->if_vnet); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); CURVNET_RESTORE(); return (0); Modified: stable/8/sys/netgraph/ng_iface.c ============================================================================== --- stable/8/sys/netgraph/ng_iface.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/netgraph/ng_iface.c Fri Feb 10 13:15:11 2012 (r231380) @@ -781,6 +781,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite /* First chunk of an mbuf contains good junk */ if (harvest.point_to_point) random_harvest(m, 16, 3, 0, RANDOM_NET); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 13:36:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3465C1065672; Fri, 10 Feb 2012 13:36:40 +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 1DB778FC13; Fri, 10 Feb 2012 13:36: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 q1ADad9D076270; Fri, 10 Feb 2012 13:36:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADadDT076268; Fri, 10 Feb 2012 13:36:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202101336.q1ADadDT076268@svn.freebsd.org> From: Martin Matuska Date: Fri, 10 Feb 2012 13:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231382 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:36:40 -0000 Author: mm Date: Fri Feb 10 13:36:39 2012 New Revision: 231382 URL: http://svn.freebsd.org/changeset/base/231382 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/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:35:49 2012 (r231381) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:36:39 2012 (r231382) @@ -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-8@FreeBSD.ORG Fri Feb 10 15:54:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC7F106566B; Fri, 10 Feb 2012 15:54:40 +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 1595F8FC1B; Fri, 10 Feb 2012 15:54: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 q1AFsdg0082140; Fri, 10 Feb 2012 15:54:39 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFsdgK082138; Fri, 10 Feb 2012 15:54:39 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202101554.q1AFsdgK082138@svn.freebsd.org> From: Brooks Davis Date: Fri, 10 Feb 2012 15:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231389 - stable/8/etc/rc.d X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:54:40 -0000 Author: brooks Date: Fri Feb 10 15:54:39 2012 New Revision: 231389 URL: http://svn.freebsd.org/changeset/base/231389 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/8/etc/rc.d/jail Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/jail ============================================================================== --- stable/8/etc/rc.d/jail Fri Feb 10 15:54:17 2012 (r231388) +++ stable/8/etc/rc.d/jail Fri Feb 10 15:54:39 2012 (r231389) @@ -592,10 +592,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-8@FreeBSD.ORG Fri Feb 10 16:36:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCCB106566B; Fri, 10 Feb 2012 16:36:33 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 543188FC12; Fri, 10 Feb 2012 16:36:32 +0000 (UTC) Received: by yenl12 with SMTP id l12so2040498yen.13 for ; Fri, 10 Feb 2012 08:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=yB0zCyWs7610VDrTvxQFB6s+iQp5T0n4RccoGhS6tWw=; b=MGy6GMngBdE7cVWBZq0WPObXpI0nQVlD1bjpiRDS/B9i5AyZzhqqC+GCo25CaBZlXc pGr4anjxGw9+eszpz4eJbCtIfMNOdwSAZ+lk/exbfEfr3ONRm7gIalH+3HlGOCHSU84e g1MTGLfQdMsQcFbWqSO2ADf6P7OPCM8JfrMMk= Received: by 10.50.170.41 with SMTP id aj9mr12377940igc.0.1328891792266; Fri, 10 Feb 2012 08:36:32 -0800 (PST) Received: from DataIX.net (adsl-99-19-42-38.dsl.klmzmi.sbcglobal.net. [99.19.42.38]) by mx.google.com with ESMTPS id va6sm3203627igc.4.2012.02.10.08.36.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Feb 2012 08:36:29 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q1AGaNcY083751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 11:36:23 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q1AGaM6l082841; Fri, 10 Feb 2012 11:36:22 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Fri, 10 Feb 2012 11:36:22 -0500 From: Jason Hellenthal To: "Bjoern A. Zeeb" Message-ID: <20120210163622.GA43164@DataIX.net> References: <201202100642.q1A6g1PI058085@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202100642.q1A6g1PI058085@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:36:34 -0000 Not quite sure if this is a problem with the kernel not being updated prior building this but the following errors are present without the build as I know for the mean time. Building the kernel now to test. /usr/src/sbin/ifconfig/iffib.c: In function 'fib_status': /usr/src/sbin/ifconfig/iffib.c:54: error: 'SIOCGIFFIB' undeclared (first use in this function) /usr/src/sbin/ifconfig/iffib.c:54: error: (Each undeclared identifier is reported only once /usr/src/sbin/ifconfig/iffib.c:54: error: for each function it appears in.) /usr/src/sbin/ifconfig/iffib.c:58: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c:61: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c: In function 'setiffib': /usr/src/sbin/ifconfig/iffib.c:78: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c:79: error: 'SIOCSIFFIB' undeclared (first use in this function) *** Error code 1 On Fri, Feb 10, 2012 at 06:42:01AM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Fri Feb 10 06:42:00 2012 > New Revision: 231346 > URL: http://svn.freebsd.org/changeset/base/231346 > > Log: > MFC r223735: > > Add infrastructure to allow all frames/packets received on an interface > to be assigned to a non-default FIB instance. > > Submitted by: cjsp > Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) > (original versions) > Reviewed by: julian > Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) > > Reviewed by: melifaro > > Added: > stable/8/sbin/ifconfig/iffib.c > - copied unchanged from r223735, head/sbin/ifconfig/iffib.c > Modified: > stable/8/sbin/ifconfig/Makefile > stable/8/sbin/ifconfig/ifconfig.8 > stable/8/share/man/man9/ifnet.9 > stable/8/sys/kern/kern_jail.c > stable/8/sys/net/if.c > stable/8/sys/net/if.h > stable/8/sys/net/if_debug.c > stable/8/sys/net/if_var.h > stable/8/sys/sys/priv.h > stable/8/sys/sys/sockio.h > Directory Properties: > stable/8/sbin/ifconfig/ (props changed) > stable/8/share/man/man9/ (props changed) > stable/8/sys/ (props changed) > > Modified: stable/8/sbin/ifconfig/Makefile > ============================================================================== > --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) > @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support > SRCS+= ifclone.c # clone device support > SRCS+= ifmac.c # MAC support > SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support > +SRCS+= iffib.c # non-default FIB support > SRCS+= ifvlan.c # SIOC[GS]ETVLAN support > SRCS+= ifgre.c # GRE keys etc > SRCS+= ifgif.c # GIF reversed header workaround > > Modified: stable/8/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) > @@ -294,6 +294,19 @@ Remove the interface from the given > Fill interface index > (lowermost 64bit of an IPv6 address) > automatically. > +.It Cm fib Ar fib_number > +Specify interface FIB. > +A FIB > +.Ar fib_number > +is assigned to all frames or packets received on that interface. > +The FIB is not inherited, e.g. vlans or other sub-interfaces will use > +the default FIB (0) irrespective of the parent interface's FIB. > +The kernel needs to be tuned to support more than the default FIB > +using the > +.Va ROUTETABLES > +kernel configuration option, or the > +.Va net.fibs > +tunable. > .It Cm ipdst > This is used to specify an Internet host who is willing to receive > IP packets encapsulating IPX packets bound for a remote network. > > Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) > @@ -0,0 +1,103 @@ > +/*- > + * Copyright (c) 2011 Alexander V. Chernikov > + * Copyright (c) 2011 Christian S.J. Peron > + * Copyright (c) 2011 Bjoern A. Zeeb > + * 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$ > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include "ifconfig.h" > + > +static void > +fib_status(int s) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(ifr)); > + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) > + return; > + > + /* Ignore if it is the default. */ > + if (ifr.ifr_fib == 0) > + return; > + > + printf("\tfib: %u\n", ifr.ifr_fib); > +} > + > +static void > +setiffib(const char *val, int dummy __unused, int s, > + const struct afswtch *afp) > +{ > + unsigned long fib; > + char *ep; > + > + fib = strtoul(val, &ep, 0); > + if (*ep != '\0' || fib > UINT_MAX) { > + warn("fib %s not valid", val); > + return; > + } > + > + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); > + ifr.ifr_fib = fib; > + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) > + warn("ioctl (SIOCSIFFIB)"); > +} > + > +static struct cmd fib_cmds[] = { > + DEF_CMD_ARG("fib", setiffib), > +}; > + > +static struct afswtch af_fib = { > + .af_name = "af_fib", > + .af_af = AF_UNSPEC, > + .af_other_status = fib_status, > +}; > + > +static __constructor void > +fib_ctor(void) > +{ > +#define N(a) (sizeof(a) / sizeof(a[0])) > + size_t i; > + > + for (i = 0; i < N(fib_cmds); i++) > + cmd_register(&fib_cmds[i]); > + af_register(&af_fib); > +#undef N > +} > > Modified: stable/8/share/man/man9/ifnet.9 > ============================================================================== > --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 14, 2007 > +.Dd July 3, 2011 > .Dt IFNET 9 > .Os > .Sh NAME > @@ -1156,11 +1156,12 @@ list. > Caller must have appropriate privilege. > (No call-down to driver.) > .It Dv SIOCGIFCAP > +.It Dv SIOCGIFFIB > .It Dv SIOCGIFFLAGS > .It Dv SIOCGIFMETRIC > .It Dv SIOCGIFMTU > .It Dv SIOCGIFPHYS > -Get interface capabilities, flags, metric, MTU, medium selection. > +Get interface capabilities, FIB, flags, metric, MTU, medium selection. > (No call-down to driver.) > .Pp > .It Dv SIOCSIFCAP > @@ -1179,6 +1180,12 @@ and > .Va if_data.ifi_hwassist > appropriately. > .Pp > +.It Dv SIOCSIFFIB > +Sets interface FIB. > +Caller must have appropriate privilege. > +FIB values start at 0 and values greater or equals than > +.Va net.fibs > +are considered invalid. > .It Dv SIOCSIFFLAGS > Change interface flags. > Caller must have appropriate privilege. > > Modified: stable/8/sys/kern/kern_jail.c > ============================================================================== > --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in > case PRIV_NET_LAGG: > case PRIV_NET_GIF: > case PRIV_NET_SETIFVNET: > + case PRIV_NET_SETIFFIB: > > /* > * 802.11-related privileges. > > Modified: stable/8/sys/net/if.c > ============================================================================== > --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -58,6 +58,8 @@ > #include > #include > #include > +#include > + > #include > #include > > @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > free(odescrbuf, M_IFDESCR); > break; > > + case SIOCGIFFIB: > + ifr->ifr_fib = ifp->if_fib; > + break; > + > + case SIOCSIFFIB: > + error = priv_check(td, PRIV_NET_SETIFFIB); > + if (error) > + return (error); > + if (ifr->ifr_fib >= rt_numfibs) > + return (EINVAL); > + > + ifp->if_fib = ifr->ifr_fib; > + break; > + > case SIOCSIFFLAGS: > error = priv_check(td, PRIV_NET_SETIFFLAGS); > if (error) > > Modified: stable/8/sys/net/if.h > ============================================================================== > --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -315,6 +315,7 @@ struct ifreq { > int ifru_media; > caddr_t ifru_data; > int ifru_cap[2]; > + u_int ifru_fib; > } ifr_ifru; > #define ifr_addr ifr_ifru.ifru_addr /* address */ > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ > @@ -331,6 +332,7 @@ struct ifreq { > #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ > #define ifr_index ifr_ifru.ifru_index /* interface index */ > +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > }; > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > Modified: stable/8/sys/net/if_debug.c > ============================================================================== > --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) > IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); > IF_DB_PRINTF("%d", if_snd.altq_type); > IF_DB_PRINTF("%x", if_snd.altq_flags); > + IF_DB_PRINTF("%u", if_fib); > #undef IF_DB_PRINTF > } > > > Modified: stable/8/sys/net/if_var.h > ============================================================================== > --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -207,7 +207,8 @@ struct ifnet { > char if_cspare[3]; > char *if_description; /* interface description */ > void *if_pspare[7]; > - int if_ispare[4]; > + int if_ispare[3]; > + u_int if_fib; /* interface FIB */ > }; > > typedef void if_init_f_t(void *); > > Modified: stable/8/sys/sys/priv.h > ============================================================================== > --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -336,6 +336,7 @@ > #define PRIV_NET_GIF 416 /* Administer gif interface. */ > #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ > #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ > +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > > /* > * 802.11-related privileges. > > Modified: stable/8/sys/sys/sockio.h > ============================================================================== > --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -110,6 +110,9 @@ > #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ > #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ > > +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ > +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ > + > #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific > parameters */ > #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- ;s =; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 16:41:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296EC106564A; Fri, 10 Feb 2012 16:41:24 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id AE1798FC15; Fri, 10 Feb 2012 16:41:23 +0000 (UTC) Received: by iaeo4 with SMTP id o4so681537iae.13 for ; Fri, 10 Feb 2012 08:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=EUiZXKwXvl2cv0riQUtmZMp5l/+MJr3s2WmbiYRLJDE=; b=n1c1mtzah1LfHjBgVMsGZJXHP0xmZ046P1fmhqzO0prXmvkN7F9wfBNFL9BVXFBSbq vHVW0k+g46+yFvh0G3IJB7suMBFKLKdatQfdlLXg6nU+JCp/wZBazjN51EqhQN9q2nbK KtAFQItMdYwWsVDkjRmVqxcRiT8YMVKpqbp6k= Received: by 10.42.157.133 with SMTP id d5mr10096597icx.46.1328892083105; Fri, 10 Feb 2012 08:41:23 -0800 (PST) Received: from DataIX.net (adsl-99-19-42-38.dsl.klmzmi.sbcglobal.net. [99.19.42.38]) by mx.google.com with ESMTPS id wn6sm3226106igb.3.2012.02.10.08.41.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Feb 2012 08:41:21 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q1AGfBBb077403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 11:41:11 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q1AGfB3q076736; Fri, 10 Feb 2012 11:41:11 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Fri, 10 Feb 2012 11:41:11 -0500 From: Jason Hellenthal To: "Bjoern A. Zeeb" Message-ID: <20120210164111.GB43164@DataIX.net> References: <201202100642.q1A6g1PI058085@svn.freebsd.org> <20120210163622.GA43164@DataIX.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120210163622.GA43164@DataIX.net> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:41:24 -0000 Ignore this please. I have not been feeling that great and missed the header updates :( On Fri, Feb 10, 2012 at 11:36:22AM -0500, Jason Hellenthal wrote: > > Not quite sure if this is a problem with the kernel not being updated > prior building this but the following errors are present without the > build as I know for the mean time. Building the kernel now to test. > > /usr/src/sbin/ifconfig/iffib.c: In function 'fib_status': > /usr/src/sbin/ifconfig/iffib.c:54: error: 'SIOCGIFFIB' undeclared (first > use in this function) > /usr/src/sbin/ifconfig/iffib.c:54: error: (Each undeclared identifier is > reported only once > /usr/src/sbin/ifconfig/iffib.c:54: error: for each function it appears > in.) > /usr/src/sbin/ifconfig/iffib.c:58: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c:61: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c: In function 'setiffib': > /usr/src/sbin/ifconfig/iffib.c:78: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c:79: error: 'SIOCSIFFIB' undeclared (first > use in this function) > *** Error code 1 > > On Fri, Feb 10, 2012 at 06:42:01AM +0000, Bjoern A. Zeeb wrote: > > Author: bz > > Date: Fri Feb 10 06:42:00 2012 > > New Revision: 231346 > > URL: http://svn.freebsd.org/changeset/base/231346 > > > > Log: > > MFC r223735: > > > > Add infrastructure to allow all frames/packets received on an interface > > to be assigned to a non-default FIB instance. > > > > Submitted by: cjsp > > Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) > > (original versions) > > Reviewed by: julian > > Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) > > > > Reviewed by: melifaro > > > > Added: > > stable/8/sbin/ifconfig/iffib.c > > - copied unchanged from r223735, head/sbin/ifconfig/iffib.c > > Modified: > > stable/8/sbin/ifconfig/Makefile > > stable/8/sbin/ifconfig/ifconfig.8 > > stable/8/share/man/man9/ifnet.9 > > stable/8/sys/kern/kern_jail.c > > stable/8/sys/net/if.c > > stable/8/sys/net/if.h > > stable/8/sys/net/if_debug.c > > stable/8/sys/net/if_var.h > > stable/8/sys/sys/priv.h > > stable/8/sys/sys/sockio.h > > Directory Properties: > > stable/8/sbin/ifconfig/ (props changed) > > stable/8/share/man/man9/ (props changed) > > stable/8/sys/ (props changed) > > > > Modified: stable/8/sbin/ifconfig/Makefile > > ============================================================================== > > --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) > > @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support > > SRCS+= ifclone.c # clone device support > > SRCS+= ifmac.c # MAC support > > SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support > > +SRCS+= iffib.c # non-default FIB support > > SRCS+= ifvlan.c # SIOC[GS]ETVLAN support > > SRCS+= ifgre.c # GRE keys etc > > SRCS+= ifgif.c # GIF reversed header workaround > > > > Modified: stable/8/sbin/ifconfig/ifconfig.8 > > ============================================================================== > > --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) > > @@ -294,6 +294,19 @@ Remove the interface from the given > > Fill interface index > > (lowermost 64bit of an IPv6 address) > > automatically. > > +.It Cm fib Ar fib_number > > +Specify interface FIB. > > +A FIB > > +.Ar fib_number > > +is assigned to all frames or packets received on that interface. > > +The FIB is not inherited, e.g. vlans or other sub-interfaces will use > > +the default FIB (0) irrespective of the parent interface's FIB. > > +The kernel needs to be tuned to support more than the default FIB > > +using the > > +.Va ROUTETABLES > > +kernel configuration option, or the > > +.Va net.fibs > > +tunable. > > .It Cm ipdst > > This is used to specify an Internet host who is willing to receive > > IP packets encapsulating IPX packets bound for a remote network. > > > > Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) > > @@ -0,0 +1,103 @@ > > +/*- > > + * Copyright (c) 2011 Alexander V. Chernikov > > + * Copyright (c) 2011 Christian S.J. Peron > > + * Copyright (c) 2011 Bjoern A. Zeeb > > + * 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$ > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include "ifconfig.h" > > + > > +static void > > +fib_status(int s) > > +{ > > + struct ifreq ifr; > > + > > + memset(&ifr, 0, sizeof(ifr)); > > + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > > + > > + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) > > + return; > > + > > + /* Ignore if it is the default. */ > > + if (ifr.ifr_fib == 0) > > + return; > > + > > + printf("\tfib: %u\n", ifr.ifr_fib); > > +} > > + > > +static void > > +setiffib(const char *val, int dummy __unused, int s, > > + const struct afswtch *afp) > > +{ > > + unsigned long fib; > > + char *ep; > > + > > + fib = strtoul(val, &ep, 0); > > + if (*ep != '\0' || fib > UINT_MAX) { > > + warn("fib %s not valid", val); > > + return; > > + } > > + > > + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); > > + ifr.ifr_fib = fib; > > + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) > > + warn("ioctl (SIOCSIFFIB)"); > > +} > > + > > +static struct cmd fib_cmds[] = { > > + DEF_CMD_ARG("fib", setiffib), > > +}; > > + > > +static struct afswtch af_fib = { > > + .af_name = "af_fib", > > + .af_af = AF_UNSPEC, > > + .af_other_status = fib_status, > > +}; > > + > > +static __constructor void > > +fib_ctor(void) > > +{ > > +#define N(a) (sizeof(a) / sizeof(a[0])) > > + size_t i; > > + > > + for (i = 0; i < N(fib_cmds); i++) > > + cmd_register(&fib_cmds[i]); > > + af_register(&af_fib); > > +#undef N > > +} > > > > Modified: stable/8/share/man/man9/ifnet.9 > > ============================================================================== > > --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) > > @@ -28,7 +28,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd March 14, 2007 > > +.Dd July 3, 2011 > > .Dt IFNET 9 > > .Os > > .Sh NAME > > @@ -1156,11 +1156,12 @@ list. > > Caller must have appropriate privilege. > > (No call-down to driver.) > > .It Dv SIOCGIFCAP > > +.It Dv SIOCGIFFIB > > .It Dv SIOCGIFFLAGS > > .It Dv SIOCGIFMETRIC > > .It Dv SIOCGIFMTU > > .It Dv SIOCGIFPHYS > > -Get interface capabilities, flags, metric, MTU, medium selection. > > +Get interface capabilities, FIB, flags, metric, MTU, medium selection. > > (No call-down to driver.) > > .Pp > > .It Dv SIOCSIFCAP > > @@ -1179,6 +1180,12 @@ and > > .Va if_data.ifi_hwassist > > appropriately. > > .Pp > > +.It Dv SIOCSIFFIB > > +Sets interface FIB. > > +Caller must have appropriate privilege. > > +FIB values start at 0 and values greater or equals than > > +.Va net.fibs > > +are considered invalid. > > .It Dv SIOCSIFFLAGS > > Change interface flags. > > Caller must have appropriate privilege. > > > > Modified: stable/8/sys/kern/kern_jail.c > > ============================================================================== > > --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in > > case PRIV_NET_LAGG: > > case PRIV_NET_GIF: > > case PRIV_NET_SETIFVNET: > > + case PRIV_NET_SETIFFIB: > > > > /* > > * 802.11-related privileges. > > > > Modified: stable/8/sys/net/if.c > > ============================================================================== > > --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -58,6 +58,8 @@ > > #include > > #include > > #include > > +#include > > + > > #include > > #include > > > > @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > > free(odescrbuf, M_IFDESCR); > > break; > > > > + case SIOCGIFFIB: > > + ifr->ifr_fib = ifp->if_fib; > > + break; > > + > > + case SIOCSIFFIB: > > + error = priv_check(td, PRIV_NET_SETIFFIB); > > + if (error) > > + return (error); > > + if (ifr->ifr_fib >= rt_numfibs) > > + return (EINVAL); > > + > > + ifp->if_fib = ifr->ifr_fib; > > + break; > > + > > case SIOCSIFFLAGS: > > error = priv_check(td, PRIV_NET_SETIFFLAGS); > > if (error) > > > > Modified: stable/8/sys/net/if.h > > ============================================================================== > > --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -315,6 +315,7 @@ struct ifreq { > > int ifru_media; > > caddr_t ifru_data; > > int ifru_cap[2]; > > + u_int ifru_fib; > > } ifr_ifru; > > #define ifr_addr ifr_ifru.ifru_addr /* address */ > > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ > > @@ -331,6 +332,7 @@ struct ifreq { > > #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ > > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ > > #define ifr_index ifr_ifru.ifru_index /* interface index */ > > +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > > }; > > > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > > > Modified: stable/8/sys/net/if_debug.c > > ============================================================================== > > --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) > > IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); > > IF_DB_PRINTF("%d", if_snd.altq_type); > > IF_DB_PRINTF("%x", if_snd.altq_flags); > > + IF_DB_PRINTF("%u", if_fib); > > #undef IF_DB_PRINTF > > } > > > > > > Modified: stable/8/sys/net/if_var.h > > ============================================================================== > > --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -207,7 +207,8 @@ struct ifnet { > > char if_cspare[3]; > > char *if_description; /* interface description */ > > void *if_pspare[7]; > > - int if_ispare[4]; > > + int if_ispare[3]; > > + u_int if_fib; /* interface FIB */ > > }; > > > > typedef void if_init_f_t(void *); > > > > Modified: stable/8/sys/sys/priv.h > > ============================================================================== > > --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -336,6 +336,7 @@ > > #define PRIV_NET_GIF 416 /* Administer gif interface. */ > > #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ > > #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ > > +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > > > > /* > > * 802.11-related privileges. > > > > Modified: stable/8/sys/sys/sockio.h > > ============================================================================== > > --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -110,6 +110,9 @@ > > #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ > > #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ > > > > +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ > > +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ > > + > > #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific > > parameters */ > > #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific > > _______________________________________________ > > svn-src-stable-8@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" > > -- > ;s =; -- ;s =; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 17:49:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6881065673; Fri, 10 Feb 2012 17:49:14 +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 D79598FC1B; Fri, 10 Feb 2012 17:49:14 +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 q1AHnE1g085828; Fri, 10 Feb 2012 17:49:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AHnEtO085820; Fri, 10 Feb 2012 17:49:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101749.q1AHnEtO085820@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 17:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231391 - in stable/8/sys: net80211 netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:49:15 -0000 Author: tuexen Date: Fri Feb 10 17:49:14 2012 New Revision: 231391 URL: http://svn.freebsd.org/changeset/base/231391 Log: MFC r217554: Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. For SYSCTL_PROC instances that I noticed a discrepancy between the CTLTYPE and the format specifier, fix the CTLTYPE. The commit is from mdf@ and the MFC has been discussed with him. Modified: stable/8/sys/net80211/ieee80211_freebsd.c stable/8/sys/netinet/ip_divert.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/tcp_reass.c stable/8/sys/netinet/tcp_subr.c stable/8/sys/netinet/udp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net80211/ieee80211_freebsd.c ============================================================================== --- stable/8/sys/net80211/ieee80211_freebsd.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/net80211/ieee80211_freebsd.c Fri Feb 10 17:49:14 2012 (r231391) @@ -233,7 +233,7 @@ ieee80211_sysctl_vattach(struct ieee8021 oid = SYSCTL_ADD_NODE(ctx, &SYSCTL_NODE_CHILDREN(_net, wlan), OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "%parent", CTLFLAG_RD, vap->iv_ic, 0, + "%parent", CTLTYPE_STRING | CTLFLAG_RD, vap->iv_ic, 0, ieee80211_sysctl_parent, "A", "parent device"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "driver_caps", CTLFLAG_RW, &vap->iv_caps, 0, Modified: stable/8/sys/netinet/ip_divert.c ============================================================================== --- stable/8/sys/netinet/ip_divert.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/ip_divert.c Fri Feb 10 17:49:14 2012 (r231391) @@ -708,8 +708,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) #ifdef SYSCTL_NODE SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, divert, CTLFLAG_RW, 0, "IPDIVERT"); -SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, 0, 0, - div_pcblist, "S,xinpcb", "List of active divert sockets"); +SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, + NULL, 0, div_pcblist, "S,xinpcb", "List of active divert sockets"); #endif struct pr_usrreqs div_usrreqs = { Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/raw_ip.c Fri Feb 10 17:49:14 2012 (r231391) @@ -1103,7 +1103,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); struct pr_usrreqs rip_usrreqs = { Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 17:49:14 2012 (r231391) @@ -810,230 +810,230 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_nonce), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_NONCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_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_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_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); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); /* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); @@ -1042,7 +1042,7 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_OPAQUE | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); @@ -1050,43 +1050,43 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cl #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_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_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_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); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); #endif /* SCTP_DEBUG */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif @@ -1101,6 +1101,6 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); Modified: stable/8/sys/netinet/tcp_reass.c ============================================================================== --- stable/8/sys/netinet/tcp_reass.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/tcp_reass.c Fri Feb 10 17:49:14 2012 (r231391) @@ -82,19 +82,22 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rea static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, + CTLTYPE_INT | CTLFLAG_RDTUN, &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", "Global maximum number of TCP Segments in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_qsize) = 0; #define V_tcp_reass_qsize VNET(tcp_reass_qsize) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/tcp_subr.c Fri Feb 10 17:49:14 2012 (r231391) @@ -1246,7 +1246,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); static int Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/udp_usrreq.c Fri Feb 10 17:49:14 2012 (r231391) @@ -820,7 +820,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, udp_pcblist, "S,xinpcb", "List of active UDP sockets"); static int From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 18:15:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19FAD1065674; Fri, 10 Feb 2012 18:15:46 +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 ED2FF8FC14; Fri, 10 Feb 2012 18:15: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 q1AIFjA2086801; Fri, 10 Feb 2012 18:15:45 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIFjio086799; Fri, 10 Feb 2012 18:15:45 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202101815.q1AIFjio086799@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Feb 2012 18:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231393 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:15:46 -0000 Author: ken Date: Fri Feb 10 18:15:45 2012 New Revision: 231393 URL: http://svn.freebsd.org/changeset/base/231393 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/8/share/man/man4/mps.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mps.4 ============================================================================== --- stable/8/share/man/man4/mps.4 Fri Feb 10 18:14:25 2012 (r231392) +++ stable/8/share/man/man4/mps.4 Fri Feb 10 18:15:45 2012 (r231393) @@ -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 +dev.mps.X.disable_msix=1 +.Ed +.Pp +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.X.allow_multiple_tm_cmds=1 +hw.mps.max_chains=NNNN .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 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,22 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 -.Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: -.Bl -bullet -compact -.It -No IR (Integrated RAID) support. -.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. -.It -The error recovery code isn't complete. -.El +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -169,5 +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 has a couple of known shortcomings: +.Bl -bullet -compact +.It +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). +.It +No userland utility available (e.g. +.Xr mptutil 8) +.It +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-8@FreeBSD.ORG Fri Feb 10 18:43:05 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E641065675; Fri, 10 Feb 2012 18:43:05 +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 399448FC1D; Fri, 10 Feb 2012 18:43: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 q1AIh5J5087811; Fri, 10 Feb 2012 18:43:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIh49T087801; Fri, 10 Feb 2012 18:43:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101843.q1AIh49T087801@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231395 - in stable/8/sys: conf netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:43:05 -0000 Author: tuexen Date: Fri Feb 10 18:43:04 2012 New Revision: 231395 URL: http://svn.freebsd.org/changeset/base/231395 Log: MFC r217760: Add stream scheduling support. This work is based on a patch received from Robin Seggelmann. Added: stable/8/sys/netinet/sctp_ss_functions.c - copied unchanged from r217760, head/sys/netinet/sctp_ss_functions.c Modified: stable/8/sys/conf/files stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/conf/files Fri Feb 10 18:43:04 2012 (r231395) @@ -2617,6 +2617,7 @@ netinet/sctp_input.c optional inet sctp netinet/sctp_output.c optional inet sctp netinet/sctp_pcb.c optional inet sctp netinet/sctp_peeloff.c optional inet sctp +netinet/sctp_ss_functions.c optional inet sctp netinet/sctp_sysctl.c optional inet sctp netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 18:43:04 2012 (r231395) @@ -158,6 +158,9 @@ struct sctp_paramhdr { #define SCTP_CMT_USE_DAC 0x00001201 /* JRS - Pluggable Congestion Control Socket option */ #define SCTP_PLUGGABLE_CC 0x00001202 +/* RS - Pluggable Stream Scheduling Socket option */ +#define SCTP_PLUGGABLE_SS 0x00001203 +#define SCTP_SS_VALUE 0x00001204 /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 @@ -253,6 +256,22 @@ struct sctp_paramhdr { /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RS - Supported stream scheduling modules for pluggable + * stream scheduling + */ +/* Default simple round-robin */ +#define SCTP_SS_DEFAULT 0x00000000 +/* Real round-robin */ +#define SCTP_SS_ROUND_ROBIN 0x00000001 +/* Real round-robin per packet */ +#define SCTP_SS_ROUND_ROBIN_PACKET 0x00000002 +/* Priority */ +#define SCTP_SS_PRIORITY 0x00000003 +/* Fair Bandwidth */ +#define SCTP_SS_FAIR_BANDWITH 0x00000004 +/* First-come, first-serve */ +#define SCTP_SS_FIRST_COME 0x00000005 + /* fragment interleave constants * setting must be one of these or Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:43:04 2012 (r231395) @@ -193,8 +193,8 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp, *nsp; - struct sctp_stream_out *strq; + unsigned int i; + struct sctp_stream_queue_pending *sp; struct sctp_association *asoc; /* @@ -205,9 +205,14 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - /* sa_ignore FREED_MEMORY */ - TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { + if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + /* Check to see if some data queued */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + /* sa_ignore FREED_MEMORY */ + sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + if (sp == NULL) { + continue; + } if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -224,8 +229,8 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&asoc->stream_queue_cnt, 1); - TAILQ_REMOVE(&strq->outqueue, sp, next); + atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -957,7 +962,7 @@ sctp_handle_shutdown_ack(struct sctp_shu /* are the queues empty? */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } /* stop the timer */ @@ -3033,7 +3038,7 @@ sctp_handle_shutdown_complete(struct sct /* are the queues empty? they should be */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:43:04 2012 (r231395) @@ -5616,52 +5616,6 @@ do_a_abort: } -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holds_lock) -{ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->next_spoke.tqe_next == NULL) && - (strq->next_spoke.tqe_prev == NULL)) { - TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke); - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - -void -sctp_remove_from_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, - int holds_lock) -{ - /* take off and then setup so we know it is not on the wheel */ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if (TAILQ_EMPTY(&strq->outqueue)) { - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, next_spoke); - if (asoc->last_out_stream == NULL) { - asoc->last_out_stream = TAILQ_LAST(&asoc->out_wheel, sctpwheel_listhead); - } - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = NULL; - } - } - TAILQ_REMOVE(&asoc->out_wheel, strq, next_spoke); - strq->next_spoke.tqe_next = NULL; - strq->next_spoke.tqe_prev = NULL; - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - static void sctp_prune_prsctp(struct sctp_tcb *stcb, struct sctp_association *asoc, @@ -5924,11 +5878,7 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->strseq = strm->next_sequence_sent; strm->next_sequence_sent++; } - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, &stcb->asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; SCTP_TCB_SEND_UNLOCK(stcb); out_now: @@ -6743,6 +6693,7 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7152,6 +7103,7 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7181,24 +7133,6 @@ out_of: } -static struct sctp_stream_out * -sctp_select_a_stream(struct sctp_tcb *stcb, struct sctp_association *asoc) -{ - struct sctp_stream_out *strq; - - /* Find the next stream to use */ - if (asoc->last_out_stream == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } else { - strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } - } - return (strq); -} - - static void sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) @@ -7207,7 +7141,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb struct sctp_stream_out *strq, *strqn; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; - struct sctp_stream_queue_pending *sp; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; @@ -7231,46 +7164,17 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = asoc->locked_on_sending; locked = 1; } else { - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } strqn = strq; while ((goal_mtu > 0) && strq) { - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - break; - } - /** - * Honor the users' choice if given. If not given, - * pull it only to the primary path in case of not using - * CMT. - */ - if (((sp->net != NULL) && - (sp->net != net)) || - ((sp->net == NULL) && - (asoc->sctp_cmt_on_off == 0) && - (asoc->primary_destination != net))) { - /* Do not pull to this network */ - if (locked) { - break; - } else { - strq = sctp_select_a_stream(stcb, asoc); - if (strq == NULL) - /* none left */ - break; - if (strqn == strq) { - /* I have circled */ - break; - } - continue; - } - } giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, &giveup, eeor_mode, &bail); if (moved_how_much) - asoc->last_out_stream = strq; + stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); if (locked) { asoc->locked_on_sending = strq; @@ -7279,23 +7183,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb break; } else { asoc->locked_on_sending = NULL; - if (TAILQ_EMPTY(&strq->outqueue)) { - if (strq == strqn) { - /* Must move start to next one */ - strqn = TAILQ_NEXT(strq, next_spoke); - if (strqn == NULL) { - strqn = TAILQ_FIRST(&asoc->out_wheel); - if (strqn == NULL) { - break; - } - } - } - sctp_remove_from_wheel(stcb, asoc, strq, 0); - } if ((giveup) || bail) { break; } - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); if (strq == NULL) { break; } @@ -7307,6 +7198,8 @@ sctp_fill_outqueue(struct sctp_tcb *stcb if (bail) *quit_now = 1; + stcb->asoc.ss_functions.sctp_ss_packet_done(stcb, net, asoc); + if (total_moved == 0) { if ((stcb->asoc.sctp_cmt_on_off == 0) && (net == stcb->asoc.primary_destination)) { @@ -7335,16 +7228,16 @@ void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *asoc; - struct sctp_stream_out *outs; struct sctp_tmit_chunk *chk; struct sctp_stream_queue_pending *sp; + unsigned int i; if (net == NULL) { return; } asoc = &stcb->asoc; - TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { - TAILQ_FOREACH(sp, &outs->outqueue, next) { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { if (sp->net == net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7437,7 +7330,7 @@ sctp_med_chunk_output(struct sctp_inpcb if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { *reason_code = 9; return (0); } @@ -7454,7 +7347,8 @@ sctp_med_chunk_output(struct sctp_inpcb max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; else max_send_per_dest = 0; - if ((no_data_chunks == 0) && (!TAILQ_EMPTY(&asoc->out_wheel))) { + if ((no_data_chunks == 0) && + (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc))) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { /* * This for loop we are in takes in each net, if @@ -9638,7 +9532,7 @@ sctp_chunk_output(struct sctp_inpcb *inp } if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { /* Nothing left to send */ break; } @@ -12447,8 +12341,7 @@ sctp_lower_sosend(struct socket *so, TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->strmout[i].next_spoke.tqe_next = 0; - asoc->strmout[i].next_spoke.tqe_prev = 0; + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); } } } @@ -12841,11 +12734,7 @@ skip_preblock: SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp, 1); SCTP_TCB_SEND_UNLOCK(stcb); } else { SCTP_TCB_SEND_LOCK(stcb); Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:43:04 2012 (r231395) @@ -135,11 +135,6 @@ int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holdslock); - void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:43:04 2012 (r231395) @@ -2517,6 +2517,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); + m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:43:04 2012 (r231395) @@ -276,6 +276,7 @@ struct sctp_pcb { uint32_t sctp_sws_receiver; uint32_t sctp_default_cc_module; + uint32_t sctp_default_ss_module; /* authentication related fields */ struct sctp_keyhead shared_keys; sctp_auth_chklist_t *local_auth_chunks; Copied: stable/8/sys/netinet/sctp_ss_functions.c (from r217760, head/sys/netinet/sctp_ss_functions.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 18:43:04 2012 (r231395, copy of r217760, head/sys/netinet/sctp_ss_functions.c) @@ -0,0 +1,914 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * 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. + * + * 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. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/* + * Default simple round-robin algorithm. + * Just interates the streams in the order they appear. + */ + +static void +sctp_ss_default_add(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_remove(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_init(struct sctp_tcb *stcb, struct sctp_association *asoc, + int holds_lock) +{ + uint16_t i; + + TAILQ_INIT(&asoc->ss_data.out_wheel); + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_add(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_remove(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + return; +} + +static void +sctp_ss_default_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, + strq, ss_params.rr.next_spoke); + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static int +sctp_ss_default_is_empty(struct sctp_tcb *stcb, struct sctp_association *asoc) +{ + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + return (1); + } else { + return (0); + } +} + +static void +sctp_ss_default_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, + sctpwheel_listhead, + ss_params.rr.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + + +static struct sctp_stream_out * +sctp_ss_default_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +default_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto default_again; + } + } + } + return (strq); +} + +static void +sctp_ss_default_scheduled(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc, + struct sctp_stream_out *strq, int moved_how_much) +{ + asoc->last_out_stream = strq; + return; +} + +static void +sctp_ss_default_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + /* Nothing to be done here */ + return; +} + +static int +sctp_ss_default_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + /* Nothing to be done here */ + return (-1); +} + +static int +sctp_ss_default_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + /* Nothing to be done here */ + return (-1); +} + +/* + * Real round-robin algorithm. + * Always interates the streams in ascending order. + */ +static void +sctp_ss_rr_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && (strqt->stream_no < strq->stream_no)) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +/* + * Real round-robin per packet algorithm. + * Always interates the streams in ascending order and + * only fills messages of the same stream in a packet. + */ +static void +sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->stream_no < strq->stream_no) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; + if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { + return (strqt); + } +rrp_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto rrp_again; + } + } + } + return (strq); +} + +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +rrp_pd_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && + (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + if (strq == asoc->last_out_stream) { + strq = NULL; + } else { + strqt = strq; + goto rrp_pd_again; + } + } + asoc->last_out_stream = strq; + return; +} + + +/* + * Priority algorithm. + * Always prefers streams based on their priority id. + */ +static void +sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) + stcb->asoc.strmout[i].ss_params.prio.priority = 0; + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_prio_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + strq->ss_params.prio.priority = 0; + return; +} + +static void +sctp_ss_prio_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->ss_params.prio.priority < strq->ss_params.prio.priority) { + strqt = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.prio.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static void +sctp_ss_prio_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, + ss_params.prio.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_prio_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt, *strqn; + + strqt = asoc->last_out_stream; +prio_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + if (strqn != NULL && + strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { + strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } else { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto prio_again; + } + } + } + return (strq); +} + +static int +sctp_ss_prio_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + if (strq == NULL) { + return (-1); + } + *value = strq->ss_params.prio.priority; + return (1); +} + +static int +sctp_ss_prio_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + if (strq == NULL) { + return (-1); + } + strq->ss_params.prio.priority = value; + sctp_ss_prio_remove(stcb, asoc, strq, NULL, 1); + sctp_ss_prio_add(stcb, asoc, strq, NULL, 1); + return (1); +} + +/* + * Fair bandwidth algorithm. + * Maintains an equal troughput per stream. + */ +static void +sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) { + stcb->asoc.strmout[i].ss_params.fb.rounds = -1; + } + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_fb_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + strq->ss_params.fb.rounds = -1; + return; +} + +static void +sctp_ss_fb_add(struct sctp_tcb *stcb, struct sctp_association *asoc, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 18:49:29 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910AB1065672; Fri, 10 Feb 2012 18:49:29 +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 79FAD8FC13; Fri, 10 Feb 2012 18:49: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 q1AInTws088070; Fri, 10 Feb 2012 18:49:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AInTa3088063; Fri, 10 Feb 2012 18:49:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101849.q1AInTa3088063@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231396 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:49:29 -0000 Author: tuexen Date: Fri Feb 10 18:49:28 2012 New Revision: 231396 URL: http://svn.freebsd.org/changeset/base/231396 Log: MFC r217894: Change infrastructure for SCTP_MAX_BURST to allow compliance with the latest socket API ID. Especially it can be disabled. Full compliance needs changing the structure used in the socket option. Since this breaks the API, it will be a seperate commit which will not be MFCed to stable/8. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 18:49:28 2012 (r231396) @@ -601,8 +601,11 @@ sctp_cwnd_update_after_packet_dropped(st * Take 1/4 of the space left or max burst up .. whichever * is less. */ - incr = min((bw_avail - *on_queue) >> 2, - stcb->asoc.max_burst * net->mtu); + incr = (bw_avail - *on_queue) >> 2; + if ((stcb->asoc.max_burst > 0) && + (stcb->asoc.max_burst * net->mtu < incr)) { + incr = stcb->asoc.max_burst * net->mtu; + } net->cwnd += incr; } if (net->cwnd > bw_avail) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:49:28 2012 (r231396) @@ -9322,7 +9322,7 @@ sctp_chunk_output(struct sctp_inpcb *inp struct sctp_association *asoc; struct sctp_nets *net; int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0, burst_limit = 0; + burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; @@ -9425,12 +9425,11 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if (tot_frs > asoc->max_burst) { + if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { /* Hit FR burst limit */ return; } if ((num_out == 0) && (ret == 0)) { - /* No more retrans to send */ break; } @@ -9439,7 +9438,6 @@ sctp_chunk_output(struct sctp_inpcb *inp sctp_auditing(12, inp, stcb, NULL); #endif /* Check for bad destinations, if they exist move chunks around. */ - burst_limit = asoc->max_burst; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == SCTP_ADDR_NOT_REACHABLE) { @@ -9468,24 +9466,29 @@ sctp_chunk_output(struct sctp_inpcb *inp * { burst_limit = asoc->max_burst * * SCTP_SAT_NETWORK_BURST_INCR; } */ - if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { - if ((net->flight_size + (burst_limit * net->mtu)) < net->cwnd) { - /* - * JRS - Use the congestion control - * given in the congestion control - * module - */ - asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, burst_limit); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { - sctp_log_maxburst(stcb, net, 0, burst_limit, SCTP_MAX_BURST_APPLIED); + if (asoc->max_burst > 0) { + if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { + if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) { + /* + * JRS - Use the congestion + * control given in the + * congestion control module + */ + asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { + sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED); + } + SCTP_STAT_INCR(sctps_maxburstqueued); + } + net->fast_retran_ip = 0; + } else { + if (net->flight_size == 0) { + /* + * Should be decaying the + * cwnd here + */ + ; } - SCTP_STAT_INCR(sctps_maxburstqueued); - } - net->fast_retran_ip = 0; - } else { - if (net->flight_size == 0) { - /* Should be decaying the cwnd here */ - ; } } } @@ -9540,11 +9543,13 @@ sctp_chunk_output(struct sctp_inpcb *inp /* Nothing left to send */ break; } - } while (num_out && (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || - (burst_cnt < burst_limit))); + } while (num_out && + ((asoc->max_burst == 0) || + SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || + (burst_cnt < asoc->max_burst))); if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) == 0) { - if (burst_cnt >= burst_limit) { + if ((asoc->max_burst > 0) && (burst_cnt >= asoc->max_burst)) { SCTP_STAT_INCR(sctps_maxburstqueued); asoc->burst_limit_applied = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:49:28 2012 (r231396) @@ -317,7 +317,7 @@ struct sctp_pcb { uint32_t initial_sequence_debug; uint32_t adaptation_layer_indicator; uint32_t store_at; - uint8_t max_burst; + uint32_t max_burst; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:49:28 2012 (r231396) @@ -1058,7 +1058,7 @@ struct sctp_association { uint8_t send_sack; /* max burst after fast retransmit completes */ - uint8_t max_burst; + uint32_t max_burst; uint8_t sat_network; /* RTT is in range of sat net or greater */ uint8_t sat_network_lockout; /* lockout code */ Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 18:49:28 2012 (r231396) @@ -184,7 +184,7 @@ struct sctp_sysctl { /* maxburst: Default max burst for sctp endpoints */ #define SCTPCTL_MAXBURST_DESC "Default max burst for sctp endpoints" -#define SCTPCTL_MAXBURST_MIN 1 +#define SCTPCTL_MAXBURST_MIN 0 #define SCTPCTL_MAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 18:49:28 2012 (r231396) @@ -1972,7 +1972,11 @@ flags_out: SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize); SCTP_INP_RLOCK(inp); - *value = inp->sctp_ep.max_burst; + if (inp->sctp_ep.max_burst < 256) { + *value = inp->sctp_ep.max_burst; + } else { + *value = 255; + } SCTP_INP_RUNLOCK(inp); *optsize = sizeof(uint8_t); } @@ -3591,9 +3595,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize); SCTP_INP_WLOCK(inp); - if (*burst) { - inp->sctp_ep.max_burst = *burst; - } + inp->sctp_ep.max_burst = *burst; SCTP_INP_WUNLOCK(inp); } break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 18:53:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A53A106564A; Fri, 10 Feb 2012 18:53:40 +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 43D788FC0C; Fri, 10 Feb 2012 18:53: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 q1AIrepE088245; Fri, 10 Feb 2012 18:53:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIreuY088243; Fri, 10 Feb 2012 18:53:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101853.q1AIreuY088243@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231397 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:53:40 -0000 Author: tuexen Date: Fri Feb 10 18:53:39 2012 New Revision: 231397 URL: http://svn.freebsd.org/changeset/base/231397 Log: MFC r217913: * Use 300 ms as the default for RTO_MIN. * Disable burst mitigation by default. * Remove unused constant. Discussed with rrs. Modified: stable/8/sys/netinet/sctp_constants.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 18:49:28 2012 (r231396) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 18:53:39 2012 (r231397) @@ -343,8 +343,8 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 -/* default max I can burst out after a fast retransmit */ -#define SCTP_DEF_MAX_BURST 4 +/* default max I can burst out after a fast retransmit, 0 disables it */ +#define SCTP_DEF_MAX_BURST 0 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -642,8 +642,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */ -#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec in ms */ +#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 18:55:51 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05CCD106564A; Fri, 10 Feb 2012 18:55: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 CAB3D8FC13; Fri, 10 Feb 2012 18:55: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 q1AItoBg088370; Fri, 10 Feb 2012 18:55:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AItoxl088367; Fri, 10 Feb 2012 18:55:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101855.q1AItoxl088367@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231398 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:55:51 -0000 Author: tuexen Date: Fri Feb 10 18:55:50 2012 New Revision: 231398 URL: http://svn.freebsd.org/changeset/base/231398 Log: MFC r218037: Fix a bug in the way ECN-Echo chunk sends were being accounted for. The counting was such that we counted only when we queued a chunk, not when we sent it. Now keep an additional counter for queuing and one for sending. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:53:39 2012 (r231397) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:55:50 2012 (r231398) @@ -7809,6 +7809,20 @@ again_one_more_time: if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) { cookie = 1; no_out_cnt = 1; + } else if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + /* + * Increment ecne send count + * here this means we may be + * over-zealous in our + * counting if the send + * fails, but its the best + * place to do it (we used + * to do it in the queue of + * the chunk, but that did + * not tell how many times + * it was sent. + */ + SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; chk->snd_count++; @@ -10751,6 +10765,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb /* found a previous ECN_ECHO update it if needed */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); ecne->tsn = htonl(high_tsn); + SCTP_STAT_INCR(sctps_queue_upd_ecne); return; } } @@ -10760,7 +10775,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb return; } chk->copy_by_ref = 0; - SCTP_STAT_INCR(sctps_sendecne); + SCTP_STAT_INCR(sctps_queue_upd_ecne); chk->rec.chunk_id.id = SCTP_ECN_ECHO; chk->rec.chunk_id.can_take_data = 0; chk->asoc = &stcb->asoc; Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 18:53:39 2012 (r231397) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 18:55:50 2012 (r231398) @@ -946,8 +946,9 @@ struct sctpstat { * max burst inflight to net */ uint32_t sctps_fwdtsn_map_over; /* number of map array over-runs via * fwd-tsn's */ - - uint32_t sctps_reserved[32]; /* Future ABI compat - remove int's + uint32_t sctps_queue_upd_ecne; /* Number of times we queued or + * updated an ECN chunk on send queue */ + uint32_t sctps_reserved[31]; /* Future ABI compat - remove int's * from here when adding new */ }; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 18:58:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CAE6106564A; Fri, 10 Feb 2012 18:58:37 +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 168548FC0C; Fri, 10 Feb 2012 18:58:37 +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 q1AIwa0Q088507; Fri, 10 Feb 2012 18:58:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIwaSd088504; Fri, 10 Feb 2012 18:58:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101858.q1AIwaSd088504@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231399 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:58:37 -0000 Author: tuexen Date: Fri Feb 10 18:58:36 2012 New Revision: 231399 URL: http://svn.freebsd.org/changeset/base/231399 Log: MFC r218039: Keep track of the real last RTT on each net. This will be used for Data Center congestion control, we won't want to engage it in the ECN code unless we KNOW that the RTT is less than 500us. From rrs@ Modified: stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:55:50 2012 (r231398) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:58:36 2012 (r231399) @@ -266,7 +266,7 @@ struct sctp_nets { uint32_t tos_flowlabel; struct timeval start_time; /* time when this net was created */ - + struct timeval last_measured_rtt; uint32_t marked_retrans;/* number or DATA chunks marked for timer * based retransmissions */ uint32_t marked_fastretrans; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 18:55:50 2012 (r231398) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 18:58:36 2012 (r231399) @@ -2500,6 +2500,13 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); + + /* + * Record the real time of the last RTT for use in DC-CC. + */ + net->last_measured_rtt = now; + timevalsub(&net->last_measured_rtt, old); + /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:02:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53B44106566C; Fri, 10 Feb 2012 19:02: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 3C7318FC16; Fri, 10 Feb 2012 19:02: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 q1AJ28Bg088685; Fri, 10 Feb 2012 19:02:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ27cG088675; Fri, 10 Feb 2012 19:02:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101902.q1AJ27cG088675@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231400 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:02:08 -0000 Author: tuexen Date: Fri Feb 10 19:02:07 2012 New Revision: 231400 URL: http://svn.freebsd.org/changeset/base/231400 Log: MFC r218072: Fixes to ECN in SCTP. 1) ECN was on an association basis, this is incorrect and will not work with CMT or for that matter if the user is sending to multiple addresses. This commit makes ECN on a per path basis. 2) Adopt the new format for the ECN internet draft. This also maintains compatability with old format chunks as well. 3) Keep track of the real time of a RTT down to micro seconds. For some future conditional features (for like a data center this is good information to have). From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 19:02:07 2012 (r231400) @@ -417,6 +417,10 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BADCRC 0x02 #define SCTP_PACKET_TRUNCATED 0x04 +/* Flag for ECN -CWR */ +#define SCTP_CWR_REDUCE_OVERRIDE 0x01 +#define SCTP_CWR_IN_SAME_WINDOW 0x02 + #define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite * time */ #define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:02:07 2012 (r231400) @@ -360,9 +360,15 @@ struct sctp_cookie_ack_chunk { } SCTP_PACKED; /* Explicit Congestion Notification Echo (ECNE) */ +struct old_sctp_ecne_chunk { + struct sctp_chunkhdr ch; + uint32_t tsn; +} SCTP_PACKED; + struct sctp_ecne_chunk { struct sctp_chunkhdr ch; uint32_t tsn; + uint32_t num_pkts_since_cwr; } SCTP_PACKED; /* Congestion Window Reduced (CWR) */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:02:07 2012 (r231400) @@ -3829,6 +3829,10 @@ sctp_express_handle_sack(struct sctp_tcb } /* First setup for CC stuff */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cumack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; @@ -4522,6 +4526,10 @@ sctp_handle_sack(struct mbuf *m, int off * destination address basis. */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cum_ack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cum_ack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:02:07 2012 (r231400) @@ -1678,8 +1678,6 @@ sctp_process_cookie_existing(struct mbuf asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); - /* Note last_cwr_tsn? where is this used? */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; if (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) { /* * Ok the peer probably discarded our data (if we @@ -1835,7 +1833,6 @@ sctp_process_cookie_existing(struct mbuf asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2073,7 +2070,6 @@ sctp_process_cookie_new(struct mbuf *m, asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn); asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2917,25 +2913,38 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch { struct sctp_nets *net; struct sctp_tmit_chunk *lchk; - uint32_t tsn; - - if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_ecne_chunk)) { + struct sctp_ecne_chunk bkup; + uint8_t override_bit = 0; + uint32_t tsn, window_data_tsn; + int len; + int pkt_cnt; + + len = ntohs(cp->ch.chunk_length); + if ((len != sizeof(struct sctp_ecne_chunk)) && + (len != sizeof(struct old_sctp_ecne_chunk))) { return; } + if (len == sizeof(struct old_sctp_ecne_chunk)) { + /* Its the old format */ + memcpy(&bkup, cp, sizeof(struct old_sctp_ecne_chunk)); + bkup.num_pkts_since_cwr = htonl(1); + cp = &bkup; + } SCTP_STAT_INCR(sctps_recvecne); tsn = ntohl(cp->tsn); + pkt_cnt = ntohl(cp->num_pkts_since_cwr); /* ECN Nonce stuff: need a resync and disable the nonce sum check */ /* Also we make sure we disable the nonce_wait */ - lchk = TAILQ_FIRST(&stcb->asoc.send_queue); + lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); if (lchk == NULL) { - stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq - 1; } else { - stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; } stcb->asoc.nonce_wait_for_ecne = 0; stcb->asoc.nonce_sum_check = 0; - /* Find where it was sent, if possible */ + /* Find where it was sent to if possible. */ net = NULL; TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { if (lchk->rec.data.TSN_seq == tsn) { @@ -2946,32 +2955,71 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch break; } } - if (net == NULL) - /* default is we use the primary */ - net = stcb->asoc.primary_destination; - - if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { + if (net == NULL) { + /* + * What to do. A previous send of a CWR was possibly lost. + * See how old it is, we may have it marked on the actual + * net. + */ + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + if (tsn == net->last_cwr_tsn) { + /* Found him, send it off */ + goto out; + } + } + /* + * 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; + } +out: + if (SCTP_TSN_GT(tsn, net->cwr_window_tsn)) { /* * 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); /* - * we reduce once every RTT. So we will only lower cwnd at - * the next sending seq i.e. the resync_tsn. + * We reduce once every RTT. So we will only lower cwnd at + * the next sending seq i.e. the window_data_tsn */ - stcb->asoc.last_cwr_tsn = stcb->asoc.nonce_resync_tsn; + net->cwr_window_tsn = window_data_tsn; + net->ecn_ce_pkt_cnt += pkt_cnt; + net->lost_cnt = pkt_cnt; + net->last_cwr_tsn = tsn; + } else { + override_bit |= SCTP_CWR_IN_SAME_WINDOW; + if (SCTP_TSN_GT(tsn, net->last_cwr_tsn)) { + /* + * Another loss in the same window update how man + * marks we have had + */ + + if (pkt_cnt > net->lost_cnt) { + /* Should be the case */ + net->ecn_ce_pkt_cnt += (pkt_cnt - net->lost_cnt); + net->lost_cnt = pkt_cnt; + } + net->last_cwr_tsn = tsn; + } } /* * We always send a CWR this way if our previous one was lost our * peer will get an update, or if it is not time again to reduce we - * still get the cwr to the peer. + * still get the cwr to the peer. Note we set the override when we + * could not find the TSN on the chunk or the destination network. */ - sctp_send_cwr(stcb, net, tsn); + sctp_send_cwr(stcb, net, net->last_cwr_tsn, override_bit); } static void -sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb) +sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { /* * Here we get a CWR from the peer. We must look in the outqueue and @@ -2980,18 +3028,22 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun */ struct sctp_tmit_chunk *chk; struct sctp_ecne_chunk *ecne; + int override; + uint32_t cwr_tsn; + + cwr_tsn = ntohl(cp->tsn); + override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { continue; } - /* - * Look for and remove if it is the right TSN. Since there - * is only ONE ECNE on the control queue at any one time we - * don't need to worry about more than one! - */ + if ((override == 0) && (chk->whoTo != net)) { + /* Must be from the right src unless override is set */ + continue; + } ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { + if (SCTP_TSN_GE(cwr_tsn, ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3002,7 +3054,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun } stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk); - break; + if (override == 0) { + break; + } } } } @@ -5043,7 +5097,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb); + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); } break; case SCTP_SHUTDOWN_COMPLETE: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:02:07 2012 (r231400) @@ -7274,7 +7274,7 @@ sctp_med_chunk_output(struct sctp_inpcb * fomulate and send the low level chunks. Making sure to combine * any control in the control chunk queue also. */ - struct sctp_nets *net, *start_at, *old_start_at = NULL; + struct sctp_nets *net, *start_at, *sack_goes_to = NULL, *old_start_at = NULL; struct mbuf *outchain, *endoutchain; struct sctp_tmit_chunk *chk, *nchk; @@ -7327,10 +7327,12 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 0; /* Nothing to possible to send? */ - if (TAILQ_EMPTY(&asoc->control_send_queue) && + if ((TAILQ_EMPTY(&asoc->control_send_queue) || + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { +nothing_to_send: *reason_code = 9; return (0); } @@ -7342,6 +7344,21 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 1; } } + if (stcb->asoc.ecn_echo_cnt_onq) { + /* Record where a sack goes, if any */ + if (no_data_chunks && + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) { + /* Nothing but ECNe to send - we don't do that */ + goto nothing_to_send; + } + TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { + if ((chk->rec.chunk_id.id == SCTP_SELECTIVE_ACK) || + (chk->rec.chunk_id.id == SCTP_NR_SELECTIVE_ACK)) { + sack_goes_to = chk->whoTo; + break; + } + } + } max_rwnd_per_dest = ((asoc->peers_rwnd + asoc->total_flight) / asoc->numnets); if (stcb->sctp_socket) max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; @@ -7685,6 +7702,28 @@ again_one_more_time: /************************/ /* Now first lets go through the control queue */ TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { + if ((sack_goes_to) && + (chk->rec.chunk_id.id == SCTP_ECN_ECHO) && + (chk->whoTo != sack_goes_to)) { + /* + * if we have a sack in queue, and we are + * looking at an ecn echo that is NOT queued + * to where the sack is going.. + */ + if (chk->whoTo == net) { + /* + * Don't transmit it to where its + * going (current net) + */ + continue; + } else if (sack_goes_to == net) { + /* + * But do transmit it to this + * address + */ + goto skip_net_check; + } + } if (chk->whoTo != net) { /* * No, not sent to the network we are @@ -7692,6 +7731,7 @@ again_one_more_time: */ continue; } + skip_net_check: if (chk->data == NULL) { continue; } @@ -10761,11 +10801,19 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + if ((chk->rec.chunk_id.id == SCTP_ECN_ECHO) && (net == chk->whoTo)) { /* found a previous ECN_ECHO update it if needed */ + uint32_t cnt, ctsn; + ecne = mtod(chk->data, struct sctp_ecne_chunk *); - ecne->tsn = htonl(high_tsn); - SCTP_STAT_INCR(sctps_queue_upd_ecne); + ctsn = ntohl(ecne->tsn); + if (SCTP_TSN_GT(high_tsn, ctsn)) { + ecne->tsn = htonl(high_tsn); + cnt = ntohl(ecne->num_pkts_since_cwr); + cnt++; + ecne->num_pkts_since_cwr = htonl(cnt); + SCTP_STAT_INCR(sctps_queue_upd_ecne); + } return; } } @@ -10797,7 +10845,8 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb ecne->ch.chunk_flags = 0; ecne->ch.chunk_length = htons(sizeof(struct sctp_ecne_chunk)); ecne->tsn = htonl(high_tsn); - TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); + ecne->num_pkts_since_cwr = htonl(1); + TAILQ_INSERT_HEAD(&stcb->asoc.control_send_queue, chk, sctp_next); asoc->ctrl_queue_cnt++; } @@ -10975,7 +11024,7 @@ jump_out: } void -sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn) +sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override) { struct sctp_association *asoc; struct sctp_cwr_chunk *cwr; @@ -10983,17 +11032,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); - TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { - /* found a previous ECN_CWR update it if needed */ - cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { - cwr->tsn = htonl(high_tsn); - } - return; - } - } - /* nope could not find one to update so we must build one */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { return; @@ -11016,7 +11055,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str atomic_add_int(&chk->whoTo->ref_count, 1); cwr = mtod(chk->data, struct sctp_cwr_chunk *); cwr->ch.chunk_type = SCTP_ECN_CWR; - cwr->ch.chunk_flags = 0; + cwr->ch.chunk_flags = override; cwr->ch.chunk_length = htons(sizeof(struct sctp_cwr_chunk)); cwr->tsn = htonl(high_tsn); TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:02:07 2012 (r231400) @@ -163,7 +163,7 @@ sctp_send_packet_dropped(struct sctp_tcb -void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t); +void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); void Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:02:07 2012 (r231400) @@ -3854,6 +3854,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO_measured = 0; stcb->asoc.numnets++; *(&net->ref_count) = 1; + net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:02:07 2012 (r231400) @@ -211,7 +211,10 @@ struct sctp_nets { /* mtu discovered so far */ uint32_t mtu; uint32_t ssthresh; /* not sure about this one for split */ - + uint32_t last_cwr_tsn; + uint32_t cwr_window_tsn; + uint32_t ecn_ce_pkt_cnt; + uint32_t lost_cnt; /* smoothed average things for RTT and RTO itself */ int lastsa; int lastsv; @@ -864,7 +867,6 @@ struct sctp_association { uint32_t highest_tsn_inside_nr_map; uint32_t last_echo_tsn; - uint32_t last_cwr_tsn; uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; @@ -1048,7 +1050,6 @@ struct sctp_association { uint16_t ecn_echo_cnt_onq; uint16_t free_chunk_cnt; - uint8_t stream_locked; uint8_t authenticated; /* packet authenticated ok */ /* Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:02:07 2012 (r231400) @@ -971,7 +971,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->last_net_cmt_send_started = NULL; /* This will need to be adjusted */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->advanced_peer_ack_point = asoc->last_acked_seq; asoc->asconf_seq_in = asoc->last_acked_seq; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:04:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D29BF106564A; Fri, 10 Feb 2012 19:04: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 BB2E58FC14; Fri, 10 Feb 2012 19:04: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 q1AJ4R0R088806; Fri, 10 Feb 2012 19:04:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ4RRh088795; Fri, 10 Feb 2012 19:04:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101904.q1AJ4RRh088795@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231401 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:04:28 -0000 Author: tuexen Date: Fri Feb 10 19:04:26 2012 New Revision: 231401 URL: http://svn.freebsd.org/changeset/base/231401 Log: MFC r218129: More ECN fixes: 1) We now remove ECN-Nonce since it will no longer continue as a I-D 2) Eliminate last_tsn_echo, this tied us to an assoc not the net and thus we were not doing m-homing on the ECN-Echo senders side right. 3) Increment the count going out even if the TSN in lower in the pending ECN-Echo, this way the receiver knows exactly how many packets were marked even with network re-ordering 4) Fix so we DO NOT stop doing delayed sack if a ECN Echo is in queue Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:04:26 2012 (r231401) @@ -168,13 +168,6 @@ sctp_cwnd_update_after_fr(struct sctp_tc net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -489,25 +482,28 @@ sctp_cwnd_update_after_timeout(struct sc } static void -sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) +sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) { int old_cwnd = net->cwnd; - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; - } - net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + if (in_window == 0) { + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* here back off the timer as well, to slow us down */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } @@ -888,13 +884,6 @@ sctp_hs_cwnd_update_after_fr(struct sctp net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -1609,13 +1598,6 @@ sctp_htcp_cwnd_update_after_fr(struct sc net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -1673,24 +1655,26 @@ sctp_htcp_cwnd_update_after_fr_timer(str static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, - struct sctp_nets *net) + struct sctp_nets *net, int in_window, int num_pkt_lost) { int old_cwnd; old_cwnd = net->cwnd; /* JRS - reset hctp as if state changed */ - htcp_reset(&net->htcp_ca); - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; - } - net->cwnd = net->ssthresh; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + if (in_window == 0) { + htcp_reset(&net->htcp_ca); + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = htcp_recalc_ssthresh(stcb, net); + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* here back off the timer as well, to slow us down */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:04:26 2012 (r231401) @@ -411,8 +411,7 @@ __FBSDID("$FreeBSD$"); /*************0x8000 series*************/ #define SCTP_ECN_CAPABLE 0x8000 -/* ECN Nonce: draft-ladha-sctp-ecn-nonce */ -#define SCTP_ECN_NONCE_SUPPORTED 0x8001 + /* draft-ietf-tsvwg-auth-xxx */ #define SCTP_RANDOM 0x8002 #define SCTP_CHUNK_LIST 0x8003 Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:04:26 2012 (r231401) @@ -142,12 +142,6 @@ struct sctp_supported_chunk_types_param } SCTP_PACKED; -/* ECN Nonce: draft-ladha-sctp-ecn-nonce */ -struct sctp_ecn_nonce_supported_param { - struct sctp_paramhdr ph;/* type = 0x8001 len = 4 */ -} SCTP_PACKED; - - /* * Structures for DATA chunks */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:04:26 2012 (r231401) @@ -2386,7 +2386,6 @@ sctp_slide_mapping_arrays(struct sctp_tc } } - void sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap, int *abort_flag) { @@ -2857,11 +2856,6 @@ sctp_process_segment_range(struct sctp_t * must be held until * cum-ack passes */ - /*- - * ECN Nonce: Add the nonce - * value to the sender's - * nonce sum - */ if (tp1->sent < SCTP_DATAGRAM_RESEND) { /*- * If it is less than RESEND, it is @@ -2967,8 +2961,6 @@ sctp_process_segment_range(struct sctp_t } } if (tp1->sent <= SCTP_DATAGRAM_RESEND) { - (*ecn_seg_sums) += tp1->rec.data.ect_nonce; - (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM; if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, stcb->asoc.this_sack_highest_gap)) { stcb->asoc.this_sack_highest_gap = @@ -3152,23 +3144,6 @@ sctp_check_for_revoked(struct sctp_tcb * if (tp1->sent == SCTP_DATAGRAM_UNSENT) break; } - if (tot_revoked > 0) { - /* - * Setup the ecn nonce re-sync point. We do this since once - * data is revoked we begin to retransmit things, which do - * NOT have the ECN bits set. This means we are now out of - * sync and must wait until we get back in sync with the - * peer to check ECN bits. - */ - tp1 = TAILQ_FIRST(&asoc->send_queue); - if (tp1 == NULL) { - asoc->nonce_resync_tsn = asoc->sending_seq; - } else { - asoc->nonce_resync_tsn = tp1->rec.data.TSN_seq; - } - asoc->nonce_wait_for_ecne = 0; - asoc->nonce_sum_check = 0; - } } @@ -3604,17 +3579,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t } } } - - if (tot_retrans > 0) { - /* - * Setup the ecn nonce re-sync point. We do this since once - * we go to FR something we introduce a Karn's rule scenario - * and won't know the totals for the ECN bits. - */ - asoc->nonce_resync_tsn = sending_seq; - asoc->nonce_wait_for_ecne = 0; - asoc->nonce_sum_check = 0; - } } struct sctp_tmit_chunk * @@ -3787,7 +3751,7 @@ sctp_window_probe_recovery(struct sctp_t void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int nonce_sum_flag, int *abort_now) + uint32_t rwnd, int *abort_now) { struct sctp_nets *net; struct sctp_association *asoc; @@ -3901,11 +3865,6 @@ sctp_express_handle_sack(struct sctp_tcb if (tp1->sent == SCTP_DATAGRAM_UNSENT) { printf("Warning, an unsent is now acked?\n"); } - /* - * ECN Nonce: Add the nonce to the sender's - * nonce sum - */ - asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce; if (tp1->sent < SCTP_DATAGRAM_ACKED) { /* * If it is less than ACKED, it is @@ -4049,53 +4008,6 @@ sctp_express_handle_sack(struct sctp_tcb asoc->total_flight = 0; asoc->total_flight_count = 0; } - /* ECN Nonce updates */ - if (asoc->ecn_nonce_allowed) { - if (asoc->nonce_sum_check) { - if (nonce_sum_flag != ((asoc->nonce_sum_expect_base) & SCTP_SACK_NONCE_SUM)) { - if (asoc->nonce_wait_for_ecne == 0) { - struct sctp_tmit_chunk *lchk; - - lchk = TAILQ_FIRST(&asoc->send_queue); - asoc->nonce_wait_for_ecne = 1; - if (lchk) { - asoc->nonce_wait_tsn = lchk->rec.data.TSN_seq; - } else { - asoc->nonce_wait_tsn = asoc->sending_seq; - } - } else { - if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { - /* - * Misbehaving peer. We need - * to react to this guy - */ - asoc->ecn_allowed = 0; - asoc->ecn_nonce_allowed = 0; - } - } - } - } else { - /* See if Resynchronization Possible */ - if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { - asoc->nonce_sum_check = 1; - /* - * Now we must calculate what the base is. - * We do this based on two things, we know - * the total's for all the segments - * gap-acked in the SACK (none). We also - * know the SACK's nonce sum, its in - * nonce_sum_flag. So we can build a truth - * table to back-calculate the new value of - * asoc->nonce_sum_expect_base: - * - * SACK-flag-Value Seg-Sums Base 0 0 0 - * 1 0 1 0 1 1 1 - * 1 0 - */ - asoc->nonce_sum_expect_base = (0 ^ nonce_sum_flag) & SCTP_SACK_NONCE_SUM; - } - } - } /* RWND update */ asoc->peers_rwnd = sctp_sbspace_sub(rwnd, (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); @@ -4297,18 +4209,10 @@ again: /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { /* - * ISSUE with ECN, see FWD-TSN processing for notes - * on issues that will occur when the ECN NONCE - * stuff is put into SCTP for cross checking. + * ISSUE with ECN, see FWD-TSN processing. */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); - /* - * ECN Nonce: Disable Nonce Sum check when - * FWD TSN is sent and store resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ if (lchk->rec.data.fwd_tsn_cnt >= 3) { @@ -4351,7 +4255,7 @@ sctp_handle_sack(struct mbuf *m, int off int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int nonce_sum_flag, ecn_seg_sums = 0; + int ecn_seg_sums = 0; int done_once; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -4383,7 +4287,6 @@ sctp_handle_sack(struct mbuf *m, int off j = 0; SCTP_STAT_INCR(sctps_slowpath_sack); last_tsn = cum_ack; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; cmt_dac_flag = flags & SCTP_SACK_CMT_DAC; #ifdef SCTP_ASOCLOG_OF_TSNS stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cum_ack; @@ -4545,11 +4448,6 @@ sctp_handle_sack(struct mbuf *m, int off TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (SCTP_TSN_GE(last_tsn, tp1->rec.data.TSN_seq)) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { - /* - * ECN Nonce: Add the nonce to the sender's - * nonce sum - */ - asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce; accum_moved = 1; if (tp1->sent < SCTP_DATAGRAM_ACKED) { /* @@ -4999,60 +4897,6 @@ sctp_handle_sack(struct mbuf *m, int off /* JRS - Use the congestion control given in the CC module */ asoc->cc_functions.sctp_cwnd_update_after_fr(stcb, asoc); - /****************************************************************** - * Here we do the stuff with ECN Nonce checking. - * We basically check to see if the nonce sum flag was incorrect - * or if resynchronization needs to be done. Also if we catch a - * misbehaving receiver we give him the kick. - ******************************************************************/ - - if (asoc->ecn_nonce_allowed) { - if (asoc->nonce_sum_check) { - if (nonce_sum_flag != ((asoc->nonce_sum_expect_base + ecn_seg_sums) & SCTP_SACK_NONCE_SUM)) { - if (asoc->nonce_wait_for_ecne == 0) { - struct sctp_tmit_chunk *lchk; - - lchk = TAILQ_FIRST(&asoc->send_queue); - asoc->nonce_wait_for_ecne = 1; - if (lchk) { - asoc->nonce_wait_tsn = lchk->rec.data.TSN_seq; - } else { - asoc->nonce_wait_tsn = asoc->sending_seq; - } - } else { - if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { - /* - * Misbehaving peer. We need - * to react to this guy - */ - asoc->ecn_allowed = 0; - asoc->ecn_nonce_allowed = 0; - } - } - } - } else { - /* See if Resynchronization Possible */ - if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { - asoc->nonce_sum_check = 1; - /* - * now we must calculate what the base is. - * We do this based on two things, we know - * the total's for all the segments - * gap-acked in the SACK, its stored in - * ecn_seg_sums. We also know the SACK's - * nonce sum, its in nonce_sum_flag. So we - * can build a truth table to back-calculate - * the new value of - * asoc->nonce_sum_expect_base: - * - * SACK-flag-Value Seg-Sums Base 0 0 0 - * 1 0 1 0 1 1 1 - * 1 0 - */ - asoc->nonce_sum_expect_base = (ecn_seg_sums ^ nonce_sum_flag) & SCTP_SACK_NONCE_SUM; - } - } - } /* Now are we exiting loss recovery ? */ if (will_exit_fast_recovery) { /* Ok, we must exit fast recovery */ @@ -5190,9 +5034,7 @@ again: /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { /* - * ISSUE with ECN, see FWD-TSN processing for notes - * on issues that will occur when the ECN NONCE - * stuff is put into SCTP for cross checking. + * ISSUE with ECN, see FWD-TSN processing. */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, @@ -5200,14 +5042,7 @@ again: old_adv_peer_ack_point); } if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { - send_forward_tsn(stcb, asoc); - /* - * ECN Nonce: Disable Nonce Sum check when - * FWD TSN is sent and store resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ if (lchk->rec.data.fwd_tsn_cnt >= 3) { @@ -5242,7 +5077,7 @@ sctp_update_acked(struct sctp_tcb *stcb, a_rwnd = stcb->asoc.peers_rwnd + stcb->asoc.total_flight; /* Now call the express sack handling */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, 0, abort_flag); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag); } static void @@ -5384,17 +5219,6 @@ sctp_handle_forward_tsn(struct sctp_tcb struct sctp_forward_tsn_chunk *fwd, int *abort_flag, struct mbuf *m, int offset) { - /* - * ISSUES that MUST be fixed for ECN! When we are the sender of the - * forward TSN, when the SACK comes back that acknowledges the - * FWD-TSN we must reset the NONCE sum to match correctly. This will - * get quite tricky since we may have sent more data interveneing - * and must carefully account for what the SACK says on the nonce - * and any gaps that are reported. This work will NOT be done here, - * but I note it here since it is really related to PR-SCTP and - * FWD-TSN's - */ - /* The pr-sctp fwd tsn */ /* * here we will perform all the data receiver side steps for @@ -5482,7 +5306,6 @@ sctp_handle_forward_tsn(struct sctp_tcb if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(0, 3, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); } - asoc->last_echo_tsn = asoc->highest_tsn_inside_map; } else { SCTP_TCB_LOCK_ASSERT(stcb); for (i = 0; i <= gap; i++) { Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:04:26 2012 (r231401) @@ -93,7 +93,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int nonce_sum_flag, int *abort_now); + uint32_t rwnd, int *abort_now); void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:04:26 2012 (r231401) @@ -264,11 +264,13 @@ sctp_process_init(struct sctp_init_chunk /* save off parameters */ asoc->peer_vtag = ntohl(init->initiate_tag); asoc->peers_rwnd = ntohl(init->a_rwnd); + /* init tsn's */ + asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; + if (!TAILQ_EMPTY(&asoc->nets)) { /* update any ssthresh's that may have a default */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { lnet->ssthresh = asoc->peers_rwnd; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_INITIALIZATION); } @@ -328,8 +330,7 @@ sctp_process_init(struct sctp_init_chunk } SCTP_TCB_SEND_UNLOCK(stcb); asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; - /* init tsn's */ - asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; + /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { @@ -340,7 +341,7 @@ sctp_process_init(struct sctp_init_chunk asoc->mapping_array_base_tsn = ntohl(init->initial_tsn); asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->asconf_seq_in; - asoc->last_echo_tsn = asoc->asconf_seq_in; + asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* open the requested streams */ @@ -1044,11 +1045,6 @@ sctp_process_unrecog_param(struct sctp_t case SCTP_HAS_NAT_SUPPORT: stcb->asoc.peer_supports_nat = 0; break; - case SCTP_ECN_NONCE_SUPPORTED: - stcb->asoc.peer_supports_ecn_nonce = 0; - stcb->asoc.ecn_nonce_allowed = 0; - stcb->asoc.ecn_allowed = 0; - break; case SCTP_ADD_IP_ADDRESS: case SCTP_DEL_IP_ADDRESS: case SCTP_SET_PRIM_ADDR: @@ -2933,16 +2929,12 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch SCTP_STAT_INCR(sctps_recvecne); tsn = ntohl(cp->tsn); pkt_cnt = ntohl(cp->num_pkts_since_cwr); - /* ECN Nonce stuff: need a resync and disable the nonce sum check */ - /* Also we make sure we disable the nonce_wait */ lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); if (lchk == NULL) { - window_data_tsn = stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq - 1; + window_data_tsn = stcb->asoc.sending_seq - 1; } else { - window_data_tsn = stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; + window_data_tsn = lchk->rec.data.TSN_seq; } - stcb->asoc.nonce_wait_for_ecne = 0; - stcb->asoc.nonce_sum_check = 0; /* Find where it was sent to if possible. */ net = NULL; @@ -2976,7 +2968,8 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch override_bit = SCTP_CWR_REDUCE_OVERRIDE; } out: - if (SCTP_TSN_GT(tsn, net->cwr_window_tsn)) { + 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 @@ -2984,7 +2977,7 @@ out: int ocwnd; ocwnd = net->cwnd; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net); + 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 * the next sending seq i.e. the window_data_tsn @@ -2995,18 +2988,26 @@ out: net->last_cwr_tsn = tsn; } else { override_bit |= SCTP_CWR_IN_SAME_WINDOW; - if (SCTP_TSN_GT(tsn, net->last_cwr_tsn)) { + if (SCTP_TSN_GT(tsn, net->last_cwr_tsn) && + ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* - * Another loss in the same window update how man - * marks we have had + * Another loss in the same window update how many + * marks/packets lost we have had. */ + int cnt = 1; if (pkt_cnt > net->lost_cnt) { /* Should be the case */ - net->ecn_ce_pkt_cnt += (pkt_cnt - net->lost_cnt); - net->lost_cnt = pkt_cnt; + cnt = (pkt_cnt - net->lost_cnt); + net->ecn_ce_pkt_cnt += cnt; } + net->lost_cnt = pkt_cnt; net->last_cwr_tsn = tsn; + /* + * Most CC functions will ignore this call, since we + * are in-window yet of the initial CE the peer saw. + */ + stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 1, cnt); } } /* @@ -3186,11 +3187,6 @@ process_chunk_drop(struct sctp_tcb *stcb } } } - /* - * We zero out the nonce so resync not - * needed - */ - tp1->rec.data.ect_nonce = 0; if (tp1->do_rtt) { /* @@ -4645,7 +4641,6 @@ process_control_chunks: uint16_t num_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - int nonce_sum_flag; SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); SCTP_STAT_INCR(sctps_recvsacks); @@ -4667,7 +4662,6 @@ process_control_chunks: } sack = (struct sctp_sack_chunk *)ch; flags = ch->chunk_flags; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; cum_ack = ntohl(sack->sack.cum_tsn_ack); num_seg = ntohs(sack->sack.num_gap_ack_blks); num_dup = ntohs(sack->sack.num_dup_tsns); @@ -4699,8 +4693,7 @@ process_control_chunks: * with no missing segments to go * this way too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, nonce_sum_flag, - &abort_now); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, @@ -4732,7 +4725,6 @@ process_control_chunks: uint16_t num_seg, num_nr_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - int nonce_sum_flag; SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); SCTP_STAT_INCR(sctps_recvsacks); @@ -4758,8 +4750,6 @@ process_control_chunks: } nr_sack = (struct sctp_nr_sack_chunk *)ch; flags = ch->chunk_flags; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; - cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); @@ -4791,7 +4781,7 @@ process_control_chunks: * missing segments to go this way * too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, nonce_sum_flag, + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); } else { if (netp && *netp) @@ -5397,66 +5387,6 @@ next_chunk: } -/* - * Process the ECN bits we have something set so we must look to see if it is - * ECN(0) or ECN(1) or CE - */ -static void -sctp_process_ecn_marked_a(struct sctp_tcb *stcb, struct sctp_nets *net, - uint8_t ecn_bits) -{ - if ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS) { - ; - } else if ((ecn_bits & SCTP_ECT1_BIT) == SCTP_ECT1_BIT) { - /* - * we only add to the nonce sum for ECT1, ECT0 does not - * change the NS bit (that we have yet to find a way to send - * it yet). - */ - - /* ECN Nonce stuff */ - stcb->asoc.receiver_nonce_sum++; - stcb->asoc.receiver_nonce_sum &= SCTP_SACK_NONCE_SUM; - - /* - * Drag up the last_echo point if cumack is larger since we - * don't want the point falling way behind by more than - * 2^^31 and then having it be incorrect. - */ - if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { - stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; - } - } else if ((ecn_bits & SCTP_ECT0_BIT) == SCTP_ECT0_BIT) { - /* - * Drag up the last_echo point if cumack is larger since we - * don't want the point falling way behind by more than - * 2^^31 and then having it be incorrect. - */ - if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { - stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; - } - } -} - -static void -sctp_process_ecn_marked_b(struct sctp_tcb *stcb, struct sctp_nets *net, - uint32_t high_tsn, uint8_t ecn_bits) -{ - if ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS) { - /* - * we possibly must notify the sender that a congestion - * window reduction is in order. We do this by adding a ECNE - * chunk to the output chunk queue. The incoming CWR will - * remove this chunk. - */ - if (SCTP_TSN_GT(high_tsn, stcb->asoc.last_echo_tsn)) { - /* Yep, we need to add a ECNE */ - sctp_send_ecn_echo(stcb, net, high_tsn); - stcb->asoc.last_echo_tsn = high_tsn; - } - } -} - #ifdef INVARIANTS #ifdef __GNUC__ __attribute__((noinline)) @@ -5498,6 +5428,7 @@ sctp_common_input_processing(struct mbuf struct mbuf *m = *mm; int abort_flag = 0; int un_sent; + int cnt_ctrl_ready = 0; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED @@ -5655,11 +5586,6 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_SENT: break; } - /* take care of ECN, part 1. */ - if (stcb->asoc.ecn_allowed && - (ecn_bits & (SCTP_ECT0_BIT | SCTP_ECT1_BIT))) { - sctp_process_ecn_marked_a(stcb, net, ecn_bits); - } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, sh, inp, stcb, net, &high_tsn); @@ -5671,19 +5597,16 @@ sctp_common_input_processing(struct mbuf goto out_now; } data_processed = 1; - if (retval == 0) { - /* take care of ecn part 2. */ - if (stcb->asoc.ecn_allowed && - (ecn_bits & (SCTP_ECT0_BIT | SCTP_ECT1_BIT))) { - sctp_process_ecn_marked_b(stcb, net, high_tsn, - ecn_bits); - } - } /* * Anything important needs to have been m_copy'ed in * process_data */ } + /* take care of ecn */ + if (stcb->asoc.ecn_allowed && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { + /* Yep, we need to add a ECNE */ + sctp_send_ecn_echo(stcb, net, high_tsn); + } if ((data_processed == 0) && (fwd_tsn_seen)) { int was_a_gap; uint32_t highest_tsn; @@ -5715,8 +5638,10 @@ trigger_send: TAILQ_EMPTY(&stcb->asoc.control_send_queue), stcb->asoc.total_flight); un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); - - if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { + cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq; + } + if (cnt_ctrl_ready || ((un_sent) && (stcb->asoc.peers_rwnd > 0 || (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:04:26 2012 (r231401) @@ -3389,55 +3389,10 @@ static uint8_t sctp_get_ect(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk) { - uint8_t this_random; - - /* Huh? */ if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 0) return (0); - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce) == 0) - /* no nonce, always return ECT0 */ - return (SCTP_ECT0_BIT); - - if (stcb->asoc.peer_supports_ecn_nonce == 0) { - /* Peer does NOT support it, so we send a ECT0 only */ - return (SCTP_ECT0_BIT); - } - if (chk == NULL) - return (SCTP_ECT0_BIT); - - if ((stcb->asoc.hb_random_idx > 3) || - ((stcb->asoc.hb_random_idx == 3) && - (stcb->asoc.hb_ect_randombit > 7))) { - uint32_t rndval; - -warp_drive_sa: - rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep); - memcpy(stcb->asoc.hb_random_values, &rndval, - sizeof(stcb->asoc.hb_random_values)); - this_random = stcb->asoc.hb_random_values[0]; - stcb->asoc.hb_random_idx = 0; - stcb->asoc.hb_ect_randombit = 0; - } else { - if (stcb->asoc.hb_ect_randombit > 7) { - stcb->asoc.hb_ect_randombit = 0; - stcb->asoc.hb_random_idx++; - if (stcb->asoc.hb_random_idx > 3) { - goto warp_drive_sa; - } - } - this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; - } - if ((this_random >> stcb->asoc.hb_ect_randombit) & 0x01) { - if (chk != NULL) - /* ECN Nonce stuff */ - chk->rec.data.ect_nonce = SCTP_ECT1_BIT; - stcb->asoc.hb_ect_randombit++; - return (SCTP_ECT1_BIT); - } else { - stcb->asoc.hb_ect_randombit++; - return (SCTP_ECT0_BIT); - } + return (SCTP_ECT0_BIT); } static int @@ -4167,7 +4122,6 @@ sctp_send_initiate(struct sctp_inpcb *in struct sctp_adaptation_layer_indication *ali; struct sctp_ecn_supported_param *ecn; struct sctp_prsctp_supported_param *prsctp; - struct sctp_ecn_nonce_supported_param *ecn_nonce; struct sctp_supported_chunk_types_param *pr_supported; int cnt_inits_to = 0; int padval, ret; @@ -4326,14 +4280,6 @@ sctp_send_initiate(struct sctp_inpcb *in SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - /* ECN nonce: And now tell the peer we support ECN nonce */ - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) { - ecn_nonce = (struct sctp_ecn_nonce_supported_param *) - ((caddr_t)pr_supported + SCTP_SIZE32(p_len)); - ecn_nonce->ph.param_type = htons(SCTP_ECN_NONCE_SUPPORTED); - ecn_nonce->ph.param_length = htons(sizeof(*ecn_nonce)); - SCTP_BUF_LEN(m) += sizeof(*ecn_nonce); - } /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { struct sctp_auth_random *randp; @@ -4555,11 +4501,10 @@ sctp_arethere_unrecognized_parameters(st case SCTP_HAS_NAT_SUPPORT: *nat_friendly = 1; /* fall through */ - case SCTP_ECN_NONCE_SUPPORTED: case SCTP_PRSCTP_SUPPORTED: if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error ecnnonce/prsctp/nat support %d\n", plen); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp/nat support %d\n", plen); goto invalid_size; } at += padded_size; @@ -4960,7 +4905,6 @@ sctp_send_initiate_ack(struct sctp_inpcb struct sctp_adaptation_layer_indication *ali; struct sctp_ecn_supported_param *ecn; struct sctp_prsctp_supported_param *prsctp; - struct sctp_ecn_nonce_supported_param *ecn_nonce; struct sctp_supported_chunk_types_param *pr_supported; union sctp_sockstore store, store1, *over_addr; struct sockaddr_in *sin, *to_sin; @@ -5444,14 +5388,6 @@ do_a_abort: bzero((caddr_t)pr_supported + p_len, SCTP_SIZE32(p_len) - p_len); SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - /* ECN nonce: And now tell the peer we support ECN nonce */ - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) { - ecn_nonce = (struct sctp_ecn_nonce_supported_param *) - ((caddr_t)pr_supported + SCTP_SIZE32(p_len)); - ecn_nonce->ph.param_type = htons(SCTP_ECN_NONCE_SUPPORTED); - ecn_nonce->ph.param_length = htons(sizeof(*ecn_nonce)); - SCTP_BUF_LEN(m) += sizeof(*ecn_nonce); - } /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { struct sctp_auth_random *randp; @@ -7009,7 +6945,6 @@ dont_do_it: chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; chk->rec.data.doing_fast_retransmit = 0; - chk->rec.data.ect_nonce = 0; /* ECN Nonce */ chk->rec.data.timetodrop = sp->ts; chk->flags = sp->act_flags; @@ -10000,13 +9935,7 @@ sctp_send_sack(struct sctp_tcb *stcb) limit = mtod(a_chk->data, caddr_t); limit += space; - /* 0x01 is used by nonce for ecn */ - if ((SCTP_BASE_SYSCTL(sctp_ecn_enable)) && - (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) && - (asoc->peer_supports_ecn_nonce)) - flags = (asoc->receiver_nonce_sum & SCTP_SACK_NONCE_SUM); - else - flags = 0; + flags = 0; if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { @@ -10809,11 +10738,11 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb ctsn = ntohl(ecne->tsn); if (SCTP_TSN_GT(high_tsn, ctsn)) { ecne->tsn = htonl(high_tsn); - cnt = ntohl(ecne->num_pkts_since_cwr); - cnt++; - ecne->num_pkts_since_cwr = htonl(cnt); SCTP_STAT_INCR(sctps_queue_upd_ecne); } + cnt = ntohl(ecne->num_pkts_since_cwr); + cnt++; + ecne->num_pkts_since_cwr = htonl(cnt); return; } } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:04:26 2012 (r231401) @@ -6139,10 +6139,6 @@ sctp_load_addresses_from_init(struct sct } } - } else if (ptype == SCTP_ECN_NONCE_SUPPORTED) { - /* Peer supports ECN-nonce */ - stcb->asoc.peer_supports_ecn_nonce = 1; - stcb->asoc.ecn_nonce_allowed = 1; } else if (ptype == SCTP_RANDOM) { if (plen > sizeof(random_store)) break; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:04:26 2012 (r231401) @@ -330,8 +330,6 @@ struct sctp_data_chunkrec { uint32_t payloadtype; uint32_t context; /* from send */ - /* ECN Nonce: Nonce Value for this chunk */ - uint8_t ect_nonce; uint8_t fwd_tsn_cnt; /* * part of the Highest sacked algorithm to be able to stroke counts @@ -607,7 +605,7 @@ struct sctp_cc_functions { void (*sctp_cwnd_update_after_timeout) (struct sctp_tcb *stcb, struct sctp_nets *net); void (*sctp_cwnd_update_after_ecn_echo) (struct sctp_tcb *stcb, - struct sctp_nets *net); + struct sctp_nets *net, int in_window, int num_pkt_lost); void (*sctp_cwnd_update_after_packet_dropped) (struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t * bottle_bw, uint32_t * on_queue); @@ -866,7 +864,6 @@ struct sctp_association { uint8_t *nr_mapping_array; uint32_t highest_tsn_inside_nr_map; - uint32_t last_echo_tsn; uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; @@ -921,12 +918,9 @@ struct sctp_association { uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ - /* 32 bit nonce stuff */ - uint32_t nonce_resync_tsn; - uint32_t nonce_wait_tsn; uint32_t default_flowlabel; uint32_t pr_sctp_cnt; - int ctrl_queue_cnt; /* could be removed REM */ + int ctrl_queue_cnt; /* could be removed REM - NO IT CAN'T!! RRS */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:07:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290ED106566B; Fri, 10 Feb 2012 19:07: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 1280E8FC0A; Fri, 10 Feb 2012 19:07: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 q1AJ7Xc1088959; Fri, 10 Feb 2012 19:07:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ7WMB088944; Fri, 10 Feb 2012 19:07:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101907.q1AJ7WMB088944@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231402 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:07:33 -0000 Author: tuexen Date: Fri Feb 10 19:07:32 2012 New Revision: 231402 URL: http://svn.freebsd.org/changeset/base/231402 Log: MFC r218186: 1) Allow a chunk to track the cwnd it was at when sent. 2) Add separate max-bursts for retransmit and hb. These are set to sysctlable values but not settable via the socket api. This makes sure we don't blast out HB's or fast-retransmits. 3) Determine on the first data transmission on a net if its local-lan (by being under or over a RTT). This can later be used to think about different algorithms based on locallan vs big-i (experimental) 4) The cwnd should NOT be allowed to grow when an ECNEcho is seen (TCP has this same bug). We fix this in SCTP so an ECNe being seen prevents an advance of cwnd. 5) CWR's should not be sent multiple times to the same network, instead just updating the TSN being transmitted if needed. From rrs@. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:07:32 2012 (r231402) @@ -481,6 +481,7 @@ sctp_cwnd_update_after_timeout(struct sc } } + static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:07:32 2012 (r231402) @@ -345,6 +345,16 @@ __FBSDID("$FreeBSD$"); /* default max I can burst out after a fast retransmit, 0 disables it */ #define SCTP_DEF_MAX_BURST 0 +#define SCTP_DEF_HBMAX_BURST 4 +#define SCTP_DEF_FRMAX_BURST 4 + +/* RTO calculation flag to say if it + * is safe to determine local lan or not. + */ +#define SCTP_DETERMINE_LL_NOTOK 0 +#define SCTP_DETERMINE_LL_OK 1 + + /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -947,6 +957,18 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_TIME_WAIT 60 +/* How many micro seconds is the cutoff from + * local lan type rtt's + */ + /* + * We allow 500us for the rtt and another 500us for the cookie processing + * since we measure this on the first rtt. + */ +#define SCTP_LOCAL_LAN_RTT 1100 +#define SCTP_LAN_UNKNOWN 0 +#define SCTP_LAN_LOCAL 1 +#define SCTP_LAN_INTERNET 2 + #define SCTP_SEND_BUFFER_SPLITTING 0x00000001 #define SCTP_RECV_BUFFER_SPLITTING 0x00000002 @@ -994,6 +1016,7 @@ __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)) #endif Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:07:32 2012 (r231402) @@ -2955,7 +2955,8 @@ sctp_process_segment_range(struct sctp_t &stcb->asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -3751,7 +3752,7 @@ sctp_window_probe_recovery(struct sctp_t void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int *abort_now) + uint32_t rwnd, int *abort_now, int ecne_seen) { struct sctp_nets *net; struct sctp_association *asoc; @@ -3902,7 +3903,8 @@ sctp_express_handle_sack(struct sctp_tcb sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -3994,7 +3996,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* JRS - Use the congestion control given in the CC module */ - if (asoc->last_acked_seq != cumack) + if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); asoc->last_acked_seq = cumack; @@ -4240,7 +4242,7 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_tcb *stcb, struct sctp_nets *net_from, 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) + uint32_t cum_ack, uint32_t rwnd, int ecne_seen) { struct sctp_association *asoc; struct sctp_tmit_chunk *tp1, *tp2; @@ -4500,7 +4502,8 @@ sctp_handle_sack(struct mbuf *m, int off sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -4754,7 +4757,8 @@ sctp_handle_sack(struct mbuf *m, int off asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ - asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); + if (ecne_seen == 0) + asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); if (TAILQ_EMPTY(&asoc->sent_queue)) { /* nothing left in-flight */ @@ -5077,7 +5081,7 @@ sctp_update_acked(struct sctp_tcb *stcb, a_rwnd = stcb->asoc.peers_rwnd + stcb->asoc.total_flight; /* Now call the express sack handling */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag, 0); } static void Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:07:32 2012 (r231402) @@ -93,14 +93,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int *abort_now); + uint32_t rwnd, int *abort_now, int ecne_seen); void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, struct sctp_tcb *stcb, struct sctp_nets *net_from, 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); + uint32_t cum_ack, uint32_t rwnd, int ecne_seen); /* draft-ietf-tsvwg-usctp */ void Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:07:32 2012 (r231402) @@ -481,7 +481,8 @@ sctp_process_init_ack(struct mbuf *m, in asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy); + net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_NOTOK); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -625,7 +626,8 @@ sctp_handle_heartbeat_ack(struct sctp_he net, net->cwnd); } /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy); + r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); /* Mobility adaptation */ if (req_prim) { if ((sctp_is_mobility_feature_on(stcb->sctp_ep, @@ -1540,7 +1542,9 @@ sctp_process_cookie_existing(struct mbuf */ net->hb_responded = 1; net->RTO = sctp_calculate_rto(stcb, asoc, net, - &cookie->time_entered, sctp_align_unsafe_makecopy); + &cookie->time_entered, + sctp_align_unsafe_makecopy, + SCTP_DETERMINE_LL_NOTOK); if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { @@ -2243,7 +2247,8 @@ sctp_process_cookie_new(struct mbuf *m, (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp) && (*netp)) { (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &cookie->time_entered, sctp_align_unsafe_makecopy); + &cookie->time_entered, sctp_align_unsafe_makecopy, + SCTP_DETERMINE_LL_NOTOK); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2833,7 +2838,8 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, sctp_align_safe_nocopy); + &asoc->time_entered, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_NOTOK); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); @@ -2941,6 +2947,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { if (lchk->rec.data.TSN_seq == tsn) { net = lchk->whoTo; + net->ecn_prev_cwnd = lchk->rec.data.cwnd_at_send; break; } if (SCTP_TSN_GT(lchk->rec.data.TSN_seq, tsn)) { @@ -4198,6 +4205,7 @@ __attribute__((noinline)) uint32_t chk_length; int ret; int abort_no_unlock = 0; + int ecne_seen = 0; /* * How big should this be, and should it be alloc'd? Lets try the @@ -4693,13 +4701,13 @@ process_control_chunks: * with no missing segments to go * this way too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, stcb, *netp, num_seg, 0, num_dup, &abort_now, flags, - cum_ack, a_rwnd); + cum_ack, a_rwnd, ecne_seen); } if (abort_now) { /* ABORT signal from sack processing */ @@ -4782,13 +4790,13 @@ process_control_chunks: * too. */ sctp_express_handle_sack(stcb, cum_ack, a_rwnd, - &abort_now); + &abort_now, ecne_seen); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, stcb, *netp, num_seg, num_nr_seg, num_dup, &abort_now, flags, - cum_ack, a_rwnd); + cum_ack, a_rwnd, ecne_seen); } if (abort_now) { /* ABORT signal from sack processing */ @@ -5065,6 +5073,7 @@ process_control_chunks: stcb->asoc.overall_error_count = 0; sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); + ecne_seen = 1; } break; case SCTP_ECN_CWR: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:07:32 2012 (r231402) @@ -6395,6 +6395,7 @@ sctp_clean_up_datalist(struct sctp_tcb * } /* record time */ data_list[i]->sent_rcv_time = net->last_sent_time; + data_list[i]->rec.data.cwnd_at_send = net->cwnd; data_list[i]->rec.data.fast_retran_tsn = data_list[i]->rec.data.TSN_seq; if (data_list[i]->whoTo == NULL) { data_list[i]->whoTo = net; @@ -9414,7 +9415,7 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { + if ((asoc->fr_max_burst > 0) && (tot_frs >= asoc->fr_max_burst)) { /* Hit FR burst limit */ return; } @@ -10962,6 +10963,27 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); + + TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { + if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { + /* + * found a previous CWR queued to same destination + * update it if needed + */ + uint32_t ctsn; + + cwr = mtod(chk->data, struct sctp_cwr_chunk *); + ctsn = ntohl(cwr->tsn); + if (SCTP_TSN_GT(high_tsn, ctsn)) { + cwr->tsn = htonl(high_tsn); + } + if (override & SCTP_CWR_REDUCE_OVERRIDE) { + /* Make sure override is carried */ + cwr->ch.chunk_flags |= SCTP_CWR_REDUCE_OVERRIDE; + } + return; + } + } sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { return; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:07:32 2012 (r231402) @@ -2516,6 +2516,8 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_sender = SCTP_SWS_SENDER_DEF; m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); + m->fr_max_burst = SCTP_BASE_SYSCTL(sctp_fr_max_burst_default); + m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); /* number of streams to pre-open on a association */ Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:07:32 2012 (r231402) @@ -318,6 +318,7 @@ struct sctp_pcb { uint32_t adaptation_layer_indicator; uint32_t store_at; uint32_t max_burst; + uint32_t fr_max_burst; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:07:32 2012 (r231402) @@ -237,6 +237,8 @@ struct sctp_nets { uint32_t flight_size; uint32_t cwnd; /* actual cwnd */ uint32_t prev_cwnd; /* cwnd before any processing */ + uint32_t ecn_prev_cwnd; /* ECN prev cwnd at first ecn_echo seen in new + * window */ uint32_t partial_bytes_acked; /* in CA tracks when to incr a MTU */ uint32_t prev_rtt; /* tracking variables to avoid the aloc/free in sack processing */ @@ -318,6 +320,7 @@ struct sctp_nets { uint8_t window_probe; /* Doing a window probe? */ uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ + uint8_t lan_type; /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; }; @@ -329,8 +332,7 @@ struct sctp_data_chunkrec { uint16_t stream_number; /* the stream number of this guy */ uint32_t payloadtype; uint32_t context; /* from send */ - - uint8_t fwd_tsn_cnt; + uint32_t cwnd_at_send; /* * part of the Highest sacked algorithm to be able to stroke counts * on ones that are FR'd. @@ -342,6 +344,7 @@ struct sctp_data_chunkrec { * outbound holds sending flags for PR-SCTP. */ uint8_t state_flags; uint8_t chunk_was_revoked; + uint8_t fwd_tsn_cnt; }; TAILQ_HEAD(sctpchunk_listhead, sctp_tmit_chunk); @@ -1052,8 +1055,10 @@ struct sctp_association { */ uint8_t send_sack; - /* max burst after fast retransmit completes */ + /* max burst of new packets into the network */ uint32_t max_burst; + /* max burst of fast retransmit packets */ + uint32_t fr_max_burst; uint8_t sat_network; /* RTT is in range of sat net or greater */ uint8_t sat_network_lockout; /* lockout code */ Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:07:32 2012 (r231402) @@ -59,6 +59,7 @@ sctp_init_sysctls() 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; SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = SCTPCTL_MAXCHUNKS_DEFAULT; SCTP_BASE_SYSCTL(sctp_hashtblsize) = SCTPCTL_TCBHASHSIZE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pcbtblsize) = SCTPCTL_PCBHASHSIZE_DEFAULT; @@ -576,6 +577,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) 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); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); @@ -849,6 +851,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ma &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_FRMAXBURST_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:07:32 2012 (r231402) @@ -43,7 +43,7 @@ struct sctp_sysctl { uint32_t sctp_auto_asconf; uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; - uint32_t sctp_not_used; + uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; @@ -182,6 +182,13 @@ struct sctp_sysctl { #define SCTPCTL_MAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST +/* fr_maxburst: Default max burst for sctp endpoints when fast retransmitting */ +#define SCTPCTL_FRMAXBURST_DESC "Default fr max burst for sctp endpoints" +#define SCTPCTL_FRMAXBURST_MIN 0 +#define SCTPCTL_FRMAXBURST_MAX 0xFFFFFFFF +#define SCTPCTL_FRMAXBURST_DEFAULT SCTP_DEF_FRMAX_BURST + + /* maxchunks: Default max chunks on queue per asoc */ #define SCTPCTL_MAXCHUNKS_DESC "Default max chunks on queue per asoc" #define SCTPCTL_MAXCHUNKS_MIN 0 @@ -402,7 +409,7 @@ struct sctp_sysctl { #define SCTPCTL_HB_MAX_BURST_DESC "Confirmation Heartbeat max burst" #define SCTPCTL_HB_MAX_BURST_MIN 1 #define SCTPCTL_HB_MAX_BURST_MAX 0xFFFFFFFF -#define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_MAX_BURST +#define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_HBMAX_BURST /* abort_at_limit: When one-2-one hits qlimit abort */ #define SCTPCTL_ABORT_AT_LIMIT_DESC "When one-2-one hits qlimit abort" Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:07:32 2012 (r231402) @@ -1630,7 +1630,8 @@ sctp_heartbeat_timer(struct sctp_inpcb * else if (ret == 0) { break; } - if (cnt_sent >= SCTP_BASE_SYSCTL(sctp_hb_maxburst)) + if (SCTP_BASE_SYSCTL(sctp_hb_maxburst) && + (cnt_sent >= SCTP_BASE_SYSCTL(sctp_hb_maxburst))) break; } } Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:07:32 2012 (r231402) @@ -913,6 +913,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str /* init all variables to a known value. */ SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_INUSE); asoc->max_burst = m->sctp_ep.max_burst; + asoc->fr_max_burst = m->sctp_ep.fr_max_burst; asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); asoc->cookie_life = m->sctp_ep.def_cookie_life; asoc->sctp_cmt_on_off = m->sctp_cmt_on_off; @@ -2459,12 +2460,13 @@ sctp_mtu_size_reset(struct sctp_inpcb *i * given an association and starting time of the current RTT period return * RTO in number of msecs net should point to the current network */ + uint32_t sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *told, - int safe) + int safe, int local_lan_determine) { /*- * given an association and the starting time of the current RTT @@ -2492,13 +2494,21 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); - /* * Record the real time of the last RTT for use in DC-CC. */ net->last_measured_rtt = now; timevalsub(&net->last_measured_rtt, old); + /* Do we need to determine the lan type? */ + if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && (net->lan_type == SCTP_LAN_UNKNOWN)) { + if ((net->last_measured_rtt.tv_sec) || + (net->last_measured_rtt.tv_usec > SCTP_LOCAL_LAN_RTT)) { + net->lan_type = SCTP_LAN_INTERNET; + } else { + net->lan_type = SCTP_LAN_LOCAL; + } + } /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 19:07:32 2012 (r231402) @@ -132,7 +132,7 @@ void uint32_t sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, - struct sctp_nets *, struct timeval *, int); + struct sctp_nets *, struct timeval *, int, int); uint32_t sctp_calculate_len(struct mbuf *); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:10:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F4191065677; Fri, 10 Feb 2012 19:10:11 +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 7DC8D8FC14; Fri, 10 Feb 2012 19:10:10 +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 q1AJAApA089091; Fri, 10 Feb 2012 19:10:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJAA9C089081; Fri, 10 Feb 2012 19:10:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101910.q1AJAA9C089081@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231403 - in stable/8/sys: conf netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:10:11 -0000 Author: tuexen Date: Fri Feb 10 19:10:09 2012 New Revision: 231403 URL: http://svn.freebsd.org/changeset/base/231403 Log: MFC r218211: Adds an experimental option to create a pool of threads. These serve as input threads and are queued packets based on the V-tag number. This is similar to what a modern card can do with queue's for TCP... but alas modern cards know nothing about SCTP. From rrs@. Modified: stable/8/sys/conf/options stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/conf/options Fri Feb 10 19:10:09 2012 (r231403) @@ -438,6 +438,7 @@ SCTP_PACKET_LOGGING opt_sctp.h # Log to SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. +SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs # # # Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:10:09 2012 (r231403) @@ -68,6 +68,7 @@ MALLOC_DEFINE(SCTP_M_TIMW, "sctp_timw", MALLOC_DEFINE(SCTP_M_MVRF, "sctp_mvrf", "sctp mvrf pcb list"); MALLOC_DEFINE(SCTP_M_ITER, "sctp_iter", "sctp iterator control"); MALLOC_DEFINE(SCTP_M_SOCKOPT, "sctp_socko", "sctp socket option"); +MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore", "sctp mcore queue"); /* Global NON-VNET structure that controls the iterator */ struct iterator_control sctp_it_ctl; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:10:09 2012 (r231403) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_KTRHEAD_NAME "sctp_iterator" #define SCTP_KTHREAD_PAGES 0 +#define SCTP_MCORE_NAME "sctp_core_worker" + /* If you support Multi-VRF how big to * make the initial array of VRF's to. Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:10:09 2012 (r231403) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include @@ -5923,10 +5924,32 @@ bad: } return; } + + void -sctp_input(i_pak, off) - struct mbuf *i_pak; - int off; +sctp_input(struct mbuf *m, int off) { - sctp_input_with_port(i_pak, off, 0); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) + struct ip *ip; + struct sctphdr *sh; + int offset; + int cpu_to_use; + + if (mp_ncpus > 1) { + ip = mtod(m, struct ip *); + offset = off + sizeof(*sh); + if (SCTP_BUF_LEN(m) < offset) { + if ((m = m_pullup(m, offset)) == 0) { + SCTP_STAT_INCR(sctps_hdrops); + return; + } + ip = mtod(m, struct ip *); + } + sh = (struct sctphdr *)((caddr_t)ip + off); + cpu_to_use = ntohl(sh->v_tag) % mp_ncpus; + sctp_queue_to_mcore(m, off, cpu_to_use); + return; + } +#endif + sctp_input_with_port(m, off, 0); } Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:10:09 2012 (r231403) @@ -97,6 +97,48 @@ extern int sctp_logoff_stuff; rw_rlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \ } while (0) +#define SCTP_MCORE_QLOCK_INIT(cpstr) do { \ + mtx_init(&(cpstr)->que_mtx, \ + "sctp-mcore_queue","queue_lock", \ + MTX_DEF|MTX_DUPOK); \ +} while (0) + +#define SCTP_MCORE_QLOCK(cpstr) do { \ + mtx_lock(&(cpstr)->que_mtx); \ +} while (0) + +#define SCTP_MCORE_QUNLOCK(cpstr) do { \ + mtx_unlock(&(cpstr)->que_mtx); \ +} while (0) + +#define SCTP_MCORE_QDESTROY(cpstr) do { \ + if(mtx_owned(&(cpstr)->core_mtx)) { \ + mtx_unlock(&(cpstr)->que_mtx); \ + } \ + mtx_destroy(&(cpstr)->que_mtx); \ +} while (0) + + +#define SCTP_MCORE_LOCK_INIT(cpstr) do { \ + mtx_init(&(cpstr)->core_mtx, \ + "sctp-cpulck","cpu_proc_lock", \ + MTX_DEF|MTX_DUPOK); \ +} while (0) + +#define SCTP_MCORE_LOCK(cpstr) do { \ + mtx_lock(&(cpstr)->core_mtx); \ +} while (0) + +#define SCTP_MCORE_UNLOCK(cpstr) do { \ + mtx_unlock(&(cpstr)->core_mtx); \ +} while (0) + +#define SCTP_MCORE_DESTROY(cpstr) do { \ + if(mtx_owned(&(cpstr)->core_mtx)) { \ + mtx_unlock(&(cpstr)->core_mtx); \ + } \ + mtx_destroy(&(cpstr)->core_mtx); \ +} while (0) #define SCTP_INP_INFO_WLOCK() do { \ rw_wlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \ Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:10:09 2012 (r231403) @@ -123,6 +123,7 @@ MALLOC_DECLARE(SCTP_M_TIMW); MALLOC_DECLARE(SCTP_M_MVRF); MALLOC_DECLARE(SCTP_M_ITER); MALLOC_DECLARE(SCTP_M_SOCKOPT); +MALLOC_DECLARE(SCTP_M_MCORE); #if defined(SCTP_LOCAL_TRACE_BUF) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:10:09 2012 (r231403) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include VNET_DEFINE(struct sctp_base_info, system_base_info); @@ -5435,6 +5438,148 @@ sctp_del_local_addr_restricted(struct sc static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC; static int sctp_scale_up_for_address = SCTP_SCALE_FOR_ADDR; + + +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +struct sctp_mcore_ctrl *sctp_mcore_workers = NULL; + +void +sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use) +{ + /* Queue a packet to a processor for the specified core */ + struct sctp_mcore_queue *qent; + struct sctp_mcore_ctrl *wkq; + int need_wake = 0; + + if (sctp_mcore_workers == NULL) { + /* Something went way bad during setup */ + sctp_input_with_port(m, off, 0); + return; + } + SCTP_MALLOC(qent, struct sctp_mcore_queue *, + (sizeof(struct sctp_mcore_queue)), + SCTP_M_MCORE); + if (qent == NULL) { + /* This is trouble */ + sctp_input_with_port(m, off, 0); + return; + } + qent->vn = curvnet; + qent->m = m; + qent->off = off; + qent->v6 = 0; + wkq = &sctp_mcore_workers[cpu_to_use]; + SCTP_MCORE_QLOCK(wkq); + + TAILQ_INSERT_TAIL(&wkq->que, qent, next); + if (wkq->running == 0) { + need_wake = 1; + } + SCTP_MCORE_QUNLOCK(wkq); + if (need_wake) { + wakeup(&wkq->running); + } +} + +static void +sctp_mcore_thread(void *arg) +{ + + struct sctp_mcore_ctrl *wkq; + struct sctp_mcore_queue *qent; + + wkq = (struct sctp_mcore_ctrl *)arg; + struct mbuf *m; + int off, v6; + + /* Wait for first tickle */ + SCTP_MCORE_LOCK(wkq); + wkq->running = 0; + msleep(&wkq->running, + &wkq->core_mtx, + 0, "wait for pkt", 0); + SCTP_MCORE_UNLOCK(wkq); + + /* Bind to our cpu */ + thread_lock(curthread); + sched_bind(curthread, wkq->cpuid); + thread_unlock(curthread); + + /* Now lets start working */ + SCTP_MCORE_LOCK(wkq); + /* Now grab lock and go */ + while (1) { + SCTP_MCORE_QLOCK(wkq); +skip_sleep: + wkq->running = 1; + qent = TAILQ_FIRST(&wkq->que); + if (qent) { + TAILQ_REMOVE(&wkq->que, qent, next); + SCTP_MCORE_QUNLOCK(wkq); + CURVNET_SET(qent->vn); + m = qent->m; + off = qent->off; + v6 = qent->v6; + SCTP_FREE(qent, SCTP_M_MCORE); + if (v6 == 0) { + sctp_input_with_port(m, off, 0); + } else { + printf("V6 not yet supported\n"); + sctp_m_freem(m); + } + CURVNET_RESTORE(); + SCTP_MCORE_QLOCK(wkq); + } + wkq->running = 0; + if (!TAILQ_EMPTY(&wkq->que)) { + goto skip_sleep; + } + SCTP_MCORE_QUNLOCK(wkq); + msleep(&wkq->running, + &wkq->core_mtx, + 0, "wait for pkt", 0); + }; +} + +static void +sctp_startup_mcore_threads(void) +{ + int i; + + if (mp_ncpus == 1) + return; + + SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, + (mp_ncpus * sizeof(struct sctp_mcore_ctrl)), + SCTP_M_MCORE); + if (sctp_mcore_workers == NULL) { + /* TSNH I hope */ + return; + } + memset(sctp_mcore_workers, 0, (mp_ncpus * + sizeof(struct sctp_mcore_ctrl))); + /* Init the structures */ + for (i = 0; i < mp_ncpus; i++) { + TAILQ_INIT(&sctp_mcore_workers[i].que); + SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); + SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); + sctp_mcore_workers[i].cpuid = i; + } + /* Now start them all */ + for (i = 0; i < mp_ncpus; i++) { + (void)kproc_create(sctp_mcore_thread, + (void *)&sctp_mcore_workers[i], + &sctp_mcore_workers[i].thread_proc, + RFPROC, + SCTP_KTHREAD_PAGES, + SCTP_MCORE_NAME); + + } +} + +#endif + + void sctp_pcb_init() { @@ -5565,6 +5710,10 @@ sctp_pcb_init() sctp_startup_iterator(); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) + sctp_startup_mcore_threads(); +#endif + /* * INIT the default VRF which for BSD is the only one, other O/S's * may have more. But initially they must start with one and then Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:10:09 2012 (r231403) @@ -624,6 +624,12 @@ sctp_initiate_iterator(inp_func inpf, struct sctp_inpcb *, uint8_t co_off); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +void + sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); + +#endif + #ifdef INVARIANTS void sctp_validate_no_locks(struct sctp_inpcb *inp); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:10:09 2012 (r231403) @@ -106,6 +106,31 @@ typedef void (*asoc_func) (struct sctp_i typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val); typedef void (*end_func) (void *ptr, uint32_t val); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +/* whats on the mcore control struct */ +struct sctp_mcore_queue { + TAILQ_ENTRY(sctp_mcore_queue) next; + struct vnet *vn; + struct mbuf *m; + int off; + int v6; +}; + +TAILQ_HEAD(sctp_mcore_qhead, sctp_mcore_queue); + +struct sctp_mcore_ctrl { + SCTP_PROCESS_STRUCT thread_proc; + struct sctp_mcore_qhead que; + struct mtx core_mtx; + struct mtx que_mtx; + int running; + int cpuid; +}; + + +#endif + + struct sctp_iterator { TAILQ_ENTRY(sctp_iterator) sctp_nxt_itr; struct vnet *vn; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:12:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58C51065674; Fri, 10 Feb 2012 19:12:23 +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 AEE238FC16; Fri, 10 Feb 2012 19:12: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 q1AJCNcQ089220; Fri, 10 Feb 2012 19:12:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJCNu0089215; Fri, 10 Feb 2012 19:12:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101912.q1AJCNu0089215@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231404 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:12:23 -0000 Author: tuexen Date: Fri Feb 10 19:12:23 2012 New Revision: 231404 URL: http://svn.freebsd.org/changeset/base/231404 Log: MFC r218219: Fix the per CPU stats so that: 1) They don't use the giant "MAX_CPU" define and instead are allocated dynamically based on mp_ncpus 2) Will zero with the netstat -z -s -p sctp 3) Will be properly handled by both the sctp_init and finish (the multi-net stuff was incorrectly bzero'ing in sctp_init the wrong size.. the bzero is now moved to the right places). And of course the free is put in at the very end. From rrs@. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5599,11 +5602,18 @@ sctp_pcb_init() #if defined(SCTP_LOCAL_TRACE_BUF) bzero(&SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log)); #endif +#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, + (mp_ncpus * sizeof(struct sctpstat)), + SCTP_M_MCORE); +#endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_ncpus)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else + bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); SCTP_BASE_STAT(sctps_discontinuitytime).tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STAT(sctps_discontinuitytime).tv_usec = (uint32_t) tv.tv_usec; #endif @@ -5846,7 +5856,9 @@ sctp_pcb_finish(void) SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_ephash), SCTP_BASE_INFO(hashmark)); if (SCTP_BASE_INFO(sctp_tcpephash) != NULL) SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_tcpephash), SCTP_BASE_INFO(hashtcpmark)); - +#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE); +#endif } Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:12:23 2012 (r231404) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -240,7 +242,7 @@ struct sctp_base_info { */ struct sctp_epinfo sctppcbinfo; #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - struct sctpstat sctpstat[MAXCPU]; + struct sctpstat *sctpstat; #else struct sctpstat sctpstat; #endif Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -648,8 +651,18 @@ static int sysctl_stat_get(SYSCTL_HANDLER_ARGS) { int cpu, error; - struct sctpstat sb, *sarry; + struct sctpstat sb, *sarry, *cpin = NULL; + if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { + /* + * User wants us to clear or at least reset the counters to + * the specified values. + */ + cpin = (struct sctpstat *)req->newptr; + } else if (req->newptr) { + /* Must be a stat structure */ + return (EINVAL); + } memset(&sb, 0, sizeof(sb)); for (cpu = 0; cpu < mp_ncpus; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; @@ -789,6 +802,9 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS) sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; + if (cpin) { + memcpy(sarry, cpin, sizeof(struct sctpstat)); + } } error = SYSCTL_OUT(req, &sb, sizeof(sb)); return (error); @@ -1099,7 +1115,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ou #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, - CTLTYPE_STRUCT | CTLFLAG_RD, + CTLTYPE_STRUCT | CTLFLAG_RW, 0, 0, sysctl_stat_get, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); #else Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -60,8 +63,6 @@ sctp_init(void) { u_long sb_max_adj; - bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); - /* Initialize and modify the sysctled variables */ sctp_init_sysctls(); if ((nmbclusters / 8) > SCTP_ASOC_MAX_CHUNKS_ON_QUEUE) From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:15:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA73106564A; Fri, 10 Feb 2012 19:15:05 +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 AFF648FC0A; Fri, 10 Feb 2012 19:15: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 q1AJF5ru089354; Fri, 10 Feb 2012 19:15:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJF5Cb089347; Fri, 10 Feb 2012 19:15:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101915.q1AJF5Cb089347@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231405 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:15:06 -0000 Author: tuexen Date: Fri Feb 10 19:15:05 2012 New Revision: 231405 URL: http://svn.freebsd.org/changeset/base/231405 Log: MFC r218232: 1) Move per John Baldwin to mp_maxid 2) Some signed/unsigned errors found by Mac OS compiler (from Michael) 3) a couple of copyright updates on the effected files. From rrs@. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1348,7 +1351,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); #ifdef SCTP_DEBUG - if (SCTP_BASE_SYSCTL(sctp_debug_on) && SCTP_DEBUG_ASCONF2) { + if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) { if (type == SCTP_ADD_IP_ADDRESS) { SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa); Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -375,8 +378,6 @@ sctp_cwnd_update_after_sack(struct sctp_ } } else { /* We are in congestion avoidance */ - uint32_t incr; - /* * Add to pba */ @@ -514,7 +515,8 @@ sctp_cwnd_update_after_packet_dropped(st uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt, incr; + int rtt; + unsigned int incr; int old_cwnd = net->cwnd; /* need real RTT for this calc */ Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -915,11 +918,11 @@ __FBSDID("$FreeBSD$"); /* modular comparison */ /* See RFC 1982 for details. */ -#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ - ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GT(a, b) (((a < b) && ((uint16_t)(b - a) > (1U<<15))) || \ + ((a > b) && ((uint16_t)(a - b) < (1U<<15)))) #define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) -#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ - ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GT(a, b) (((a < b) && ((uint32_t)(b - a) > (1U<<31))) || \ + ((a > b) && ((uint32_t)(a - b) < (1U<<31)))) #define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2920,7 +2923,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch uint8_t override_bit = 0; uint32_t tsn, window_data_tsn; int len; - int pkt_cnt; + unsigned int pkt_cnt; len = ntohs(cp->ch.chunk_length); if ((len != sizeof(struct sctp_ecne_chunk)) && @@ -5935,7 +5938,7 @@ sctp_input(struct mbuf *m, int off) int offset; int cpu_to_use; - if (mp_ncpus > 1) { + if (mp_maxid > 1) { ip = mtod(m, struct ip *); offset = off + sizeof(*sh); if (SCTP_BUF_LEN(m) < offset) { @@ -5946,7 +5949,7 @@ sctp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); } sh = (struct sctphdr *)((caddr_t)ip + off); - cpu_to_use = ntohl(sh->v_tag) % mp_ncpus; + cpu_to_use = ntohl(sh->v_tag) % mp_maxid; sctp_queue_to_mcore(m, off, cpu_to_use); return; } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -9311,14 +9314,15 @@ sctp_chunk_output(struct sctp_inpcb *inp */ struct sctp_association *asoc; struct sctp_nets *net; - int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0; + int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0; + unsigned int burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; int frag_point = sctp_get_frag_point(stcb, &stcb->asoc); int un_sent = 0; - int fr_done, tot_frs = 0; + int fr_done; + unsigned int tot_frs = 0; asoc = &stcb->asoc; if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:15:05 2012 (r231405) @@ -5549,27 +5549,27 @@ sctp_startup_mcore_threads(void) { int i; - if (mp_ncpus == 1) + if (mp_maxid == 1) return; SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, - (mp_ncpus * sizeof(struct sctp_mcore_ctrl)), + (mp_maxid * sizeof(struct sctp_mcore_ctrl)), SCTP_M_MCORE); if (sctp_mcore_workers == NULL) { /* TSNH I hope */ return; } - memset(sctp_mcore_workers, 0, (mp_ncpus * + memset(sctp_mcore_workers, 0, (mp_maxid * sizeof(struct sctp_mcore_ctrl))); /* Init the structures */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < mp_maxid; i++) { TAILQ_INIT(&sctp_mcore_workers[i].que); SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); sctp_mcore_workers[i].cpuid = i; } /* Now start them all */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < mp_maxid; i++) { (void)kproc_create(sctp_mcore_thread, (void *)&sctp_mcore_workers[i], &sctp_mcore_workers[i].thread_proc, @@ -5604,12 +5604,12 @@ sctp_pcb_init() #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, - (mp_ncpus * sizeof(struct sctpstat)), + (mp_maxid * sizeof(struct sctpstat)), SCTP_M_MCORE); #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_ncpus)); + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_maxid)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:15:05 2012 (r231405) @@ -664,7 +664,7 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS) return (EINVAL); } memset(&sb, 0, sizeof(sb)); - for (cpu = 0; cpu < mp_ncpus; cpu++) { + for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:19:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D11A106564A; Fri, 10 Feb 2012 19:19:16 +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 2789C8FC0C; Fri, 10 Feb 2012 19:19:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AJJGOM089568; Fri, 10 Feb 2012 19:19:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJJFE6089560; Fri, 10 Feb 2012 19:19:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101919.q1AJJFE6089560@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231407 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:19:16 -0000 Author: tuexen Date: Fri Feb 10 19:19:15 2012 New Revision: 231407 URL: http://svn.freebsd.org/changeset/base/231407 Log: MFC r218235: Make sure that changing the ECN sysctl does not affect exisiting associations and endpoints. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:19:15 2012 (r231407) @@ -2721,6 +2721,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_socket = so; inp->sctp_frag_point = (*inp_p)->sctp_frag_point; inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; + inp->sctp_ecn_enable = (*inp_p)->sctp_ecn_enable; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; inp->sctp_context = (*inp_p)->sctp_context; inp->inp_starting_point_for_iterator = NULL; @@ -5616,7 +5617,8 @@ sctp_common_input_processing(struct mbuf */ } /* take care of ecn */ - if (stcb->asoc.ecn_allowed && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { + if ((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); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:19:15 2012 (r231407) @@ -3392,10 +3392,11 @@ static uint8_t sctp_get_ect(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk) { - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 0) + if ((stcb != NULL) && (stcb->asoc.ecn_allowed == 1)) { + return (SCTP_ECT0_BIT); + } else { return (0); - - return (SCTP_ECT0_BIT); + } } static int @@ -3502,17 +3503,9 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_ttl = inp->ip_inp.inp.inp_ip_ttl; ip->ip_len = packet_length; - if (stcb) { - if ((stcb->asoc.ecn_allowed) && ecn_ok) { - /* Enable ECN */ - ip->ip_tos = ((u_char)(tos_value & 0xfc) | sctp_get_ect(stcb, chk)); - } else { - /* No ECN */ - ip->ip_tos = (u_char)(tos_value & 0xfc); - } - } else { - /* no association at all */ - ip->ip_tos = (tos_value & 0xfc); + ip->ip_tos = tos_value & 0xfc; + if (ecn_ok) { + ip->ip_tos |= sctp_get_ect(stcb, chk); } if (port) { ip->ip_p = IPPROTO_UDP; @@ -3839,18 +3832,11 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { ro = (sctp_route_t *) & net->ro; } - if (stcb != NULL) { - if ((stcb->asoc.ecn_allowed) && ecn_ok) { - /* Enable ECN */ - tosBottom = (((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) | sctp_get_ect(stcb, chk)) << 4); - } else { - /* No ECN */ - tosBottom = ((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) << 4); - } - } else { - /* we could get no asoc if it is a O-O-T-B packet */ - tosBottom = ((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) << 4); + tosBottom = (((struct in6pcb *)inp)->in6p_flowinfo & 0x0c); + if (ecn_ok) { + tosBottom |= sctp_get_ect(stcb, chk); } + tosBottom <<= 4; ip6h->ip6_flow = htonl(((tosTop << 24) | ((tosBottom | flowTop) << 16) | flowBottom)); if (port) { ip6h->ip6_nxt = IPPROTO_UDP; @@ -4247,7 +4233,7 @@ sctp_send_initiate(struct sctp_inpcb *in stcb->asoc.cookie_preserve_req = 0; } /* ECN parameter */ - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 1) { + if (stcb->asoc.ecn_allowed == 1) { ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); ecn->ph.param_length = htons(sizeof(*ecn)); SCTP_BUF_LEN(m) += sizeof(*ecn); @@ -5350,7 +5336,8 @@ do_a_abort: ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); /* ECN parameter */ - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 1) { + if (((asoc != NULL) && (asoc->ecn_allowed == 1)) || + (inp->sctp_ecn_enable == 1)) { ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); ecn->ph.param_length = htons(sizeof(*ecn)); SCTP_BUF_LEN(m) += sizeof(*ecn); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:19:15 2012 (r231407) @@ -2399,6 +2399,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); + inp->sctp_ecn_enable = SCTP_BASE_SYSCTL(sctp_ecn_enable); /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { @@ -5899,6 +5900,7 @@ sctp_load_addresses_from_init(struct sct sctp_key_t *new_key; uint32_t keylen; int got_random = 0, got_hmacs = 0, got_chklist = 0; + uint8_t ecn_allowed; /* First get the destination address setup too. */ memset(&sin, 0, sizeof(sin)); @@ -5959,7 +5961,7 @@ sctp_load_addresses_from_init(struct sct sa = altsa; } /* Turn off ECN until we get through all params */ - stcb->asoc.ecn_allowed = 0; + ecn_allowed = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* mark all addresses that we have currently on the list */ net->dest_state |= SCTP_ADDR_NOT_IN_ASSOC; @@ -6192,7 +6194,7 @@ sctp_load_addresses_from_init(struct sct } } } else if (ptype == SCTP_ECN_CAPABLE) { - stcb->asoc.ecn_allowed = 1; + ecn_allowed = 1; } else if (ptype == SCTP_ULP_ADAPTATION) { if (stcb->asoc.state != SCTP_STATE_OPEN) { struct sctp_adaptation_layer_indication ai, @@ -6431,6 +6433,9 @@ next_param: } } } + if (ecn_allowed == 0) { + stcb->asoc.ecn_allowed = 0; + } /* validate authentication required parameters */ if (got_random && got_hmacs) { stcb->asoc.peer_supports_auth = 1; Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:19:15 2012 (r231407) @@ -394,6 +394,7 @@ struct sctp_inpcb { uint32_t partial_delivery_point; uint32_t sctp_context; uint32_t sctp_cmt_on_off; + uint32_t sctp_ecn_enable; struct sctp_nonpad_sndrcvinfo def_send; /*- * These three are here for the sosend_dgram Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:19:15 2012 (r231407) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -113,6 +116,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_mobility_features = inp->sctp_mobility_features; n_inp->sctp_frag_point = inp->sctp_frag_point; n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; + n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; @@ -187,6 +191,7 @@ sctp_get_peeloff(struct socket *head, sc n_inp->sctp_features = inp->sctp_features; n_inp->sctp_frag_point = inp->sctp_frag_point; n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; + n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:19:15 2012 (r231407) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -917,6 +920,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); asoc->cookie_life = m->sctp_ep.def_cookie_life; asoc->sctp_cmt_on_off = m->sctp_cmt_on_off; + asoc->ecn_allowed = m->sctp_ecn_enable; asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off); asoc->sctp_cmt_pf = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_pf); asoc->sctp_frag_point = m->sctp_frag_point; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:22:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1200C106564A; Fri, 10 Feb 2012 19:22: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 E746A8FC16; Fri, 10 Feb 2012 19:22: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 q1AJMLUF089725; Fri, 10 Feb 2012 19:22:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJML9v089718; Fri, 10 Feb 2012 19:22:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101922.q1AJML9v089718@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231408 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:22:22 -0000 Author: tuexen Date: Fri Feb 10 19:22:21 2012 New Revision: 231408 URL: http://svn.freebsd.org/changeset/base/231408 Log: MFC r218241: Fix several bugs in the stream schedulers. From Robin Seggelmann. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:22:21 2012 (r231408) @@ -12342,7 +12342,7 @@ sctp_lower_sosend(struct socket *so, TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); } } } Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1,6 +1,7 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2010-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -56,6 +57,11 @@ sctp_ss_default_init(struct sctp_tcb *st uint16_t i; TAILQ_INIT(&asoc->ss_data.out_wheel); + /* + * If there is data in the stream queues already, the scheduler of + * an existing association has been changed. We need to add all + * stream queues to the wheel. + */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { sctp_ss_default_add(stcb, &stcb->asoc, @@ -83,7 +89,7 @@ sctp_ss_default_clear(struct sctp_tcb *s } static void -sctp_ss_default_init_stream(struct sctp_stream_out *strq) +sctp_ss_default_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.rr.next_spoke.tqe_next = NULL; strq->ss_params.rr.next_spoke.tqe_prev = NULL; @@ -411,11 +417,15 @@ sctp_ss_prio_clear(struct sctp_tcb *stcb } static void -sctp_ss_prio_init_stream(struct sctp_stream_out *strq) +sctp_ss_prio_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; - strq->ss_params.prio.priority = 0; + if (with_strq != NULL) { + strq->ss_params.prio.priority = with_strq->ss_params.prio.priority; + } else { + strq->ss_params.prio.priority = 0; + } return; } @@ -575,11 +585,15 @@ sctp_ss_fb_clear(struct sctp_tcb *stcb, } static void -sctp_ss_fb_init_stream(struct sctp_stream_out *strq) +sctp_ss_fb_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; - strq->ss_params.fb.rounds = -1; + if (with_strq != NULL) { + strq->ss_params.fb.rounds = with_strq->ss_params.fb.rounds; + } else { + strq->ss_params.fb.rounds = -1; + } return; } @@ -697,28 +711,40 @@ sctp_ss_fb_scheduled(struct sctp_tcb *st * Maintains the order provided by the application. */ static void +sctp_ss_fcfs_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock); + +static void sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc, int holds_lock) { - int x, element = 0, add_more = 1; + uint32_t x, n = 0, add_more = 1; struct sctp_stream_queue_pending *sp; uint16_t i; TAILQ_INIT(&asoc->ss_data.out_list); + /* + * If there is data in the stream queues already, the scheduler of + * an existing association has been changed. We can only cycle + * through the stream queues and add everything to the FCFS queue. + */ while (add_more) { add_more = 0; for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - sp = TAILQ_FIRST(&asoc->ss_data.out_list); - x = element; - while (sp != NULL && x > 0) { + sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + x = 0; + /* Find n. message in current stream queue */ + while (sp != NULL && x < n) { sp = TAILQ_NEXT(sp, next); + x++; } if (sp != NULL) { - sctp_ss_default_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, holds_lock); add_more = 1; } } - element++; + n++; } return; } @@ -729,14 +755,14 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb { if (clear_values) { while (!TAILQ_EMPTY(&asoc->ss_data.out_list)) { - TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), next); + TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), ss_next); } } return; } static void -sctp_ss_fcfs_init_stream(struct sctp_stream_out *strq) +sctp_ss_fcfs_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { /* Nothing to be done here */ return; @@ -750,9 +776,9 @@ sctp_ss_fcfs_add(struct sctp_tcb *stcb, if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (sp && (sp->next.tqe_next == NULL) && - (sp->next.tqe_prev == NULL)) { - TAILQ_INSERT_TAIL(&asoc->ss_data.out_list, sp, next); + if (sp && (sp->ss_next.tqe_next == NULL) && + (sp->ss_next.tqe_prev == NULL)) { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_list, sp, ss_next); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -779,9 +805,9 @@ sctp_ss_fcfs_remove(struct sctp_tcb *stc SCTP_TCB_SEND_LOCK(stcb); } if (sp && - ((sp->next.tqe_next != NULL) || - (sp->next.tqe_prev != NULL))) { - TAILQ_REMOVE(&asoc->ss_data.out_list, sp, next); + ((sp->ss_next.tqe_next != NULL) || + (sp->ss_next.tqe_prev != NULL))) { + TAILQ_REMOVE(&asoc->ss_data.out_list, sp, ss_next); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -819,7 +845,7 @@ default_again: if (TAILQ_FIRST(&strq->outqueue) && TAILQ_FIRST(&strq->outqueue)->net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) { - sp = TAILQ_NEXT(sp, next); + sp = TAILQ_NEXT(sp, ss_next); goto default_again; } } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:22:21 2012 (r231408) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -475,6 +478,7 @@ struct sctp_stream_queue_pending { struct timeval ts; struct sctp_nets *net; TAILQ_ENTRY(sctp_stream_queue_pending) next; + TAILQ_ENTRY(sctp_stream_queue_pending) ss_next; uint32_t length; uint32_t timetolive; uint32_t ppid; @@ -652,7 +656,7 @@ struct sctp_ss_functions { int holds_lock); void (*sctp_ss_clear) (struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock); - void (*sctp_ss_init_stream) (struct sctp_stream_out *strq); + void (*sctp_ss_init_stream) (struct sctp_stream_out *strq, struct sctp_stream_out *with_strq); void (*sctp_ss_add_to_stream) (struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock); int (*sctp_ss_is_empty) (struct sctp_tcb *stcb, struct sctp_association *asoc); @@ -751,12 +755,7 @@ struct sctp_association { /* re-assembly queue for fragmented chunks on the inbound path */ struct sctpchunk_listhead reasmqueue; - /* - * this queue is used when we reach a condition that we can NOT put - * data into the socket buffer. We track the size of this queue and - * set our rwnd to the space in the socket minus also the - * size_on_delivery_queue. - */ + /* Scheduling queues */ union scheduling_data ss_data; /* Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1510,32 +1513,17 @@ sctp_audit_stream_queues_for_size(struct stcb->asoc.sent_queue_retran_cnt); stcb->asoc.sent_queue_retran_cnt = 0; } - SCTP_TCB_SEND_LOCK(stcb); if (stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { - int cnt = 0; - - /* Check to see if a spoke fell off the wheel */ - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, - &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, - 1); - cnt++; - } - } - if (cnt) { - /* yep, we lost a spoke or two */ - SCTP_PRINTF("Found an additional %d streams NOT on outwheel, corrected\n", cnt); + /* No stream scheduler information, initialize scheduler */ + stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 0); + if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { + /* yep, we lost a stream or two */ + SCTP_PRINTF("Found additional streams NOT managed by scheduler, corrected\n"); } else { - /* no spokes lost, */ + /* no streams lost */ stcb->asoc.total_output_queue_size = 0; } - SCTP_TCB_SEND_UNLOCK(stcb); - return; } - SCTP_TCB_SEND_UNLOCK(stcb); /* Check to see if some data queued, if so report it */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:22:21 2012 (r231408) @@ -3445,7 +3445,7 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.strmout[i].next_sequence_sent = oldstream[i].next_sequence_sent; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.ss_functions.sctp_ss_init_stream(&oldstream[i]); + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); /* * now anything on those * queues? @@ -3472,7 +3472,7 @@ sctp_setopt(struct socket *so, int optna TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; - stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i]); + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); } stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + addstrmcnt; SCTP_FREE(oldstream, SCTP_M_STRMO); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1076,7 +1076,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); } asoc->ss_functions.sctp_ss_init(stcb, asoc, 0); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:27:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1B8106566C; Fri, 10 Feb 2012 19:27:03 +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 98CAF8FC0A; Fri, 10 Feb 2012 19:27: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 q1AJR3rx089905; Fri, 10 Feb 2012 19:27:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJR3FS089902; Fri, 10 Feb 2012 19:27:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101927.q1AJR3FS089902@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231409 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:27:03 -0000 Author: tuexen Date: Fri Feb 10 19:27:03 2012 New Revision: 231409 URL: http://svn.freebsd.org/changeset/base/231409 Log: MFC r218269: 1) Fix cpu mapping per JB's suggestions 2) Fix it so INIT's don't always end up on CPU0 From rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:22:21 2012 (r231408) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:27:03 2012 (r231409) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5930,6 +5929,10 @@ bad: return; } +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +extern int *sctp_cpuarry; + +#endif void sctp_input(struct mbuf *m, int off) @@ -5939,8 +5942,9 @@ sctp_input(struct mbuf *m, int off) struct sctphdr *sh; int offset; int cpu_to_use; + uint32_t tag; - if (mp_maxid > 1) { + if (mp_ncpus > 1) { ip = mtod(m, struct ip *); offset = off + sizeof(*sh); if (SCTP_BUF_LEN(m) < offset) { @@ -5951,7 +5955,19 @@ sctp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); } sh = (struct sctphdr *)((caddr_t)ip + off); - cpu_to_use = ntohl(sh->v_tag) % mp_maxid; + if (sh->v_tag) { + tag = htonl(sh->v_tag); + } else { + /* + * Distribute new INIT's to all CPU's don't just + * pick on 0. + */ + struct timeval tv; + + (void)SCTP_GETTIME_TIMEVAL(&tv); + tag = (uint32_t) tv.tv_usec; + } + cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); return; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:22:21 2012 (r231408) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:27:03 2012 (r231409) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5446,7 +5445,7 @@ static int sctp_scale_up_for_address = S #if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) struct sctp_mcore_ctrl *sctp_mcore_workers = NULL; - +int *sctp_cpuarry = NULL; void sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use) { @@ -5548,32 +5547,48 @@ skip_sleep: static void sctp_startup_mcore_threads(void) { - int i; + int i, cpu; - if (mp_maxid == 1) + if (mp_ncpus == 1) return; + if (sctp_mcore_workers != NULL) { + /* + * Already been here in some previous vnet? + */ + return; + } SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, - (mp_maxid * sizeof(struct sctp_mcore_ctrl)), + ((mp_maxid + 1) * sizeof(struct sctp_mcore_ctrl)), SCTP_M_MCORE); if (sctp_mcore_workers == NULL) { /* TSNH I hope */ return; } - memset(sctp_mcore_workers, 0, (mp_maxid * + memset(sctp_mcore_workers, 0, ((mp_maxid + 1) * sizeof(struct sctp_mcore_ctrl))); /* Init the structures */ - for (i = 0; i < mp_maxid; i++) { + for (i = 0; i <= mp_maxid; i++) { TAILQ_INIT(&sctp_mcore_workers[i].que); SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); sctp_mcore_workers[i].cpuid = i; } + if (sctp_cpuarry == NULL) { + SCTP_MALLOC(sctp_cpuarry, int *, + (mp_ncpus * sizeof(int)), + SCTP_M_MCORE); + i = 0; + CPU_FOREACH(cpu) { + sctp_cpuarry[i] = cpu; + i++; + } + } /* Now start them all */ - for (i = 0; i < mp_maxid; i++) { + CPU_FOREACH(cpu) { (void)kproc_create(sctp_mcore_thread, - (void *)&sctp_mcore_workers[i], - &sctp_mcore_workers[i].thread_proc, + (void *)&sctp_mcore_workers[cpu], + &sctp_mcore_workers[cpu].thread_proc, RFPROC, SCTP_KTHREAD_PAGES, SCTP_MCORE_NAME); @@ -5605,12 +5620,12 @@ sctp_pcb_init() #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, - (mp_maxid * sizeof(struct sctpstat)), + ((mp_maxid + 1) * sizeof(struct sctpstat)), SCTP_M_MCORE); #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_maxid)); + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * (mp_maxid + 1))); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:29:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D30106566B; Fri, 10 Feb 2012 19:29: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 316DB8FC16; Fri, 10 Feb 2012 19:29: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 q1AJTdOC090063; Fri, 10 Feb 2012 19:29:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJTcgU090024; Fri, 10 Feb 2012 19:29:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101929.q1AJTcgU090024@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231410 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:29:39 -0000 Author: tuexen Date: Fri Feb 10 19:29:38 2012 New Revision: 231410 URL: http://svn.freebsd.org/changeset/base/231410 Log: MFC r218319: 1) Typo correction in comments and one spacing change. 2) Mass update to all copyrights. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_crc32.c stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_os.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_asconf.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_bsd_addr.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_crc32.c ============================================================================== --- stable/8/sys/netinet/sctp_crc32.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_crc32.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_crc32.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_input.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:29:38 2012 (r231410) @@ -2,6 +2,8 @@ #define __sctp_lock_bsd_h__ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_os.h ============================================================================== --- stable/8/sys/netinet/sctp_os.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_os.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_peeloff.h ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_peeloff.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,7 +1,7 @@ /*- - * Copyright (c) 2010-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2010-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2010-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2010-2011, by Robin Seggelmann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -13,10 +13,6 @@ * notice, this list of conditions and the following disclaimer in * 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 - * from this software without specific prior written permission. - * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 @@ -178,7 +174,7 @@ default_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -287,7 +283,6 @@ sctp_ss_rrp_add(struct sctp_tcb *stcb, s } if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); } else { @@ -331,7 +326,7 @@ rrp_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -374,7 +369,7 @@ rrp_pd_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -441,7 +436,6 @@ sctp_ss_prio_add(struct sctp_tcb *stcb, } if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); } else { @@ -516,7 +510,7 @@ prio_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -833,7 +827,7 @@ default_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_timer.h ============================================================================== --- stable/8/sys/netinet/sctp_timer.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_timer.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_var.h ============================================================================== --- stable/8/sys/netinet/sctp_var.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_var.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet6/sctp6_var.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:37:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACD87106566C; Fri, 10 Feb 2012 19:37:24 +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 969B98FC13; Fri, 10 Feb 2012 19:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AJbOSV090353; Fri, 10 Feb 2012 19:37:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJbOe2090348; Fri, 10 Feb 2012 19:37:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101937.q1AJbOe2090348@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231411 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:37:24 -0000 Author: tuexen Date: Fri Feb 10 19:37:23 2012 New Revision: 231411 URL: http://svn.freebsd.org/changeset/base/231411 Log: MFC r218335: Add support for M_FLOWID. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:37:23 2012 (r231411) @@ -2615,6 +2615,9 @@ sctp_handle_cookie_echo(struct mbuf *m, /* still no TCB... must be bad cookie-echo */ return (NULL); } + if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { + (*netp)->flowid = m->m_pkthdr.flowid; + } /* * Ok, we built an association so confirm the address we sent the * INIT-ACK to. @@ -5842,6 +5845,9 @@ sctp_skip_csum_4: } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; + } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { struct sctp_init_chunk *init_chk, chunk_buf; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:37:23 2012 (r231411) @@ -3419,7 +3419,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif - union sctp_sockstore *over_addr + union sctp_sockstore *over_addr, + struct mbuf *init ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { @@ -3483,6 +3484,15 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_LEN(newm) = len; SCTP_BUF_NEXT(newm) = m; m = newm; + if (net != NULL) { + m->m_pkthdr.flowid = net->flowid; + m->m_flags |= M_FLOWID; + } else { + if ((init != NULL) && (init->m_flags & M_FLOWID)) { + m->m_pkthdr.flowid = init->m_pkthdr.flowid; + m->m_flags |= M_FLOWID; + } + } packet_length = sctp_calculate_len(m); ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; @@ -3804,6 +3814,15 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_LEN(newm) = len; SCTP_BUF_NEXT(newm) = m; m = newm; + if (net != NULL) { + m->m_pkthdr.flowid = net->flowid; + m->m_flags |= M_FLOWID; + } else { + if ((init != NULL) && (init->m_flags & M_FLOWID)) { + m->m_pkthdr.flowid = init->m_pkthdr.flowid; + m->m_flags |= M_FLOWID; + } + } packet_length = sctp_calculate_len(m); ip6h = mtod(m, struct ip6_hdr *); @@ -4365,7 +4384,7 @@ sctp_send_initiate(struct sctp_inpcb *in (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(0), - net->port, so_locked, NULL); + net->port, so_locked, NULL, NULL); SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); @@ -5536,7 +5555,7 @@ do_a_abort: (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, NULL, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, - port, SCTP_SO_NOT_LOCKED, over_addr); + port, SCTP_SO_NOT_LOCKED, over_addr, init_pkt); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -7564,7 +7583,7 @@ again_one_more_time: no_fragmentflg, 0, NULL, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -7820,7 +7839,7 @@ again_one_more_time: no_fragmentflg, 0, NULL, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8151,7 +8170,7 @@ no_data_fill: asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { /* error, we could not output */ if (error == ENOBUFS) { SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8861,7 +8880,7 @@ sctp_chunk_retransmission(struct sctp_in auth_offset, auth, stcb->asoc.authinfo.active_keyid, no_fragmentflg, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - chk->whoTo->port, so_locked, NULL))) { + chk->whoTo->port, so_locked, NULL, NULL))) { SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } @@ -9119,7 +9138,7 @@ one_chunk_around: auth_offset, auth, auth_keyid, no_fragmentflg, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { /* error, we could not output */ SCTP_STAT_INCR(sctps_lowlevelerr); return (error); @@ -10232,7 +10251,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, NULL, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - stcb->asoc.primary_destination->port, so_locked, NULL); + stcb->asoc.primary_destination->port, so_locked, NULL, NULL); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10269,7 +10288,7 @@ sctp_send_shutdown_complete(struct sctp_ m_shutdown_comp, 0, NULL, 0, 1, 0, NULL, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), - net->port, SCTP_SO_NOT_LOCKED, NULL); + net->port, SCTP_SO_NOT_LOCKED, NULL, NULL); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } @@ -10314,6 +10333,10 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = NULL; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; @@ -11378,6 +11401,10 @@ sctp_send_abort(struct mbuf *m, int iphl SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = err_cause; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; @@ -11623,6 +11650,10 @@ sctp_send_operr_to(struct mbuf *m, int i SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = scm; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:37:23 2012 (r231411) @@ -4035,6 +4035,10 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } + /* Choose an initial flowid. */ + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); return (0); } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:37:23 2012 (r231411) @@ -350,6 +350,7 @@ struct sctp_nets { uint8_t lan_type; /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; + uint32_t flowid; }; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:40:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0281065743; Fri, 10 Feb 2012 19:40: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 2BBD68FC12; Fri, 10 Feb 2012 19:40: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 q1AJeKBH090479; Fri, 10 Feb 2012 19:40:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJeJOh090476; Fri, 10 Feb 2012 19:40:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101940.q1AJeJOh090476@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231412 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:40:20 -0000 Author: tuexen Date: Fri Feb 10 19:40:19 2012 New Revision: 231412 URL: http://svn.freebsd.org/changeset/base/231412 Log: MFC r218371: 1) Use same scheme Michael and I discussed for a selected for a flowid 2) If flowid is not set, arrange so it is stored. 3) If flowid is set by lower layer, use it. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:37:23 2012 (r231411) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:40:19 2012 (r231412) @@ -5948,32 +5948,32 @@ sctp_input(struct mbuf *m, int off) struct sctphdr *sh; int offset; int cpu_to_use; - uint32_t tag; + uint32_t flowid, tag; if (mp_ncpus > 1) { - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); - if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { - SCTP_STAT_INCR(sctps_hdrops); - return; - } - ip = mtod(m, struct ip *); - } - sh = (struct sctphdr *)((caddr_t)ip + off); - if (sh->v_tag) { - tag = htonl(sh->v_tag); + if (m->m_flags & M_FLOWID) { + flowid = m->m_pkthdr.flowid; } else { /* - * Distribute new INIT's to all CPU's don't just - * pick on 0. + * No flow id built by lower layers fix it so we + * create one. */ - struct timeval tv; - - (void)SCTP_GETTIME_TIMEVAL(&tv); - tag = (uint32_t) tv.tv_usec; + ip = mtod(m, struct ip *); + offset = off + sizeof(*sh); + if (SCTP_BUF_LEN(m) < offset) { + if ((m = m_pullup(m, offset)) == 0) { + SCTP_STAT_INCR(sctps_hdrops); + return; + } + ip = mtod(m, struct ip *); + } + sh = (struct sctphdr *)((caddr_t)ip + off); + tag = htonl(sh->v_tag); + flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); + m->m_pkthdr.flowid = flowid; + m->m_flags |= M_FLOWID; } - cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; + cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); return; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:47:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C75191065675; Fri, 10 Feb 2012 19:47: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 971CD8FC0C; Fri, 10 Feb 2012 19:47: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 q1AJlFXP090747; Fri, 10 Feb 2012 19:47:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJlFSt090743; Fri, 10 Feb 2012 19:47:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101947.q1AJlFSt090743@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231413 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:47:15 -0000 Author: tuexen Date: Fri Feb 10 19:47:15 2012 New Revision: 231413 URL: http://svn.freebsd.org/changeset/base/231413 Log: MFC r218392: 1) Track when flowid does get set. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:47:15 2012 (r231413) @@ -2617,6 +2617,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { (*netp)->flowid = m->m_pkthdr.flowid; + (*netp)->flowidset = 1; } /* * Ok, we built an association so confirm the address we sent the @@ -5847,6 +5848,7 @@ sctp_skip_csum_4: } if ((net != NULL) && (m->m_flags & M_FLOWID)) { net->flowid = m->m_pkthdr.flowid; + net->flowidset = 1; } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:47:15 2012 (r231413) @@ -4039,6 +4039,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^ ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; return (0); } @@ -5602,7 +5603,6 @@ sctp_startup_mcore_threads(void) #endif - void sctp_pcb_init() { @@ -5750,7 +5750,6 @@ sctp_pcb_init() * add the VRF's as addresses are added. */ sctp_init_vrf_list(SCTP_DEFAULT_VRF); - } /* Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:47:15 2012 (r231413) @@ -351,6 +351,7 @@ struct sctp_nets { /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; uint32_t flowid; + uint8_t flowidset; }; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:49:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CB11065673; Fri, 10 Feb 2012 19:49:36 +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 001308FC1B; Fri, 10 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 q1AJnZjd090857; Fri, 10 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 q1AJnZls090855; Fri, 10 Feb 2012 19:49:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101949.q1AJnZls090855@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231414 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:49:36 -0000 Author: tuexen Date: Fri Feb 10 19:49:35 2012 New Revision: 231414 URL: http://svn.freebsd.org/changeset/base/231414 Log: MFC r218393: If not set (due to some error Michael is working on fixing) set it for the net. From rrs@. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:47:15 2012 (r231413) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:49:35 2012 (r231414) @@ -3485,6 +3485,12 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { + if (net->flowidset == 0) { + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; + } m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { @@ -3815,6 +3821,12 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { + if (net->flowidset == 0) { + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; + } m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:52:19 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D21D1065670; Fri, 10 Feb 2012 19:52: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 264AB8FC08; Fri, 10 Feb 2012 19:52: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 q1AJqJim090993; Fri, 10 Feb 2012 19:52:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJqIJ2090987; Fri, 10 Feb 2012 19:52:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101952.q1AJqIJ2090987@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231415 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:52:19 -0000 Author: tuexen Date: Fri Feb 10 19:52:18 2012 New Revision: 231415 URL: http://svn.freebsd.org/changeset/base/231415 Log: MFC r218400: Fix bugs related to M_FLOWID: * Store the flowid when receiving an SCTP/IPv6 packet. * Store the flowid when receiving an SCTP packet with wrong CRC. * Initilize flowid correctly. * Put test code under INVARIANTS. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:52:18 2012 (r231415) @@ -2617,7 +2617,9 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { (*netp)->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS (*netp)->flowidset = 1; +#endif } /* * Ok, we built an association so confirm the address we sent the @@ -5817,6 +5819,12 @@ sctp_input_with_port(struct mbuf *i_pak, } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } if ((inp) && (stcb)) { sctp_send_packet_dropped(stcb, net, m, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); @@ -5848,7 +5856,9 @@ sctp_skip_csum_4: } if ((net != NULL) && (m->m_flags & M_FLOWID)) { net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS net->flowidset = 1; +#endif } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:52:18 2012 (r231415) @@ -3485,12 +3485,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { +#ifdef INVARIANTS if (net->flowidset == 0) { - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; + panic("Flow ID not set"); } +#endif m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { @@ -3821,12 +3820,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { +#ifdef INVARIANTS if (net->flowidset == 0) { - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; + panic("Flow ID not set"); } +#endif m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:52:18 2012 (r231415) @@ -3962,6 +3962,13 @@ sctp_add_remote_addr(struct sctp_tcb *st net->find_pseudo_cumack = 1; net->find_rtx_pseudo_cumack = 1; net->src_addr_selected = 0; + /* Choose an initial flowid. */ + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); +#ifdef INVARIANTS + net->flowidset = 1; +#endif netfirst = TAILQ_FIRST(&stcb->asoc.nets); if (net->ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4035,11 +4042,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } - /* Choose an initial flowid. */ - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; return (0); } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:52:18 2012 (r231415) @@ -351,7 +351,9 @@ struct sctp_nets { /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; uint32_t flowid; +#ifdef INVARIANTS uint8_t flowidset; +#endif }; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:52:18 2012 (r231415) @@ -170,6 +170,12 @@ sctp6_input(struct mbuf **i_pak, int *of } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { sctp_send_packet_dropped(stcb, net, m, iphlen, 1); @@ -198,6 +204,12 @@ sctp_skip_csum: } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased */ if (in6p == NULL) { struct sctp_init_chunk *init_chk, chunk_buf; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:54:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8E92106564A; Fri, 10 Feb 2012 19:54:18 +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 A97E38FC15; Fri, 10 Feb 2012 19: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 q1AJsIkN091098; Fri, 10 Feb 2012 19:54:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJsI29091096; Fri, 10 Feb 2012 19:54:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101954.q1AJsI29091096@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231416 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:54:19 -0000 Author: tuexen Date: Fri Feb 10 19:54:18 2012 New Revision: 231416 URL: http://svn.freebsd.org/changeset/base/231416 Log: MFC r218521: Remove addresses from endpoint when there are no associations. This fixes a bug reported by brucec@. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:52:18 2012 (r231415) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:54:18 2012 (r231416) @@ -3104,6 +3104,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * uint32_t type, uint32_t vrf_id, struct sctp_ifa *sctp_ifap) { struct sctp_ifa *ifa; + struct sctp_laddr *laddr, *nladdr; if (sa->sa_len == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); @@ -3124,8 +3125,6 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * if (type == SCTP_ADD_IP_ADDRESS) { sctp_add_local_addr_ep(inp, ifa, type); } else if (type == SCTP_DEL_IP_ADDRESS) { - struct sctp_laddr *laddr; - if (inp->laddr_count < 2) { /* can't delete the last local address */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); @@ -3139,11 +3138,19 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * } } } - if (!LIST_EMPTY(&inp->sctp_asoc_list)) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { /* * There is no need to start the iterator if the inp * has no associations. */ + if (type == SCTP_DEL_IP_ADDRESS) { + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { + if (laddr->ifa == ifa) { + sctp_del_local_addr_ep(inp, ifa); + } + } + } + } else { struct sctp_asconf_iterator *asc; struct sctp_laddr *wi; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:56:02 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813FC106566B; Fri, 10 Feb 2012 19:56:02 +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 693438FC13; Fri, 10 Feb 2012 19:56: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 q1AJu2Dj091209; Fri, 10 Feb 2012 19:56:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJu28J091206; Fri, 10 Feb 2012 19:56:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101956.q1AJu28J091206@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231417 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:56:02 -0000 Author: tuexen Date: Fri Feb 10 19:56:02 2012 New Revision: 231417 URL: http://svn.freebsd.org/changeset/base/231417 Log: MFC r218639: Fix several bugs related to stream scheduling. Obtained from: Robin Seggelmann Modified: stable/8/sys/netinet/sctp_ss_functions.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:54:18 2012 (r231416) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:56:02 2012 (r231417) @@ -59,11 +59,9 @@ sctp_ss_default_init(struct sctp_tcb *st * stream queues to the wheel. */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_add(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); } return; } @@ -72,14 +70,19 @@ static void sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_remove(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -100,7 +103,9 @@ sctp_ss_default_add(struct sctp_tcb *stc if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -126,11 +131,16 @@ sctp_ss_default_remove(struct sctp_tcb * struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next != NULL || + strq->ss_params.rr.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, @@ -244,7 +254,8 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -271,48 +282,20 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st * Always interates the streams in ascending order and * only fills messages of the same stream in a packet. */ -static void -sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_stream_out *strq, - struct sctp_stream_queue_pending *sp, int holds_lock) +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) { - struct sctp_stream_out *strqt; - - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { - TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - while (strqt != NULL && strqt->stream_no < strq->stream_no) { - strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - } - if (strqt != NULL) { - TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); - } else { - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } - } - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } - return; + return asoc->last_out_stream; } -static struct sctp_stream_out * -sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_association *asoc) { struct sctp_stream_out *strq, *strqt; strqt = asoc->last_out_stream; - if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { - return (strqt); - } rrp_again: /* Find the next stream to use */ if (strqt == NULL) { @@ -339,53 +322,13 @@ rrp_again: TAILQ_FIRST(&strq->outqueue)->net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) { if (strq == asoc->last_out_stream) { - return (NULL); + strq = NULL; } else { strqt = strq; goto rrp_again; } } } - return (strq); -} - -static void -sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, - struct sctp_association *asoc) -{ - struct sctp_stream_out *strq, *strqt; - - strqt = asoc->last_out_stream; -rrp_pd_again: - /* Find the next stream to use */ - if (strqt == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } else { - strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } - } - - /* - * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destination requested - * by the caller. Note that if we turn out to be locked to a stream - * (assigning TSN's then we must stop, since we cannot look for - * another stream with data to send to that destination). In CMT's - * case, by skipping this check, we will send one data packet - * towards the requested net. - */ - if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && - (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { - if (strq == asoc->last_out_stream) { - strq = NULL; - } else { - strqt = strq; - goto rrp_pd_again; - } - } asoc->last_out_stream = strq; return; } @@ -399,14 +342,23 @@ static void sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) - stcb->asoc.strmout[i].ss_params.prio.priority = 0; - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.prio.priority = 0; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.prio.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -434,7 +386,9 @@ sctp_ss_prio_add(struct sctp_tcb *stcb, if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next == NULL) && (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); @@ -461,11 +415,16 @@ sctp_ss_prio_remove(struct sctp_tcb *stc struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next != NULL || + strq->ss_params.prio.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.prio.next_spoke); @@ -477,7 +436,7 @@ sctp_ss_prio_remove(struct sctp_tcb *stc asoc->last_out_stream = NULL; } } - TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; } @@ -502,7 +461,7 @@ prio_again: strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); if (strqn != NULL && strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { - strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + strq = strqn; } else { strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); } @@ -565,15 +524,22 @@ static void sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) { - stcb->asoc.strmout[i].ss_params.fb.rounds = -1; - } - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.fb.rounds = -1; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.fb.next_spoke); + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -599,11 +565,12 @@ sctp_ss_fb_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (!TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.fb.rounds < 0) + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next == NULL) && + (strq->ss_params.fb.next_spoke.tqe_prev == NULL)) { + if (strq->ss_params.fb.rounds < 0) strq->ss_params.fb.rounds = TAILQ_FIRST(&strq->outqueue)->length; - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -616,11 +583,16 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next != NULL || + strq->ss_params.fb.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.fb.next_spoke); @@ -632,7 +604,6 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, asoc->last_out_stream = NULL; } } - strq->ss_params.fb.rounds = -1; TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; @@ -649,20 +620,19 @@ sctp_ss_fb_select(struct sctp_tcb *stcb, { struct sctp_stream_out *strq = NULL, *strqt; - if (TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { + if (asoc->last_out_stream == NULL || + TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); } else { - if (asoc->last_out_stream != NULL) { - strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } + strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); } do { - if ((strqt != NULL) && TAILQ_FIRST(&strqt->outqueue) && - TAILQ_FIRST(&strqt->outqueue)->net != NULL && - ((net == NULL || TAILQ_FIRST(&strqt->outqueue)->net == net) || - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0))) { + if ((strqt != NULL) && + ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0) || + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0 && + (net == NULL || (TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net == NULL) || + (net != NULL && TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net != NULL && + TAILQ_FIRST(&strqt->outqueue)->net == net))))) { if ((strqt->ss_params.fb.rounds >= 0) && (strq == NULL || strqt->ss_params.fb.rounds < strq->ss_params.fb.rounds)) { strq = strqt; @@ -748,9 +718,15 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb int clear_values, int holds_lock) { if (clear_values) { + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } while (!TAILQ_EMPTY(&asoc->ss_data.out_list)) { TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), ss_next); } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } } return; } @@ -880,7 +856,7 @@ struct sctp_ss_functions sctp_ss_functio .sctp_ss_init = sctp_ss_default_init, .sctp_ss_clear = sctp_ss_default_clear, .sctp_ss_init_stream = sctp_ss_default_init_stream, - .sctp_ss_add_to_stream = sctp_ss_rrp_add, + .sctp_ss_add_to_stream = sctp_ss_rr_add, .sctp_ss_is_empty = sctp_ss_default_is_empty, .sctp_ss_remove_from_stream = sctp_ss_default_remove, .sctp_ss_select_stream = sctp_ss_rrp_select, From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:57:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E19821065675; Fri, 10 Feb 2012 19:57:58 +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 B0D428FC16; Fri, 10 Feb 2012 19:57: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 q1AJvwFX091312; Fri, 10 Feb 2012 19:57:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJvwdp091310; Fri, 10 Feb 2012 19:57:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101957.q1AJvwdp091310@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231418 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:57:59 -0000 Author: tuexen Date: Fri Feb 10 19:57:58 2012 New Revision: 231418 URL: http://svn.freebsd.org/changeset/base/231418 Log: MFC r218641: Fix a bug reported by Jonathan Leighton in his web-sctp testing at the Univ-of-Del. Basically when a 1-to-1 socket did a socket/bind/send(data)/close. If the timing was right we would dereference a socket that is NULL. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:56:02 2012 (r231417) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:57:58 2012 (r231418) @@ -2867,24 +2867,31 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } #endif - soisconnected(stcb->sctp_socket); + if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { + soisconnected(stcb->sctp_socket); + } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); /* * since we did not send a HB make sure we don't double * things */ net->hb_responded = 1; + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { + /* + * We don't need to do the asconf thing, nor hb or + * autoclose if the socket is closed. + */ + goto closed_socket; + } + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + + if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, @@ -2908,6 +2915,7 @@ sctp_handle_cookie_ack(struct sctp_cooki #endif } } +closed_socket: /* Toss the cookie if I can */ sctp_toss_old_cookies(stcb, asoc); if (!TAILQ_EMPTY(&asoc->sent_queue)) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:00:30 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A821065676; Fri, 10 Feb 2012 20:00:30 +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 2CFB08FC08; Fri, 10 Feb 2012 20:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AK0Otk091490; Fri, 10 Feb 2012 20:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK0N0m091489; Fri, 10 Feb 2012 20:00:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102000.q1AK0N0m091489@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231420 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:00:30 -0000 Author: tuexen Date: Fri Feb 10 20:00:21 2012 New Revision: 231420 URL: http://svn.freebsd.org/changeset/base/231420 Log: MFC r218818: Bugfix: Get per vnet sysctl variables and statistics working. Modified: stable/8/sys/netinet/sctp_sysctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:58:04 2012 (r231419) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:00:21 2012 (r231420) @@ -566,7 +566,11 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) { int error; +#ifdef VIMAGE + error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#else error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#endif if (error == 0) { RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); @@ -828,301 +832,298 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, +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_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, +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); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_FRMAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); -/* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_SS_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); #if defined(SCTP_LOCAL_TRACE_BUF) -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); - - - #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, +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_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, +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); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); -#endif /* SCTP_DEBUG */ +#endif #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif + #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, CTLTYPE_STRUCT | CTLFLAG_RW, 0, 0, sysctl_stat_get, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); #else -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, &SCTP_BASE_STATS_SYSCTL, sctpstat, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:07:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0237106564A; Fri, 10 Feb 2012 20:07: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 B96468FC12; Fri, 10 Feb 2012 20:07: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 q1AK7152091750; Fri, 10 Feb 2012 20:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK71TA091746; Fri, 10 Feb 2012 20:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102007.q1AK71TA091746@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231421 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:07:01 -0000 Author: tuexen Date: Fri Feb 10 20:07:01 2012 New Revision: 231421 URL: http://svn.freebsd.org/changeset/base/231421 Log: MFC r219013: * Cleanup the code computing the retransmission timeout. * Fix an initialization bug for the scaled variance of the RTO. Modified: stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:07:01 2012 (r231421) @@ -245,7 +245,7 @@ struct sctp_nets { /* smoothed average things for RTT and RTO itself */ int lastsa; int lastsv; - int rtt; /* last measured rtt value in ms */ + uint64_t rtt; /* last measured rtt value in us */ unsigned int RTO; /* This is used for SHUTDOWN/SHUTDOWN-ACK/SEND or INIT timers */ @@ -254,6 +254,10 @@ struct sctp_nets { /* last time in seconds I sent to it */ struct timeval last_sent_time; + + /* JRS - struct used in HTCP algorithm */ + struct htcp htcp_ca; + int ref_count; /* Congestion stats per destination */ @@ -267,7 +271,6 @@ struct sctp_nets { uint32_t ecn_prev_cwnd; /* ECN prev cwnd at first ecn_echo seen in new * window */ uint32_t partial_bytes_acked; /* in CA tracks when to incr a MTU */ - uint32_t prev_rtt; /* tracking variables to avoid the aloc/free in sack processing */ unsigned int net_ack; unsigned int net_ack2; @@ -298,7 +301,6 @@ struct sctp_nets { uint32_t tos_flowlabel; struct timeval start_time; /* time when this net was created */ - struct timeval last_measured_rtt; uint32_t marked_retrans;/* number or DATA chunks marked for timer * based retransmissions */ uint32_t marked_fastretrans; @@ -348,8 +350,6 @@ struct sctp_nets { uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ uint8_t lan_type; - /* JRS - struct used in HTCP algorithm */ - struct htcp htcp_ca; uint32_t flowid; #ifdef INVARIANTS uint8_t flowidset; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:07:01 2012 (r231421) @@ -477,7 +477,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xraddr.cwnd = net->cwnd; xraddr.flight_size = net->flight_size; xraddr.mtu = net->mtu; - xraddr.rtt = net->rtt; + xraddr.rtt = net->rtt / 1000; xraddr.start_time.tv_sec = (uint32_t) net->start_time.tv_sec; xraddr.start_time.tv_usec = (uint32_t) net->start_time.tv_usec; SCTP_INP_RUNLOCK(inp); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:07:01 2012 (r231421) @@ -113,7 +113,7 @@ rto_logging(struct sctp_nets *net, int f memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.rto.net = (void *)net; - sctp_clog.x.rto.rtt = net->prev_rtt; + sctp_clog.x.rto.rtt = net->rtt / 1000; SCTP_CTR6(KTR_SCTP, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_EVENT_RTT, from, @@ -2475,9 +2475,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb * given an association and the starting time of the current RTT * period (in value1/value2) return RTO in number of msecs. */ - int calc_time = 0; - int o_calctime; - uint32_t new_rto = 0; + int32_t rtt; /* RTT in ms */ + uint32_t new_rto; int first_measure = 0; struct timeval now, then, *old; @@ -2497,95 +2496,58 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); - /* - * Record the real time of the last RTT for use in DC-CC. - */ - net->last_measured_rtt = now; - timevalsub(&net->last_measured_rtt, old); + timevalsub(&now, old); + /* store the current RTT in us */ + net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + + (uint64_t) now.tv_usec; + + /* computer rtt in ms */ + rtt = net->rtt / 1000; /* Do we need to determine the lan type? */ - if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && (net->lan_type == SCTP_LAN_UNKNOWN)) { - if ((net->last_measured_rtt.tv_sec) || - (net->last_measured_rtt.tv_usec > SCTP_LOCAL_LAN_RTT)) { + if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && + (net->lan_type == SCTP_LAN_UNKNOWN)) { + if (net->rtt > SCTP_LOCAL_LAN_RTT) { net->lan_type = SCTP_LAN_INTERNET; } else { net->lan_type = SCTP_LAN_LOCAL; } } - /* compute the RTT value */ - if ((u_long)now.tv_sec > (u_long)old->tv_sec) { - calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; - if ((u_long)now.tv_usec > (u_long)old->tv_usec) { - calc_time += (((u_long)now.tv_usec - - (u_long)old->tv_usec) / 1000); - } else if ((u_long)now.tv_usec < (u_long)old->tv_usec) { - /* Borrow 1,000ms from current calculation */ - calc_time -= 1000; - /* Add in the slop over */ - calc_time += ((int)now.tv_usec / 1000); - /* Add in the pre-second ms's */ - calc_time += (((int)1000000 - (int)old->tv_usec) / 1000); - } - } else if ((u_long)now.tv_sec == (u_long)old->tv_sec) { - if ((u_long)now.tv_usec > (u_long)old->tv_usec) { - calc_time = ((u_long)now.tv_usec - - (u_long)old->tv_usec) / 1000; - } else if ((u_long)now.tv_usec < (u_long)old->tv_usec) { - /* impossible .. garbage in nothing out */ - goto calc_rto; - } else if ((u_long)now.tv_usec == (u_long)old->tv_usec) { - /* - * We have to have 1 usec :-D this must be the - * loopback. - */ - calc_time = 1; - } else { - /* impossible .. garbage in nothing out */ - goto calc_rto; - } - } else { - /* Clock wrapped? */ - goto calc_rto; - } /***************************/ /* 2. update RTTVAR & SRTT */ /***************************/ - net->rtt = o_calctime = calc_time; - /* this is Van Jacobson's integer version */ + /*- + * Compute the scaled average lastsa and the + * scaled variance lastsv as described in van Jacobson + * Paper "Congestion Avoidance and Control", Annex A. + * + * (net->lastsa >> SCTP_RTT_SHIFT) is the srtt + * (net->lastsa >> SCTP_RTT_VAR_SHIFT) is the rttvar + */ if (net->RTO_measured) { - calc_time -= (net->lastsa >> SCTP_RTT_SHIFT); /* take away 1/8th when - * shift=3 */ + rtt -= (net->lastsa >> SCTP_RTT_SHIFT); + net->lastsa += rtt; + if (rtt < 0) { + rtt = -rtt; + } + rtt -= (net->lastsv >> SCTP_RTT_VAR_SHIFT); + net->lastsv += rtt; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RTTVAR_LOGGING_ENABLE) { rto_logging(net, SCTP_LOG_RTTVAR); } - net->prev_rtt = o_calctime; - net->lastsa += calc_time; /* add 7/8th into sa when - * shift=3 */ - if (calc_time < 0) { - calc_time = -calc_time; - } - calc_time -= (net->lastsv >> SCTP_RTT_VAR_SHIFT); /* take away 1/4 when - * VAR shift=2 */ - net->lastsv += calc_time; - if (net->lastsv == 0) { - net->lastsv = SCTP_CLOCK_GRANULARITY; - } } else { /* First RTO measurment */ net->RTO_measured = 1; - net->lastsa = calc_time << SCTP_RTT_SHIFT; /* Multiply by 8 when - * shift=3 */ - net->lastsv = calc_time; - if (net->lastsv == 0) { - net->lastsv = SCTP_CLOCK_GRANULARITY; - } first_measure = 1; - net->prev_rtt = o_calctime; + net->lastsa = rtt << SCTP_RTT_SHIFT; + net->lastsv = (rtt / 2) << SCTP_RTT_VAR_SHIFT; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RTTVAR_LOGGING_ENABLE) { rto_logging(net, SCTP_LOG_INITIAL_RTT); } } -calc_rto: + if (net->lastsv == 0) { + net->lastsv = SCTP_CLOCK_GRANULARITY; + } new_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if ((new_rto > SCTP_SAT_NETWORK_MIN) && (stcb->asoc.sat_network_lockout == 0)) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:09:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07BE7106566B; Fri, 10 Feb 2012 20:09:24 +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 E4F0E8FC08; Fri, 10 Feb 2012 20:09: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 q1AK9NtP091928; Fri, 10 Feb 2012 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK9NxY091924; Fri, 10 Feb 2012 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102009.q1AK9NxY091924@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231422 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:09:24 -0000 Author: tuexen Date: Fri Feb 10 20:09:23 2012 New Revision: 231422 URL: http://svn.freebsd.org/changeset/base/231422 Log: MFC r219014: * Fix several bugs where the scaled versions of srtt and rttvar where used incorrectly. * Use appropriate variable names for RTO instead of RTT. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:09:23 2012 (r231422) @@ -428,7 +428,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -518,8 +518,8 @@ sctp_cwnd_update_after_packet_dropped(st unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT for this calc */ - rtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + /* need real RTT in msd for this calc */ + rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1079,7 +1079,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -1146,7 +1146,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st static inline void measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) { - uint32_t srtt = net->lastsa >> 3; + uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; /* keep track of minimum RTT seen so far, minRTT is zero at first */ if (net->htcp_ca.minRTT > srtt || !net->htcp_ca.minRTT) @@ -1532,7 +1532,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:09:23 2012 (r231422) @@ -61,24 +61,24 @@ sctp_early_fr_timer(struct sctp_inpcb *i { struct sctp_tmit_chunk *chk, *pchk; struct timeval now, min_wait, tv; - unsigned int cur_rtt, cnt = 0, cnt_resend = 0; + unsigned int cur_rto, cnt = 0, cnt_resend = 0; /* an early FR is occuring. */ (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ if (net->lastsa == 0) { /* Hmm no rtt estimate yet? */ - cur_rtt = stcb->asoc.initial_rto >> 2; + cur_rto = stcb->asoc.initial_rto >> 2; } else { - cur_rtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; } - if (cur_rtt < SCTP_BASE_SYSCTL(sctp_early_fr_msec)) { - cur_rtt = SCTP_BASE_SYSCTL(sctp_early_fr_msec); + if (cur_rto < SCTP_BASE_SYSCTL(sctp_early_fr_msec)) { + cur_rto = SCTP_BASE_SYSCTL(sctp_early_fr_msec); } - cur_rtt *= 1000; - tv.tv_sec = cur_rtt / 1000000; - tv.tv_usec = cur_rtt % 1000000; + cur_rto *= 1000; + tv.tv_sec = cur_rto / 1000000; + tv.tv_usec = cur_rto % 1000000; min_wait = now; timevalsub(&min_wait, &tv); if (min_wait.tv_sec < 0 || min_wait.tv_usec < 0) { @@ -626,7 +626,7 @@ sctp_mark_all_for_resend(struct sctp_tcb struct sctp_tmit_chunk *chk, *nchk; struct sctp_nets *lnets; struct timeval now, min_wait, tv; - int cur_rtt; + int cur_rto; int cnt_abandoned; int audit_tf, num_mk, fir; unsigned int cnt_mk; @@ -644,10 +644,10 @@ sctp_mark_all_for_resend(struct sctp_tcb */ (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ - cur_rtt = (((net->lastsa >> 2) + net->lastsv) >> 1); - cur_rtt *= 1000; + cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; + cur_rto *= 1000; if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_EARLYFR_LOGGING_ENABLE | SCTP_FR_LOGGING_ENABLE)) { - sctp_log_fr(cur_rtt, + sctp_log_fr(cur_rto, stcb->asoc.peers_rwnd, window_probe, SCTP_FR_T3_MARK_TIME); @@ -657,8 +657,8 @@ sctp_mark_all_for_resend(struct sctp_tcb SCTP_FR_CWND_REPORT); sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); } - tv.tv_sec = cur_rtt / 1000000; - tv.tv_usec = cur_rtt % 1000000; + tv.tv_sec = cur_rto / 1000000; + tv.tv_usec = cur_rto % 1000000; min_wait = now; timevalsub(&min_wait, &tv); if (min_wait.tv_sec < 0 || min_wait.tv_usec < 0) { @@ -671,7 +671,7 @@ sctp_mark_all_for_resend(struct sctp_tcb min_wait.tv_sec = min_wait.tv_usec = 0; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_EARLYFR_LOGGING_ENABLE | SCTP_FR_LOGGING_ENABLE)) { - sctp_log_fr(cur_rtt, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(cur_rto, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); sctp_log_fr(0, min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); } /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:09:23 2012 (r231422) @@ -2398,7 +2398,7 @@ flags_out: paddri->spinfo_state = SCTP_INACTIVE; } paddri->spinfo_cwnd = net->cwnd; - paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; paddri->spinfo_rto = net->RTO; paddri->spinfo_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); @@ -2475,7 +2475,7 @@ flags_out: sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; } sstat->sstat_primary.spinfo_cwnd = net->cwnd; - sstat->sstat_primary.spinfo_srtt = net->lastsa; + sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; sstat->sstat_primary.spinfo_rto = net->RTO; sstat->sstat_primary.spinfo_mtu = net->mtu; sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:17:29 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AC531065670; Fri, 10 Feb 2012 20:17:29 +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 23B7B8FC13; Fri, 10 Feb 2012 20:17: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 q1AKHT4L092240; Fri, 10 Feb 2012 20:17:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKHSch092225; Fri, 10 Feb 2012 20:17:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102017.q1AKHSch092225@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231423 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:17:29 -0000 Author: tuexen Date: Fri Feb 10 20:17:28 2012 New Revision: 231423 URL: http://svn.freebsd.org/changeset/base/231423 Log: MFC r219057: Improvements to CC modules: 1) Add four new points that allow you to get more information to cc algo's 2) Fix the case where user changes module on a existing TCB, in such a case, the initialization module needs to be called on all nets. 3) Move htcp_cc structure to a union that other modules can use. 4) Add 5th point for get/set socket options for cc_module specific options From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:17:28 2012 (r231423) @@ -161,9 +161,10 @@ struct sctp_paramhdr { /* JRS - Pluggable Congestion Control Socket option */ #define SCTP_PLUGGABLE_CC 0x00001202 /* RS - Pluggable Stream Scheduling Socket option */ -#define SCTP_PLUGGABLE_SS 0x00001203 -#define SCTP_SS_VALUE 0x00001204 - +#define SCTP_PLUGGABLE_SS 0x00001203 +#define SCTP_SS_VALUE 0x00001204 +#define SCTP_CC_OPTION 0x00001205 /* Options for CC + * modules */ /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 #define SCTP_GET_STAT_LOG 0x00001103 Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1135,10 +1135,10 @@ htcp_reset(struct htcp *ca) static uint32_t htcp_cwnd_undo(struct sctp_tcb *stcb, struct sctp_nets *net) { - net->htcp_ca.last_cong = net->htcp_ca.undo_last_cong; - net->htcp_ca.maxRTT = net->htcp_ca.undo_maxRTT; - net->htcp_ca.old_maxB = net->htcp_ca.undo_old_maxB; - return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->htcp_ca.beta) * net->mtu); + 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); } #endif @@ -1149,15 +1149,15 @@ measure_rtt(struct sctp_tcb *stcb, struc uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; /* keep track of minimum RTT seen so far, minRTT is zero at first */ - if (net->htcp_ca.minRTT > srtt || !net->htcp_ca.minRTT) - net->htcp_ca.minRTT = srtt; + if (net->cc_mod.htcp_ca.minRTT > srtt || !net->cc_mod.htcp_ca.minRTT) + net->cc_mod.htcp_ca.minRTT = srtt; /* max RTT */ - if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->htcp_ca) > 3) { - if (net->htcp_ca.maxRTT < net->htcp_ca.minRTT) - net->htcp_ca.maxRTT = net->htcp_ca.minRTT; - if (net->htcp_ca.maxRTT < srtt && srtt <= net->htcp_ca.maxRTT + MSEC_TO_TICKS(20)) - net->htcp_ca.maxRTT = srtt; + if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->cc_mod.htcp_ca) > 3) { + if (net->cc_mod.htcp_ca.maxRTT < net->cc_mod.htcp_ca.minRTT) + net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.minRTT; + if (net->cc_mod.htcp_ca.maxRTT < srtt && srtt <= net->cc_mod.htcp_ca.maxRTT + MSEC_TO_TICKS(20)) + net->cc_mod.htcp_ca.maxRTT = srtt; } } @@ -1167,7 +1167,7 @@ measure_achieved_throughput(struct sctp_ uint32_t now = sctp_get_tick_count(); if (net->fast_retran_ip == 0) - net->htcp_ca.bytes_acked = net->net_ack; + net->cc_mod.htcp_ca.bytes_acked = net->net_ack; if (!use_bandwidth_switch) return; @@ -1175,29 +1175,29 @@ measure_achieved_throughput(struct sctp_ /* achieved throughput calculations */ /* JRS - not 100% sure of this statement */ if (net->fast_retran_ip == 1) { - net->htcp_ca.bytecount = 0; - net->htcp_ca.lasttime = now; + net->cc_mod.htcp_ca.bytecount = 0; + net->cc_mod.htcp_ca.lasttime = now; return; } - net->htcp_ca.bytecount += net->net_ack; + net->cc_mod.htcp_ca.bytecount += net->net_ack; - if (net->htcp_ca.bytecount >= net->cwnd - ((net->htcp_ca.alpha >> 7 ? : 1) * net->mtu) - && now - net->htcp_ca.lasttime >= net->htcp_ca.minRTT - && net->htcp_ca.minRTT > 0) { - uint32_t cur_Bi = net->htcp_ca.bytecount / net->mtu * hz / (now - net->htcp_ca.lasttime); + if (net->cc_mod.htcp_ca.bytecount >= net->cwnd - ((net->cc_mod.htcp_ca.alpha >> 7 ? : 1) * net->mtu) + && now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT + && net->cc_mod.htcp_ca.minRTT > 0) { + uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lasttime); - if (htcp_ccount(&net->htcp_ca) <= 3) { + if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { /* just after backoff */ - net->htcp_ca.minB = net->htcp_ca.maxB = net->htcp_ca.Bi = cur_Bi; + net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi = cur_Bi; } else { - net->htcp_ca.Bi = (3 * net->htcp_ca.Bi + cur_Bi) / 4; - if (net->htcp_ca.Bi > net->htcp_ca.maxB) - net->htcp_ca.maxB = net->htcp_ca.Bi; - if (net->htcp_ca.minB > net->htcp_ca.maxB) - net->htcp_ca.minB = net->htcp_ca.maxB; + net->cc_mod.htcp_ca.Bi = (3 * net->cc_mod.htcp_ca.Bi + cur_Bi) / 4; + if (net->cc_mod.htcp_ca.Bi > net->cc_mod.htcp_ca.maxB) + net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi; + if (net->cc_mod.htcp_ca.minB > net->cc_mod.htcp_ca.maxB) + net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB; } - net->htcp_ca.bytecount = 0; - net->htcp_ca.lasttime = now; + net->cc_mod.htcp_ca.bytecount = 0; + net->cc_mod.htcp_ca.lasttime = now; } } @@ -1264,25 +1264,25 @@ htcp_alpha_update(struct htcp *ca) static void htcp_param_update(struct sctp_tcb *stcb, struct sctp_nets *net) { - uint32_t minRTT = net->htcp_ca.minRTT; - uint32_t maxRTT = net->htcp_ca.maxRTT; + uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; + uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; - htcp_beta_update(&net->htcp_ca, minRTT, maxRTT); - htcp_alpha_update(&net->htcp_ca); + htcp_beta_update(&net->cc_mod.htcp_ca, minRTT, maxRTT); + htcp_alpha_update(&net->cc_mod.htcp_ca); /* * add slowly fading memory for maxRTT to accommodate routing * changes etc */ if (minRTT > 0 && maxRTT > minRTT) - net->htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; + net->cc_mod.htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; } static uint32_t htcp_recalc_ssthresh(struct sctp_tcb *stcb, struct sctp_nets *net) { htcp_param_update(stcb, net); - return max(((net->cwnd / net->mtu * net->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 @@ -1323,14 +1323,14 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s * net->cwnd += alpha / net->cwnd */ /* What is snd_cwnd_cnt?? */ - if (((net->partial_bytes_acked / net->mtu * net->htcp_ca.alpha) >> 7) * net->mtu >= net->cwnd) { + if (((net->partial_bytes_acked / net->mtu * net->cc_mod.htcp_ca.alpha) >> 7) * net->mtu >= net->cwnd) { /*- * Does SCTP have a cwnd clamp? * if (net->snd_cwnd < net->snd_cwnd_clamp) - Nope (RRS). */ net->cwnd += net->mtu; net->partial_bytes_acked = 0; - htcp_alpha_update(&net->htcp_ca); + htcp_alpha_update(&net->cc_mod.htcp_ca); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -1343,7 +1343,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s } } - net->htcp_ca.bytes_acked = net->mtu; + net->cc_mod.htcp_ca.bytes_acked = net->mtu; } } @@ -1360,11 +1360,11 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str static void htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net) { - memset(&net->htcp_ca, 0, sizeof(struct htcp)); - net->htcp_ca.alpha = ALPHA_BASE; - net->htcp_ca.beta = BETA_MIN; - net->htcp_ca.bytes_acked = net->mtu; - net->htcp_ca.last_cong = sctp_get_tick_count(); + memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); + net->cc_mod.htcp_ca.alpha = ALPHA_BASE; + net->cc_mod.htcp_ca.beta = BETA_MIN; + net->cc_mod.htcp_ca.bytes_acked = net->mtu; + net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); } static void @@ -1568,7 +1568,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc int old_cwnd = net->cwnd; /* JRS - reset as if state were changed */ - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(stcb, net); net->cwnd = net->ssthresh; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -1622,7 +1622,7 @@ sctp_htcp_cwnd_update_after_timeout(stru int old_cwnd = net->cwnd; /* JRS - reset as if the state were being changed to timeout */ - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(stcb, net); net->cwnd = net->mtu; net->partial_bytes_acked = 0; @@ -1640,7 +1640,7 @@ sctp_htcp_cwnd_update_after_fr_timer(str old_cwnd = net->cwnd; sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - net->htcp_ca.last_cong = sctp_get_tick_count(); + net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); /* * make a small adjustment to cwnd and force to CA. */ @@ -1665,7 +1665,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str /* JRS - reset hctp as if state changed */ if (in_window == 0) { - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); SCTP_STAT_INCR(sctps_ecnereducedcwnd); net->ssthresh = htcp_recalc_ssthresh(stcb, net); if (net->ssthresh < net->mtu) { Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:17:28 2012 (r231423) @@ -55,6 +55,8 @@ SDT_PROBE_DECLARE(sctp, cwnd, net, bl); SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); /* update at a Packet-Drop -- decrease */ SDT_PROBE_DECLARE(sctp, cwnd, net, pd); +/* Rttvar probe declaration */ +SDT_PROBE_DECLARE(sctp, cwnd, net, rttvar); /* One to track an associations rwnd */ SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:17:28 2012 (r231423) @@ -71,6 +71,21 @@ SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, /* The new value of the cwnd */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 4, "int"); + +/* ACK-INCREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, rttvar, rttvar); +/* The Vtag << 32 | localport << 16 | remoteport */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 0, "uint64_t"); +/* obw | nbw */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 1, "uint64_t"); +/* newrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 2, "uint64_t"); +/* bwrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 3, "uint64_t"); +/* (cwnd << 32) | point << 16 | retval(0/1) */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 4, "uint64_t"); + + /* FastRetransmit-DECREASE */ SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); /* The Vtag for this end */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:17:28 2012 (r231423) @@ -2939,6 +2939,10 @@ sctp_process_segment_range(struct sctp_t tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } sctp_total_flight_decrease(stcb, tp1); tp1->whoTo->net_ack += tp1->send_size; @@ -3442,6 +3446,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->whoTo) { tp1->whoTo->net_ack++; sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { sctp_log_rwnd(SCTP_INCREASE_PEER_RWND, @@ -3737,6 +3745,10 @@ sctp_window_probe_recovery(struct sctp_t return; } /* First setup this by shrinking flight */ + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ @@ -3810,6 +3822,9 @@ sctp_express_handle_sack(struct sctp_tcb */ net->new_pseudo_cumack = 0; net->will_exit_fast_recovery = 0; + if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { + (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); + } } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { uint32_t send_s; @@ -3883,6 +3898,10 @@ sctp_express_handle_sack(struct sctp_tcb tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } /* sa_ignore NO_NULL_CHK */ sctp_total_flight_decrease(stcb, tp1); } @@ -4447,6 +4466,9 @@ sctp_handle_sack(struct mbuf *m, int off */ net->new_pseudo_cumack = 0; net->will_exit_fast_recovery = 0; + if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { + (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); + } } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { @@ -4483,6 +4505,10 @@ sctp_handle_sack(struct mbuf *m, int off } sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } } tp1->whoTo->net_ack += tp1->send_size; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:17:28 2012 (r231423) @@ -6476,6 +6476,9 @@ all_done: asoc->peers_rwnd = 0; } } + if (asoc->cc_functions.sctp_cwnd_update_packet_transmitted) { + (*asoc->cc_functions.sctp_cwnd_update_packet_transmitted) (stcb, net); + } } static void @@ -7341,6 +7344,10 @@ nothing_to_send: } continue; } + if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && + (net->flight_size == 0)) { + (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); + } if ((asoc->sctp_cmt_on_off == 0) && (asoc->primary_destination != net) && (net->ref_count < 2)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:17:28 2012 (r231423) @@ -3953,7 +3953,8 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.smallest_mtu = net->mtu; } /* JRS - Use the congestion control given in the CC module */ - stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net); + if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) + (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); /* * CMT: CUC algo - set find_pseudo_cumack to TRUE (1) at beginning Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:17:28 2012 (r231423) @@ -219,7 +219,6 @@ struct htcp { uint32_t lasttime; }; - struct sctp_nets { TAILQ_ENTRY(sctp_nets) sctp_next; /* next link */ @@ -254,10 +253,9 @@ struct sctp_nets { /* last time in seconds I sent to it */ struct timeval last_sent_time; - - /* JRS - struct used in HTCP algorithm */ - struct htcp htcp_ca; - + union cc_control_data { + struct htcp htcp_ca; /* JRS - struct used in HTCP algorithm */ + } cc_mod; int ref_count; /* Congestion stats per destination */ @@ -648,6 +646,15 @@ struct sctp_cc_functions { struct sctp_nets *net, int burst_limit); void (*sctp_cwnd_update_after_fr_timer) (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net); + void (*sctp_cwnd_update_packet_transmitted) (struct sctp_tcb *stcb, + struct sctp_nets *net); + void (*sctp_cwnd_update_tsn_acknowledged) (struct sctp_nets *net, + struct sctp_tmit_chunk *); + void (*sctp_cwnd_new_transmission_begins) (struct sctp_tcb *stcb, + struct sctp_nets *net); + void (*sctp_cwnd_prepare_net_for_sack) (struct sctp_tcb *stcb, + struct sctp_nets *net); + int (*sctp_cwnd_socket_option) (struct sctp_tcb *stcb, int set, struct sctp_cc_option *); }; /* @@ -1166,6 +1173,7 @@ struct sctp_association { uint8_t sctp_nr_sack_on_off; /* JRS 5/21/07 - CMT PF variable */ uint8_t sctp_cmt_pf; + uint8_t use_precise_time; /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:17:28 2012 (r231423) @@ -115,6 +115,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -633,6 +636,9 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_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); RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); @@ -1100,6 +1106,18 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_bw, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_BW_DESC); + +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_rtt, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_rtt), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_RTT_DESC); + +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_eqret, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_EQRET_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/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:17:28 2012 (r231423) @@ -104,6 +104,11 @@ struct sctp_sysctl { uint32_t sctp_mobility_base; uint32_t sctp_mobility_fasthandoff; uint32_t sctp_inits_include_nat_friendly; +#ifdef SCTP_HAS_RTTCC + uint32_t sctp_rttvar_bw; + uint32_t sctp_rttvar_rtt; + uint32_t sctp_rttvar_eqret; +#endif #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif @@ -514,6 +519,25 @@ struct sctp_sysctl { #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 +#ifdef SCTP_HAS_RTTCC + +/* rttvar smooth avg for bw calc */ +#define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smothing on rtt calc" +#define SCTPCTL_RTTVAR_BW_MIN 0 +#define SCTPCTL_RTTVAR_BW_MAX 32 +#define SCTPCTL_RTTVAR_BW_DEFAULT 4 + +/* rttvar smooth avg for bw calc */ +#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount for rtt smothing on rtt calc" +#define SCTPCTL_RTTVAR_RTT_MIN 0 +#define SCTPCTL_RTTVAR_RTT_MAX 32 +#define SCTPCTL_RTTVAR_RTT_DEFAULT 5 + +#define SCTPCTL_RTTVAR_EQRET_DESC "When rtt and bw are unchanged return what" +#define SCTPCTL_RTTVAR_EQRET_MIN 0 +#define SCTPCTL_RTTVAR_EQRET_MAX 1 +#define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 +#endif #if defined(SCTP_DEBUG) /* debug: Configure debug output */ Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1015,7 +1015,10 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, /* CMT FR loss recovery ended with the T3 */ net->fast_retran_loss_recovery = 0; - + if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && + (net->flight_size == 0)) { + (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); + } /* * setup the sat loss recovery that prevents satellite cwnd advance. */ Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 20:17:28 2012 (r231423) @@ -533,6 +533,11 @@ struct sctp_assoc_value { uint32_t assoc_value; }; +struct sctp_cc_option { + int option; + struct sctp_assoc_value aid_value; +}; + struct sctp_stream_value { sctp_assoc_t assoc_id; uint16_t stream_id; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1758,6 +1758,25 @@ flags_out: *optsize = sizeof(*av); } break; + case SCTP_CC_OPTION: + { + struct sctp_cc_option *cc_opt; + + SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, *optsize); + SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id); + if (stcb == NULL) { + error = EINVAL; + } else { + if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) { + error = ENOTSUP; + } else { + error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 0, + cc_opt); + *optsize = sizeof(*cc_opt); + } + SCTP_TCB_UNLOCK(stcb); + } + } /* RS - Get socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: { @@ -2926,6 +2945,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_PLUGGABLE_CC: { struct sctp_assoc_value *av; + struct sctp_nets *net; SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); @@ -2936,6 +2956,11 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_HTCP: stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; stcb->asoc.congestion_control_module = av->assoc_value; + if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net); + } + } break; default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -2959,6 +2984,24 @@ sctp_setopt(struct socket *so, int optna } } } + case SCTP_CC_OPTION: + { + struct sctp_cc_option *cc_opt; + + SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, optsize); + SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id); + if (stcb == NULL) { + error = EINVAL; + } else { + if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) { + error = ENOTSUP; + } else { + error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 1, + cc_opt); + } + SCTP_TCB_UNLOCK(stcb); + } + } break; /* RS - Set socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:17:28 2012 (r231423) @@ -2495,7 +2495,11 @@ sctp_calculate_rto(struct sctp_tcb *stcb /* 1. calculate new RTT */ /************************/ /* get the current time */ - (void)SCTP_GETTIME_TIMEVAL(&now); + if (stcb->asoc.use_precise_time) { + (void)SCTP_GETPTIME_TIMEVAL(&now); + } else { + (void)SCTP_GETTIME_TIMEVAL(&now); + } timevalsub(&now, old); /* store the current RTT in us */ net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:19:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68F271065675; Fri, 10 Feb 2012 20:19: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 51AFA8FC15; Fri, 10 Feb 2012 20:19: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 q1AKJd0v092354; Fri, 10 Feb 2012 20:19:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKJdMJ092347; Fri, 10 Feb 2012 20:19:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102019.q1AKJdMJ092347@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231424 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:19:39 -0000 Author: tuexen Date: Fri Feb 10 20:19:38 2012 New Revision: 231424 URL: http://svn.freebsd.org/changeset/base/231424 Log: MFC r219120: Adds a new Congestion Control that helps reduce the RTT that a flow will build up in buffers in transit. It is a slight modification to RFC2581 but is more friendly i.e. less aggressive. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:19:38 2012 (r231424) @@ -258,6 +258,11 @@ struct sctp_paramhdr { #define SCTP_CC_HSTCP 0x00000001 /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RTCC Congestion Control - RFC2581 plus */ +#define SCTP_CC_RTCC 0x00000003 + +#define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 +#define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:19:38 2012 (r231424) @@ -185,10 +185,203 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } + +/* RTCC Algoritm to limit growth of cwnd, return + * true if you want to NOT allow cwnd growth + */ +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; + + /*- + * Here we need to see if we want + * to limit cwnd growth due to increase + * in overall rtt but no increase in bw. + * We use the following table to figure + * out what we should do. When we return + * 0, cc update goes on as planned. If we + * return 1, then no cc update happens and cwnd + * stays where it is at. + * ---------------------------------- + * BW | RTT | Action + * ********************************* + * INC | INC | return 0 + * ---------------------------------- + * INC | SAME | return 0 + * ---------------------------------- + * INC | DECR | return 0 + * ---------------------------------- + * SAME | INC | return 1 + * ---------------------------------- + * SAME | SAME | return 1 + * ---------------------------------- + * SAME | DECR | return 0 + * ---------------------------------- + * DECR | INC | return 0 or 1 based on if we caused. + * ---------------------------------- + * DECR | SAME | return 0 + * ---------------------------------- + * DECR | DECR | return 0 + * ---------------------------------- + * + * We are a bit fuzz on what an increase or + * decrease is. For BW it is the same if + * it did not change within 1/64th. For + * RTT it stayed the same if it did not + * change within 1/32nd + */ + rtt = stcb->asoc.my_vtag; + vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + rtt = net->rtt; + bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); + if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { + /* + * BW increased, so update and return 0, since all actions + * in our table say to do the normal CC update + */ + /* PROBE POINT 0 */ + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); + if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { + /* Bandwidth decreased. */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { + /* We caused it maybe.. back off */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; + if (net->cc_mod.rtcc.ret_from_eq) { + /* + * Switch over to CA if we are less + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + /* Someone else - fight for more? */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* The bw decreased but rtt stayed the same */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (0); + } + /* + * If we reach here then we are in a situation where the bw stayed + * the same. + */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (1); + } + if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any but save the + * latest cwnd. + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + static void -sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, +sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -327,6 +520,48 @@ sctp_cwnd_update_after_sack(struct sctp_ goto skip_cwnd_update; } /* + * Did any measurements go on for this network? + */ + if (use_rtcc && (net->cc_mod.rtcc.tls_needs_set > 0)) { + uint64_t nbw; + + /* + * At this point our bw_bytes has been updated by + * incoming sack information. + * + * But our bw may not yet be set. + * + */ + if ((net->cc_mod.rtcc.new_tot_time / 1000) > 0) { + nbw = net->cc_mod.rtcc.bw_bytes / (net->cc_mod.rtcc.new_tot_time / 1000); + } else { + nbw = net->cc_mod.rtcc.bw_bytes; + } + if (net->cc_mod.rtcc.lbw) { + if (cc_bw_limit(stcb, net, nbw)) { + /* Hold here, no update */ + goto skip_cwnd_update; + } + } else { + uint64_t vtag, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((0xa << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + nbw, + 0, + net->rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + } + } + /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ @@ -481,31 +716,67 @@ sctp_cwnd_update_after_timeout(struct sc } } - static void -sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, - int in_window, int num_pkt_lost) +sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost, int use_rtcc) { int old_cwnd = net->cwnd; - if (in_window == 0) { - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; + if ((use_rtcc) && (net->lan_type == SCTP_LAN_LOCAL) && (net->cc_mod.rtcc.use_dccc_ecn)) { + /* Data center Congestion Control */ + if (in_window == 0) { + /* + * Go to CA with the cwnd at the point we sent the + * TSN that was marked with a CE. + */ + if (net->ecn_prev_cwnd < net->cwnd) { + /* Restore to prev cwnd */ + net->cwnd = net->ecn_prev_cwnd - (net->mtu * num_pkt_lost); + } else { + /* Just cut in 1/2 */ + net->cwnd /= 2; + } + /* Drop to CA */ + net->ssthresh = net->cwnd - (num_pkt_lost * net->mtu); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } + } else { + /* + * Further tuning down required over the drastic + * orginal cut + */ + net->ssthresh -= (net->mtu * num_pkt_lost); + net->cwnd -= (net->mtu * num_pkt_lost); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } - net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + } else { + if (in_window == 0) { + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* + * here back off the timer as well, to slow + * us down + */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } + } static void @@ -636,14 +907,16 @@ sctp_cwnd_update_after_output(struct sct if (net->ssthresh < net->cwnd) net->ssthresh = net->cwnd; - net->cwnd = (net->flight_size + (burst_limit * net->mtu)); - SDT_PROBE(sctp, cwnd, net, bl, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + if (burst_limit) { + net->cwnd = (net->flight_size + (burst_limit * net->mtu)); + SDT_PROBE(sctp, cwnd, net, bl, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + } } } @@ -673,6 +946,212 @@ sctp_cwnd_update_after_fr_timer(struct s } } +static void +sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 0); +} + +static void +sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 0); +} + +/* Here starts the RTCCVAR type CC invented by RRS which + * is a slight mod to RFC2581. We reuse a common routine or + * two since these algoritms are so close and need to + * remain the same. + */ +static void +sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 1); +} + + +static +void +sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, + struct sctp_tmit_chunk *tp1) +{ + net->cc_mod.rtcc.bw_bytes += tp1->send_size; +} + +static void +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set > 0) { + /* We had a bw measurment going on */ + struct timeval ltls; + + SCTP_GETPTIME_TIMEVAL(<ls); + timevalsub(<ls, &net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.new_tot_time = (ltls.tv_sec * 1000000) + ltls.tv_usec; + } +} + +static void +sctp_cwnd_new_rtcc_transmission_begins(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + if (net->cc_mod.rtcc.lbw) { + /* Clear the old bw.. we went to 0 in-flight */ + vtag = (net->rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + /* Probe point 8 */ + probepoint |= ((8 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | 0), + net->cc_mod.rtcc.lbw_rtt, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.ret_from_eq) { + /* less aggressive one - reset cwnd too */ + uint32_t cwnd_in_mtu, cwnd; + + cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); + if (cwnd_in_mtu == 0) { + /* + * Using 0 means that the value of RFC 4960 + * is used. + */ + cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit + * and the initial congestion window. + */ + if ((stcb->asoc.max_burst > 0) && (cwnd_in_mtu > stcb->asoc.max_burst)) + cwnd_in_mtu = stcb->asoc.max_burst; + cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } + if (net->cwnd > cwnd) { + /* + * Only set if we are not a timeout (i.e. + * down to 1 mtu) + */ + net->cwnd = cwnd; + } + } + } +} + +static void +sctp_set_rtcc_initial_cc_param(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + sctp_set_initial_cc_param(stcb, net); + stcb->asoc.use_precise_time = 1; + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((9 << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + 0, + 0, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); +} + +static int +sctp_cwnd_rtcc_socket_option(struct sctp_tcb *stcb, int setorget, + struct sctp_cc_option *cc_opt) +{ + struct sctp_nets *net; + + if (setorget == 1) { + /* a set */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.ret_from_eq = cc_opt->aid_value.assoc_value; + } + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; + } + } else { + return (EINVAL); + } + } else { + /* a get */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.ret_from_eq; + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else { + return (EINVAL); + } + } + return (0); +} + +static void +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set == 0) { + SCTP_GETPTIME_TIMEVAL(&net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.tls_needs_set = 2; + } +} + +static void +sctp_cwnd_update_rtcc_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a one argument at the last enables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); +} + + +/* Here starts Sally Floyds HS-TCP */ + struct sctp_hs_raise_drop { int32_t cwnd; int32_t increase; @@ -1710,5 +2189,20 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, + .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, + .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, + .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, + .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option } }; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:19:38 2012 (r231424) @@ -965,10 +965,9 @@ __FBSDID("$FreeBSD$"); * local lan type rtt's */ /* - * We allow 500us for the rtt and another 500us for the cookie processing - * since we measure this on the first rtt. + * We allow 900us for the rtt. */ -#define SCTP_LOCAL_LAN_RTT 1100 +#define SCTP_LOCAL_LAN_RTT 900 #define SCTP_LAN_UNKNOWN 0 #define SCTP_LAN_LOCAL 1 #define SCTP_LAN_INTERNET 2 Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:19:38 2012 (r231424) @@ -219,6 +219,21 @@ struct htcp { uint32_t lasttime; }; +struct rtcc_cc { + struct timeval tls; /* The time we started the sending */ + uint64_t lbw; /* Our last estimated bw */ + uint64_t lbw_rtt; /* RTT at bw estimate */ + uint64_t bw_bytes; /* The total bytes since this sending began */ + uint64_t bw_tot_time; /* The total time since sending began */ + uint64_t new_tot_time; /* temp holding the new value */ + uint32_t cwnd_at_bw_set; + uint8_t ret_from_eq; + uint8_t use_dccc_ecn; + uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 + * means set at send 2 not */ +}; + + struct sctp_nets { TAILQ_ENTRY(sctp_nets) sctp_next; /* next link */ @@ -255,6 +270,7 @@ struct sctp_nets { struct timeval last_sent_time; union cc_control_data { struct htcp htcp_ca; /* JRS - struct used in HTCP algorithm */ + struct rtcc_cc rtcc; /* rtcc module cc stuff */ } cc_mod; int ref_count; Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:19:38 2012 (r231424) @@ -104,11 +104,9 @@ struct sctp_sysctl { uint32_t sctp_mobility_base; uint32_t sctp_mobility_fasthandoff; uint32_t sctp_inits_include_nat_friendly; -#ifdef SCTP_HAS_RTTCC uint32_t sctp_rttvar_bw; uint32_t sctp_rttvar_rtt; uint32_t sctp_rttvar_eqret; -#endif #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif @@ -519,7 +517,6 @@ struct sctp_sysctl { #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 -#ifdef SCTP_HAS_RTTCC /* rttvar smooth avg for bw calc */ #define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smothing on rtt calc" @@ -537,7 +534,6 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_EQRET_MIN 0 #define SCTPCTL_RTTVAR_EQRET_MAX 1 #define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 -#endif #if defined(SCTP_DEBUG) /* debug: Configure debug output */ Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:19:38 2012 (r231424) @@ -1777,6 +1777,7 @@ flags_out: SCTP_TCB_UNLOCK(stcb); } } + break; /* RS - Get socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: { @@ -2954,6 +2955,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; stcb->asoc.congestion_control_module = av->assoc_value; if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) { @@ -2973,6 +2975,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; SCTP_INP_WUNLOCK(inp); @@ -2984,6 +2987,7 @@ sctp_setopt(struct socket *so, int optna } } } + break; case SCTP_CC_OPTION: { struct sctp_cc_option *cc_opt; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:22:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2631065673; Fri, 10 Feb 2012 20:22:46 +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 164F68FC14; Fri, 10 Feb 2012 20:22: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 q1AKMkFB092521; Fri, 10 Feb 2012 20:22:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKMjcs092508; Fri, 10 Feb 2012 20:22:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102022.q1AKMjcs092508@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231425 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:22:46 -0000 Author: tuexen Date: Fri Feb 10 20:22:45 2012 New Revision: 231425 URL: http://svn.freebsd.org/changeset/base/231425 Log: MFC r219397: Tunes and fixes the new DC-CC to seem to hit the right mix. Still may need some tweaks but it appears to almost not give away too much to an RFC2581 flow, but can really minimize the amount of buffers used in the net. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:22:45 2012 (r231425) @@ -263,6 +263,7 @@ struct sctp_paramhdr { #define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 #define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 +#define SCTP_CC_OPT_STEADY_STEP 0x00002002 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:22:45 2012 (r231425) @@ -185,6 +185,328 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } +/* Defines for instantaneous bw decisions */ +#define SCTP_INST_LOOSING 1 /* Loosing to other flows */ +#define SCTP_INST_NEUTRAL 2 /* Neutral, no indication */ +#define SCTP_INST_GAINING 3 /* Gaining, step down possible */ + + +static int +cc_bw_same(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t rtt_offset, uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((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++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + return (1); + } + if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here to lock this in as a good step + * down. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.last_step_state == 5) && + (net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step)) { + /* Step down worked */ + net->cc_mod.rtcc.step_cnt = 0; + return (1); + } else { + net->cc_mod.rtcc.last_step_state = 6; + net->cc_mod.rtcc.step_cnt = 0; + } + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((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++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + return (1); + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + +static int +cc_bw_decrease(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* Bandwidth decreased. */ + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if ((net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) && + (inst_ind != SCTP_INST_LOOSING)) { + /* We caused it maybe.. back off? */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((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 + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((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; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + /* + * Did we voluntarily give up some? if so take one + * back please + */ + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 2; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } else if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* bw & rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 3; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } + /* The bw decreased but rtt stayed the same */ + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 4; + net->cc_mod.rtcc.step_cnt = 0; + } +out_decision: + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) { + return (1); + } else { + return (0); + } +} + +static int +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* + * BW increased, so update and return 0, since all actions in our + * table say to do the normal CC update. Note that we pay no + * attention to the inst_ind since our overall sum is increasing. + */ + /* PROBE POINT 0 */ + probepoint = (((uint64_t) net->cwnd) << 32); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + net->cc_mod.rtcc.last_step_state = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.vol_reduce = 0; + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); +} /* RTCC Algoritm to limit growth of cwnd, return * true if you want to NOT allow cwnd growth @@ -193,6 +515,11 @@ 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 bytes_for_this_rtt, inst_bw; + uint64_t div, inst_off; + int bw_shift; + uint8_t inst_ind; + int ret; /*- * Here we need to see if we want @@ -231,151 +558,67 @@ cc_bw_limit(struct sctp_tcb *stcb, struc * RTT it stayed the same if it did not * change within 1/32nd */ + bw_shift = SCTP_BASE_SYSCTL(sctp_rttvar_bw); rtt = stcb->asoc.my_vtag; vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); probepoint = (((uint64_t) net->cwnd) << 32); rtt = net->rtt; - bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); - if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - /* - * BW increased, so update and return 0, since all actions - * in our table say to do the normal CC update - */ - /* PROBE POINT 0 */ + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + bytes_for_this_rtt = net->cc_mod.rtcc.bw_bytes - net->cc_mod.rtcc.bw_bytes_at_last_rttc; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + if (net->rtt) { + div = net->rtt / 1000; + if (div) { + inst_bw = bytes_for_this_rtt / div; + inst_off = inst_bw >> bw_shift; + if (inst_bw > nbw) + inst_ind = SCTP_INST_GAINING; + else if ((inst_bw + inst_off) < nbw) + inst_ind = SCTP_INST_LOOSING; + else + inst_ind = SCTP_INST_NEUTRAL; + probepoint |= ((0xb << 16) | inst_ind); + } else { + 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_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, vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, + ((nbw << 32) | inst_bw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | rtt), + net->flight_size, probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); + } else { + /* No rtt measurement, use last one */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + } + 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); + goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { - /* Bandwidth decreased. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* rtt increased */ - /* Did we add more */ - if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { - /* We caused it maybe.. back off */ - /* PROBE POINT 1 */ - probepoint |= ((1 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; - if (net->cc_mod.rtcc.ret_from_eq) { - /* - * Switch over to CA if we are less - * aggressive - */ - net->ssthresh = net->cwnd - 1; - net->partial_bytes_acked = 0; - } - return (1); - } - /* Probe point 2 */ - probepoint |= ((2 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - /* Someone else - fight for more? */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* rtt decreased */ - /* Probe point 3 */ - probepoint |= ((3 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* The bw decreased but rtt stayed the same */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - /* Probe point 4 */ - probepoint |= ((4 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (0); + ret = cc_bw_decrease(stcb, net, nbw, rtt_offset, vtag, inst_ind); + goto out; } /* * If we reach here then we are in a situation where the bw stayed * the same. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* - * rtt increased we don't update bw.. so we don't update the - * rtt either. - */ - /* Probe point 5 */ - probepoint |= ((5 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (1); - } - if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* - * rtt decreased, there could be more room. we update both - * the bw and the rtt here. - */ - /* Probe point 6 */ - probepoint |= ((6 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* - * Ok bw and rtt remained the same .. no update to any but save the - * latest cwnd. - */ - /* Probe point 7 */ - probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return ((int)net->cc_mod.rtcc.ret_from_eq); + ret = cc_bw_same(stcb, net, nbw, rtt_offset, vtag, inst_ind); +out: + net->cc_mod.rtcc.last_inst_ind = inst_ind; + return (ret); } static void @@ -554,11 +797,15 @@ sctp_cwnd_update_after_sack_common(struc SDT_PROBE(sctp, cwnd, net, rttvar, vtag, nbw, - 0, - net->rtt, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw = nbw; net->cc_mod.rtcc.lbw_rtt = net->rtt; + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + } } } /* @@ -1014,15 +1261,22 @@ sctp_cwnd_new_rtcc_transmission_begins(s SDT_PROBE(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | 0), - net->cc_mod.rtcc.lbw_rtt, - 0, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.steady_step) { + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + } if (net->cc_mod.rtcc.ret_from_eq) { /* less aggressive one - reset cwnd too */ uint32_t cwnd_in_mtu, cwnd; @@ -1075,11 +1329,20 @@ sctp_set_rtcc_initial_cc_param(struct sc probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); + net->cc_mod.rtcc.steady_step = SCTP_BASE_SYSCTL(sctp_steady_step); + net->cc_mod.rtcc.use_dccc_ecn = SCTP_BASE_SYSCTL(sctp_use_dccc_ecn); + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + + } static int @@ -1106,6 +1369,10 @@ sctp_cwnd_rtcc_socket_option(struct sctp TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; } + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.steady_step = cc_opt->aid_value.assoc_value; + } } else { return (EINVAL); } @@ -1123,6 +1390,12 @@ sctp_cwnd_rtcc_socket_option(struct sctp return (EFAULT); } cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.steady_step; } else { return (EINVAL); } @@ -1149,6 +1422,12 @@ sctp_cwnd_update_rtcc_after_sack(struct sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); } +static void +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, + struct sctp_nets *net, struct timeval *now) +{ + net->cc_mod.rtcc.rtt_set_this_sack = 1; +} /* Here starts Sally Floyds HS-TCP */ @@ -2203,6 +2482,7 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, - .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option, + .sctp_rtt_calculated = sctp_rtt_rtcc_calculated } }; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:22:45 2012 (r231425) @@ -355,8 +355,8 @@ __FBSDID("$FreeBSD$"); /* RTO calculation flag to say if it * is safe to determine local lan or not. */ -#define SCTP_DETERMINE_LL_NOTOK 0 -#define SCTP_DETERMINE_LL_OK 1 +#define SCTP_RTT_FROM_NON_DATA 0 +#define SCTP_RTT_FROM_DATA 1 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:22:45 2012 (r231425) @@ -57,6 +57,7 @@ SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); SDT_PROBE_DECLARE(sctp, cwnd, net, pd); /* Rttvar probe declaration */ SDT_PROBE_DECLARE(sctp, cwnd, net, rttvar); +SDT_PROBE_DECLARE(sctp, cwnd, net, rttstep); /* One to track an associations rwnd */ SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:22:45 2012 (r231425) @@ -78,14 +78,27 @@ SDT_PROBE_DEFINE(sctp, cwnd, net, rttvar SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 0, "uint64_t"); /* obw | nbw */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 1, "uint64_t"); -/* newrtt */ +/* bwrtt | newrtt */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 2, "uint64_t"); -/* bwrtt */ +/* flight */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 3, "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 4, "uint64_t"); +SDT_PROBE_DEFINE(sctp, cwnd, net, rttstep, rttstep); +/* The Vtag << 32 | localport << 16 | remoteport */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 0, "uint64_t"); +/* obw | nbw */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 1, "uint64_t"); +/* bwrtt | nrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 2, "uint64_t"); +/* cwnd_saved | stepcnt << 16 | oldstep */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 3, "uint64_t"); +/* (cwnd << 32) | point << 16 | retval(0/1) */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 4, "uint64_t"); + + /* FastRetransmit-DECREASE */ SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); /* The Vtag for this end */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:22:45 2012 (r231425) @@ -2817,7 +2817,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 *ecn_seg_sums, int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -2956,13 +2956,19 @@ sctp_process_segment_range(struct sctp_t * update RTO too ? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - &stcb->asoc, - tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (*rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + *rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -3033,7 +3039,8 @@ 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 num_seg, int num_nr_seg, int *ecn_seg_sums, + int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3079,7 +3086,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)) { + this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3579,6 +3586,9 @@ 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) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } if (alt != tp1->whoTo) { @@ -3775,6 +3785,7 @@ sctp_express_handle_sack(struct sctp_tcb int win_probe_recovery = 0; int win_probe_recovered = 0; int j, done_once = 0; + int rto_ok = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack, @@ -3916,16 +3927,23 @@ sctp_express_handle_sack(struct sctp_tcb /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - /* - * sa_ignore - * NO_NULL_CHK - */ - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + /* + * sa_ignore + * NO_NULL_CH + * K + */ + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4280,6 +4298,7 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_nets *net = NULL; int ecn_seg_sums = 0; int done_once; + int rto_ok = 1; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -4526,12 +4545,18 @@ sctp_handle_sack(struct mbuf *m, int off /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4606,7 +4631,8 @@ 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)) { + num_seg, num_nr_seg, &ecn_seg_sums, + &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:22:45 2012 (r231425) @@ -485,7 +485,7 @@ sctp_process_init_ack(struct mbuf *m, in /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -630,7 +630,7 @@ sctp_handle_heartbeat_ack(struct sctp_he } /* Now lets do a RTO with this */ r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + SCTP_RTT_FROM_NON_DATA); /* Mobility adaptation */ if (req_prim) { if ((sctp_is_mobility_feature_on(stcb->sctp_ep, @@ -1547,7 +1547,7 @@ sctp_process_cookie_existing(struct mbuf net->RTO = sctp_calculate_rto(stcb, asoc, net, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { @@ -2251,7 +2251,7 @@ sctp_process_cookie_new(struct mbuf *m, if ((netp) && (*netp)) { (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2849,7 +2849,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); @@ -3218,6 +3218,9 @@ process_chunk_drop(struct sctp_tcb *stcb * this guy had a RTO calculation * pending on it, cancel it */ + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } SCTP_STAT_INCR(sctps_pdrpmark); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:22:45 2012 (r231425) @@ -8254,7 +8254,10 @@ no_data_fill: } else { asoc->time_last_sent = *now; } - data_list[0]->do_rtt = 1; + if (net->rto_needed) { + data_list[0]->do_rtt = 1; + net->rto_needed = 0; + } SCTP_STAT_INCR_BY(sctps_senddata, bundle_at); sctp_clean_up_datalist(stcb, asoc, data_list, bundle_at, net); if (SCTP_BASE_SYSCTL(sctp_early_fr)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:22:45 2012 (r231425) @@ -3858,6 +3858,7 @@ sctp_add_remote_addr(struct sctp_tcb *st * We set this to 0, the timer code knows that this means its an * initial value */ + net->rto_needed = 1; net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:22:45 2012 (r231425) @@ -226,11 +226,20 @@ struct rtcc_cc { uint64_t bw_bytes; /* The total bytes since this sending began */ uint64_t bw_tot_time; /* The total time since sending began */ uint64_t new_tot_time; /* temp holding the new value */ - uint32_t cwnd_at_bw_set; - uint8_t ret_from_eq; - uint8_t use_dccc_ecn; + uint64_t bw_bytes_at_last_rttc; /* What bw_bytes was at last rtt calc */ + uint32_t cwnd_at_bw_set;/* Cwnd at last bw saved - lbw */ + uint32_t vol_reduce; /* cnt of voluntary reductions */ + uint16_t steady_step; /* The number required to be in steady state */ + uint16_t step_cnt; /* The current number */ + uint8_t ret_from_eq; /* When all things are equal what do I return + * 0/1 - 1 no cc advance */ + uint8_t use_dccc_ecn; /* Flag to enable DCCC ECN */ uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 * means set at send 2 not */ + uint8_t last_step_state;/* Last state if steady state stepdown is on */ + uint8_t rtt_set_this_sack; /* Flag saying this sack had RTT calc + * on it */ + uint8_t last_inst_ind; /* Last saved inst indication */ }; @@ -364,6 +373,7 @@ struct sctp_nets { uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ uint8_t lan_type; + uint8_t rto_needed; uint32_t flowid; #ifdef INVARIANTS uint8_t flowidset; @@ -671,6 +681,7 @@ struct sctp_cc_functions { void (*sctp_cwnd_prepare_net_for_sack) (struct sctp_tcb *stcb, struct sctp_nets *net); int (*sctp_cwnd_socket_option) (struct sctp_tcb *stcb, int set, struct sctp_cc_option *); + void (*sctp_rtt_calculated) (struct sctp_tcb *, struct sctp_nets *, struct timeval *); }; /* Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:22:45 2012 (r231425) @@ -118,6 +118,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; 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; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:27:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A2F106566B; Fri, 10 Feb 2012 20:27:58 +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 D05CC8FC08; Fri, 10 Feb 2012 20:27: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 q1AKRwNR092717; Fri, 10 Feb 2012 20:27:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKRwGS092714; Fri, 10 Feb 2012 20:27:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102027.q1AKRwGS092714@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231426 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:27:59 -0000 Author: tuexen Date: Fri Feb 10 20:27:58 2012 New Revision: 231426 URL: http://svn.freebsd.org/changeset/base/231426 Log: MFC r221249: Improve compilation of SCTP code without INET support. Some bugs where fixed while doing this: * ASCONF-ACK messages might use wrong port number when using IPv6. * Checking for additional addresses takes the correct address into account and also does not do more comparisons than necessary. This patch is based on one received from bz@ who was sponsored by The FreeBSD Foundation and iXsystems. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:22:45 2012 (r231425) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:27:58 2012 (r231426) @@ -57,41 +57,51 @@ static void sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) { struct ip *iph; + +#ifdef INET struct sockaddr_in *sin; +#endif #ifdef INET6 struct sockaddr_in6 *sin6; #endif iph = mtod(m, struct ip *); - if (iph->ip_v == IPVERSION) { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - return; - } + switch (iph->ip_v) { +#ifdef INET + case IPVERSION: + { + /* IPv4 source */ + sin = (struct sockaddr_in *)sa; + bzero(sin, sizeof(*sin)); + sin->sin_family = AF_INET; + sin->sin_len = sizeof(struct sockaddr_in); + sin->sin_port = 0; + sin->sin_addr.s_addr = iph->ip_src.s_addr; + break; + } +#endif #ifdef INET6 - else if (iph->ip_v == (IPV6_VERSION >> 4)) { - /* IPv6 source */ - struct ip6_hdr *ip6; + case (IPV6_VERSION >> 4): + { + /* IPv6 source */ + struct ip6_hdr *ip6; - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - return; - } + sin6 = (struct sockaddr_in6 *)sa; + bzero(sin6, sizeof(*sin6)); + sin6->sin6_family = AF_INET6; + sin6->sin6_len = sizeof(struct sockaddr_in6); + sin6->sin6_port = 0; + ip6 = mtod(m, struct ip6_hdr *); + sin6->sin6_addr = ip6->ip6_src; + break; + } #endif /* INET6 */ - else - return; + default: + break; + } + return; } /* @@ -192,33 +202,36 @@ sctp_process_asconf_add_ip(struct mbuf * { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -230,12 +243,14 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; - case SCTP_IPV6_ADDRESS: +#endif #ifdef INET6 + case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -247,18 +262,13 @@ sctp_process_asconf_add_ip(struct mbuf * zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! */ - /* FIX ME: currently sends back an invalid param error */ - m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_add_ip: v6 disabled- skipping "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - return m_reply; -#endif break; +#endif default: + /* + * XXX: Is this the correct error cause? Maybe + * SCTP_CAUSE_INVALID_PARAM is a better choice. + */ m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); @@ -293,7 +303,6 @@ sctp_process_asconf_add_ip(struct mbuf * sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, NULL); } - return m_reply; } @@ -331,37 +340,40 @@ sctp_process_asconf_delete_ip(struct mbu { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; int result; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif /* get the source IP address for src and 0.0.0.0/::0 delete checks */ sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -374,12 +386,14 @@ sctp_process_asconf_delete_ip(struct mbu "process_asconf_delete_ip: deleting "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; +#endif +#ifdef INET6 case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } -#ifdef INET6 + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -392,15 +406,8 @@ sctp_process_asconf_delete_ip(struct mbu SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: deleting "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! No "action" needed; just ack it */ - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_delete_ip: v6 disabled- ignoring: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - /* just respond with a "success" ASCONF-ACK */ - return NULL; -#endif break; +#endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, @@ -466,33 +473,36 @@ sctp_process_asconf_set_primary(struct m { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -503,12 +513,14 @@ sctp_process_asconf_set_primary(struct m SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; +#endif +#ifdef INET6 case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } -#ifdef INET6 + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -519,15 +531,8 @@ sctp_process_asconf_set_primary(struct m zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! No "action" needed; just ack it */ - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_set_primary: v6 disabled- ignoring: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - /* just respond with a "success" ASCONF-ACK */ - return NULL; -#endif break; +#endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, @@ -655,7 +660,7 @@ sctp_handle_asconf(struct mbuf *m, unsig if (first) { /* delete old cache */ - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); + SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing first ASCONF. Try to delete old cache\n"); TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) @@ -825,10 +830,8 @@ send_reply: ack->last_sent_to = NULL; ack->data = m_ack; ack->len = 0; - n = m_ack; - while (n) { + for (n = m_ack; n != NULL; n = SCTP_BUF_NEXT(n)) { ack->len += SCTP_BUF_LEN(n); - n = SCTP_BUF_NEXT(n); } TAILQ_INSERT_TAIL(&stcb->asoc.asconf_ack_sent, ack, next); @@ -846,12 +849,13 @@ send_reply: SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); /* pullup already done, IP options already stripped */ iph = mtod(m, struct ip *); - sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); switch (iph->ip_v) { +#ifdef INET case IPVERSION: { struct sockaddr_in *from4; + sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); from4 = (struct sockaddr_in *)&from_store; bzero(from4, sizeof(*from4)); from4->sin_family = AF_INET; @@ -860,6 +864,7 @@ send_reply: from4->sin_port = sh->src_port; break; } +#endif #ifdef INET6 case IPV6_VERSION >> 4: { @@ -867,6 +872,7 @@ send_reply: struct sockaddr_in6 *from6; ip6 = mtod(m, struct ip6_hdr *); + sh = (struct sctphdr *)((caddr_t)ip6 + sizeof(*ip6)); from6 = (struct sockaddr_in6 *)&from_store; bzero(from6, sizeof(*from6)); from6->sin6_family = AF_INET6; @@ -908,28 +914,36 @@ send_reply: static uint32_t sctp_asconf_addr_match(struct sctp_asconf_addr *aa, struct sockaddr *sa) { + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { - /* IPv6 sa address */ - /* XXX scopeid */ - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - - if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) && - (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)) == 0)) { - return (1); + case AF_INET6: + { + /* XXX scopeid */ + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + + if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) && + (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)) == 0)) { + return (1); + } + break; } - } else -#endif /* INET6 */ - if (sa->sa_family == AF_INET) { - /* IPv4 sa address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - - if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) && - (memcmp(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)) == 0)) { - return (1); +#endif +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + + if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) && + (memcmp(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)) == 0)) { + return (1); + } + break; } +#endif + default: + break; } return (0); } @@ -938,43 +952,48 @@ sctp_asconf_addr_match(struct sctp_ascon * does the address match? returns 0 if not, 1 if so */ static uint32_t -sctp_addr_match( - struct sctp_ipv6addr_param *v6addr, - struct sockaddr *sa) +sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa) { uint16_t param_type, param_length; - struct sctp_ipv4addr_param *v4addr = (struct sctp_ipv4addr_param *)v6addr; + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { - /* IPv6 sa address */ - /* XXX scopeid */ - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - - param_type = ntohs(v6addr->ph.param_type); - param_length = ntohs(v6addr->ph.param_length); - - if ((param_type == SCTP_IPV6_ADDRESS) && - param_length == sizeof(struct sctp_ipv6addr_param) && - (memcmp(&v6addr->addr, &sin6->sin6_addr, - sizeof(struct in6_addr)) == 0)) { - return (1); + case AF_INET6: + { + /* XXX scopeid */ + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sctp_ipv6addr_param *v6addr; + + v6addr = (struct sctp_ipv6addr_param *)ph; + if ((param_type == SCTP_IPV6_ADDRESS) && + param_length == sizeof(struct sctp_ipv6addr_param) && + (memcmp(&v6addr->addr, &sin6->sin6_addr, + sizeof(struct in6_addr)) == 0)) { + return (1); + } + break; } - } #endif - if (sa->sa_family == AF_INET) { - /* IPv4 sa address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); - - if ((param_type == SCTP_IPV4_ADDRESS) && - param_length == sizeof(struct sctp_ipv4addr_param) && - (memcmp(&v4addr->addr, &sin->sin_addr, - sizeof(struct in_addr)) == 0)) { - return (1); +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sctp_ipv4addr_param *v4addr; + + v4addr = (struct sctp_ipv4addr_param *)ph; + if ((param_type == SCTP_IPV4_ADDRESS) && + param_length == sizeof(struct sctp_ipv4addr_param) && + (memcmp(&v4addr->addr, &sin->sin_addr, + sizeof(struct in_addr)) == 0)) { + return (1); + } + break; } +#endif + default: + break; } return (0); } @@ -1179,17 +1198,25 @@ sctp_path_check_and_react(struct sctp_tc continue; changed = 0; - if (net->ro._l_addr.sa.sa_family == AF_INET) { - if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) { changed = 1; - } + } + break; +#endif #ifdef INET6 - if (net->ro._l_addr.sa.sa_family == AF_INET6) { + case AF_INET6: if (sctp_v6src_match_nexthop( - &newifa->address.sin6, (sctp_route_t *) & net->ro)) + &newifa->address.sin6, (sctp_route_t *) & net->ro)) { changed = 1; - } + } + break; #endif + default: + break; + } /* * if the newly added address does not relate routing * information, we skip. @@ -1316,31 +1343,40 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * aa->ifa = ifa; atomic_add_int(&ifa->refcount, 1); /* correlation_id filled in during send routine later... */ - if (ifa->address.sa.sa_family == AF_INET6) { - /* IPv6 address */ - struct sockaddr_in6 *sin6; + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sa; - sa = (struct sockaddr *)sin6; - aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + - sizeof(struct sctp_ipv6addr_param); - memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)); - } else if (ifa->address.sa.sa_family == AF_INET) { - /* IPv4 address */ - struct sockaddr_in *sin; + sin6 = (struct sockaddr_in6 *)&ifa->address.sa; + sa = (struct sockaddr *)sin6; + aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + + sizeof(struct sctp_ipv6addr_param); + memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)); + break; + } +#endif +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sa; - sa = (struct sockaddr *)sin; - aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + - sizeof(struct sctp_ipv4addr_param); - memcpy(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)); - } else { + sin = (struct sockaddr_in *)&ifa->address.sa; + sa = (struct sockaddr *)sin; + aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + + sizeof(struct sctp_ipv4addr_param); + memcpy(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)); + break; + } +#endif + default: /* invalid family! */ SCTP_FREE(aa, SCTP_M_ASC_ADDR); sctp_free_ifa(ifa); @@ -1522,26 +1558,37 @@ sctp_asconf_queue_sa_delete(struct sctp_ if (ifa) atomic_add_int(&ifa->refcount, 1); /* correlation_id filled in during send routine later... */ - if (sa->sa_family == AF_INET6) { - /* IPv6 address */ - struct sockaddr_in6 *sin6; + switch (sa->sa_family) { +#ifdef INET6 + case AF_INET6: + { + /* IPv6 address */ + struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; - aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param); - memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)); - } else if (sa->sa_family == AF_INET) { - /* IPv4 address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + sin6 = (struct sockaddr_in6 *)sa; + aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param); + memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)); + break; + } +#endif +#ifdef INET + case AF_INET: + { + /* IPv4 address */ + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param); - memcpy(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)); - } else { + aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param); + memcpy(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)); + break; + } +#endif + default: /* invalid family! */ SCTP_FREE(aa, SCTP_M_ASC_ADDR); if (ifa) @@ -1923,10 +1970,19 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * */ /* first, make sure it's a good address family */ - if (ifa->address.sa.sa_family != AF_INET6 && - ifa->address.sa.sa_family != AF_INET) { + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: + break; +#endif +#ifdef INET + case AF_INET: + break; +#endif + default: return; } +#ifdef INET6 /* make sure we're "allowed" to add this type of addr */ if (ifa->address.sa.sa_family == AF_INET6) { /* invalid if we're not a v6 endpoint */ @@ -1937,6 +1993,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } } +#endif /* put this address on the "pending/do not use yet" list */ sctp_add_local_addr_restricted(stcb, ifa); /* @@ -1971,6 +2028,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * break; } #endif +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -1993,6 +2051,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * } break; } +#endif default: /* else, not AF_INET or AF_INET6, so skip */ return; @@ -2036,35 +2095,38 @@ sctp_asconf_iterator_ep(struct sctp_inpc asc = (struct sctp_asconf_iterator *)ptr; LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) { ifa = l->ifa; - if (ifa->address.sa.sa_family == AF_INET6) { + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: /* invalid if we're not a v6 endpoint */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { cnt_invalid++; if (asc->cnt == cnt_invalid) return (1); - else - continue; } - } else if (ifa->address.sa.sa_family == AF_INET) { - /* invalid if we are a v6 only endpoint */ - struct in6pcb *inp6; + break; +#endif +#ifdef INET + case AF_INET: + { + /* invalid if we are a v6 only endpoint */ + struct in6pcb *inp6; - inp6 = (struct in6pcb *)&inp->ip_inp.inp; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(inp6)) { - cnt_invalid++; - if (asc->cnt == cnt_invalid) - return (1); - else - continue; + inp6 = (struct in6pcb *)&inp->ip_inp.inp; + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && + SCTP_IPV6_V6ONLY(inp6)) { + cnt_invalid++; + if (asc->cnt == cnt_invalid) + return (1); + } + break; } - } else { +#endif + default: /* invalid address family */ cnt_invalid++; if (asc->cnt == cnt_invalid) return (1); - else - continue; } } return (0); @@ -2153,6 +2215,7 @@ sctp_asconf_iterator_stcb(struct sctp_in break; } #endif +#ifdef INET case AF_INET: { /* invalid if we are a v6 only endpoint */ @@ -2184,6 +2247,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } break; } +#endif default: /* invalid address family */ cnt_invalid++; @@ -2374,7 +2438,7 @@ sctp_is_addr_pending(struct sctp_tcb *st struct sctp_asconf_chunk *acp; struct sctp_asconf_paramhdr *aph; uint8_t aparam_buf[SCTP_PARAM_BUFFER_SIZE]; - struct sctp_ipv6addr_param *p_addr; + struct sctp_paramhdr *ph; int add_cnt, del_cnt; uint16_t last_param_type; @@ -2389,12 +2453,12 @@ sctp_is_addr_pending(struct sctp_tcb *st acp = mtod(chk->data, struct sctp_asconf_chunk *); offset += sizeof(struct sctp_asconf_chunk); asconf_limit = ntohs(acp->ch.chunk_length); - p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf); - if (p_addr == NULL) { + ph = (struct sctp_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf); + if (ph == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get lookup addr!\n"); continue; } - offset += ntohs(p_addr->ph.param_length); + offset += ntohs(ph->param_length); aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_asconf_paramhdr), aparam_buf); if (aph == NULL) { @@ -2423,8 +2487,8 @@ sctp_is_addr_pending(struct sctp_tcb *st SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get entire param\n"); break; } - p_addr = (struct sctp_ipv6addr_param *)(aph + 1); - if (sctp_addr_match(p_addr, &sctp_ifa->address.sa) != 0) { + ph = (struct sctp_paramhdr *)(aph + 1); + if (sctp_addr_match(ph, &sctp_ifa->address.sa) != 0) { switch (param_type) { case SCTP_ADD_IP_ADDRESS: add_cnt++; @@ -2480,52 +2544,72 @@ sctp_find_valid_localaddr(struct sctp_tc continue; } LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { - if (sctp_ifa->address.sa.sa_family == AF_INET && - stcb->asoc.ipv4_addr_legal) { - struct sockaddr_in *sin; + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + if (stcb->asoc.ipv4_addr_legal) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + if (sin->sin_addr.s_addr == 0) { + /* skip unspecifed addresses */ + continue; + } + if (stcb->asoc.ipv4_local_scope == 0 && + IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) + continue; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; - if (sin->sin_addr.s_addr == 0) { - /* skip unspecifed addresses */ - continue; + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) + continue; + /* + * found a valid local v4 address to + * use + */ + if (addr_locked == SCTP_ADDR_NOT_LOCKED) + SCTP_IPI_ADDR_RUNLOCK(); + return (&sctp_ifa->address.sa); } - if (stcb->asoc.ipv4_local_scope == 0 && - IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) - continue; + break; +#endif +#ifdef INET6 + case AF_INET6: + if (stcb->asoc.ipv6_addr_legal) { + struct sockaddr_in6 *sin6; - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) - continue; - /* found a valid local v4 address to use */ - if (addr_locked == SCTP_ADDR_NOT_LOCKED) - SCTP_IPI_ADDR_RUNLOCK(); - return (&sctp_ifa->address.sa); - } else if (sctp_ifa->address.sa.sa_family == AF_INET6 && - stcb->asoc.ipv6_addr_legal) { - struct sockaddr_in6 *sin6; + if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { + continue; + } + sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + /* + * we skip unspecifed + * addresses + */ + continue; + } + if (stcb->asoc.local_scope == 0 && + IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + if (stcb->asoc.site_scope == 0 && + IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) + continue; - if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { - continue; - } - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; - if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - /* we skip unspecifed addresses */ - continue; + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) + continue; + /* + * found a valid local v6 address to + * use + */ + if (addr_locked == SCTP_ADDR_NOT_LOCKED) + SCTP_IPI_ADDR_RUNLOCK(); + return (&sctp_ifa->address.sa); } - if (stcb->asoc.local_scope == 0 && - IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - if (stcb->asoc.site_scope == 0 && - IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) - continue; - - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) - continue; - /* found a valid local v6 address to use */ - if (addr_locked == SCTP_ADDR_NOT_LOCKED) - SCTP_IPI_ADDR_RUNLOCK(); - return (&sctp_ifa->address.sa); + break; +#endif + default: + break; } } } @@ -2697,7 +2781,9 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup = (struct sctp_ipv6addr_param *)lookup_ptr; if (found_addr != NULL) { - if (found_addr->sa_family == AF_INET6) { + switch (found_addr->sa_family) { +#ifdef INET6 + case AF_INET6: /* copy IPv6 address */ lookup->ph.param_type = htons(SCTP_IPV6_ADDRESS); @@ -2705,7 +2791,10 @@ sctp_compose_asconf(struct sctp_tcb *stc addr_size = sizeof(struct in6_addr); addr_ptr = (caddr_t)&((struct sockaddr_in6 *) found_addr)->sin6_addr; - } else { + break; +#endif +#ifdef INET + case AF_INET: /* copy IPv4 address */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); @@ -2713,6 +2802,13 @@ sctp_compose_asconf(struct sctp_tcb *stc addr_size = sizeof(struct in_addr); addr_ptr = (caddr_t)&((struct sockaddr_in *) found_addr)->sin_addr; + break; +#endif + default: + p_size = 0; + addr_size = 0; + addr_ptr = NULL; + break; } lookup->ph.param_length = htons(SCTP_SIZE32(p_size)); memcpy(lookup->addr, addr_ptr, addr_size); @@ -2722,7 +2818,7 @@ sctp_compose_asconf(struct sctp_tcb *stc /* uh oh... don't have any address?? */ SCTPDBG(SCTP_DEBUG_ASCONF1, "compose_asconf: no lookup addr!\n"); - /* for now, we send a IPv4 address of 0.0.0.0 */ + /* XXX for now, we send a IPv4 address of 0.0.0.0 */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); bzero(lookup->addr, sizeof(struct in_addr)); @@ -2754,8 +2850,15 @@ sctp_process_initack_addresses(struct sc uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; struct sctp_ipv6addr_param addr_store; + +#ifdef INET6 struct sockaddr_in6 sin6; + +#endif +#ifdef INET struct sockaddr_in sin; + +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:29:55 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC623106564A; Fri, 10 Feb 2012 20:29:55 +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 D58128FC15; Fri, 10 Feb 2012 20:29: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 q1AKTtxp092822; Fri, 10 Feb 2012 20:29:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKTtZI092820; Fri, 10 Feb 2012 20:29:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102029.q1AKTtZI092820@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231427 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:29:56 -0000 Author: tuexen Date: Fri Feb 10 20:29:55 2012 New Revision: 231427 URL: http://svn.freebsd.org/changeset/base/231427 Log: MFC r221251: Remove some leftover debug code. Modified: stable/8/sys/netinet/sctp_os_bsd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 20:27:58 2012 (r231426) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 20:29:55 2012 (r231427) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_compat.h" #include "opt_inet6.h" -#if 1 #include "opt_inet.h" -#endif #include "opt_sctp.h" #include From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:32:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BE5E106566C; Fri, 10 Feb 2012 20:32:00 +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 248E18FC13; Fri, 10 Feb 2012 20:32: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 q1AKW0qI092936; Fri, 10 Feb 2012 20:32:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKVxLw092933; Fri, 10 Feb 2012 20:31:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102031.q1AKVxLw092933@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231428 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:32:00 -0000 Author: tuexen Date: Fri Feb 10 20:31:59 2012 New Revision: 231428 URL: http://svn.freebsd.org/changeset/base/231428 Log: MFC r221328: Some more cleanups related to an kernel without INET. Modified: stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:29:55 2012 (r231427) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:31:59 2012 (r231428) @@ -2844,9 +2844,11 @@ sctp_notify_peer_addr_change(struct sctp spc->spc_flags = 0; spc->spc_length = sizeof(struct sctp_paddr_change); switch (sa->sa_family) { +#ifdef INET case AF_INET: memcpy(&spc->spc_aaddr, sa, sizeof(struct sockaddr_in)); break; +#endif #ifdef INET6 case AF_INET6: { @@ -4084,6 +4086,7 @@ sctp_cmpaddr(struct sockaddr *sa1, struc sin6_2)); } #endif +#ifdef INET case AF_INET: { /* IPv4 addresses */ @@ -4093,6 +4096,7 @@ sctp_cmpaddr(struct sockaddr *sa1, struc sin_2 = (struct sockaddr_in *)sa2; return (sin_1->sin_addr.s_addr == sin_2->sin_addr.s_addr); } +#endif default: /* we don't do these... */ return (0); @@ -4122,6 +4126,7 @@ sctp_print_address(struct sockaddr *sa) break; } #endif +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -4133,6 +4138,7 @@ sctp_print_address(struct sockaddr *sa) p[0], p[1], p[2], p[3], ntohs(sin->sin_port)); break; } +#endif default: SCTP_PRINTF("?\n"); break; @@ -4143,6 +4149,7 @@ void sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh) { switch (iph->ip_v) { +#ifdef INET case IPVERSION: { struct sockaddr_in lsa, fsa; @@ -4163,6 +4170,7 @@ sctp_print_address_pkt(struct ip *iph, s sctp_print_address((struct sockaddr *)&fsa); break; } +#endif #ifdef INET6 case IPV6_VERSION >> 4: { @@ -4862,22 +4870,33 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *i uint32_t sctp_get_ifa_hash_val(struct sockaddr *addr) { - if (addr->sa_family == AF_INET) { - struct sockaddr_in *sin; + switch (addr->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; - sin = (struct sockaddr_in *)addr; - return (sin->sin_addr.s_addr ^ (sin->sin_addr.s_addr >> 16)); - } else if (addr->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6; - uint32_t hash_of_addr; + sin = (struct sockaddr_in *)addr; + return (sin->sin_addr.s_addr ^ (sin->sin_addr.s_addr >> 16)); + } +#endif +#ifdef INET6 + case INET6: + { + struct sockaddr_in6 *sin6; + uint32_t hash_of_addr; - sin6 = (struct sockaddr_in6 *)addr; - hash_of_addr = (sin6->sin6_addr.s6_addr32[0] + - sin6->sin6_addr.s6_addr32[1] + - sin6->sin6_addr.s6_addr32[2] + - sin6->sin6_addr.s6_addr32[3]); - hash_of_addr = (hash_of_addr ^ (hash_of_addr >> 16)); - return (hash_of_addr); + sin6 = (struct sockaddr_in6 *)addr; + hash_of_addr = (sin6->sin6_addr.s6_addr32[0] + + sin6->sin6_addr.s6_addr32[1] + + sin6->sin6_addr.s6_addr32[2] + + sin6->sin6_addr.s6_addr32[3]); + hash_of_addr = (hash_of_addr ^ (hash_of_addr >> 16)); + return (hash_of_addr); + } +#endif + default: + break; } return (0); } @@ -6250,7 +6269,9 @@ sctp_connectx_helper_add(struct sctp_tcb inp = stcb->sctp_ep; *error = 0; for (i = 0; i < totaddr; i++) { - if (sa->sa_family == AF_INET) { + switch (sa->sa_family) { +#ifdef INET + case AF_INET: incr = sizeof(struct sockaddr_in); if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ @@ -6260,7 +6281,10 @@ sctp_connectx_helper_add(struct sctp_tcb goto out_now; } added++; - } else if (sa->sa_family == AF_INET6) { + break; +#endif +#ifdef INET6 + case AF_INET6: incr = sizeof(struct sockaddr_in6); if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ @@ -6270,6 +6294,10 @@ sctp_connectx_helper_add(struct sctp_tcb goto out_now; } added++; + break; +#endif + default: + break; } sa = (struct sockaddr *)((caddr_t)sa + incr); } @@ -6288,10 +6316,13 @@ sctp_connectx_helper_find(struct sctp_in at = incr = 0; sa = addr; + *error = *num_v6 = *num_v4 = 0; /* account and validate addresses */ for (i = 0; i < (size_t)*totaddr; i++) { - if (sa->sa_family == AF_INET) { + switch (sa->sa_family) { +#ifdef INET + case AF_INET: (*num_v4) += 1; incr = sizeof(struct sockaddr_in); if (sa->sa_len != incr) { @@ -6300,30 +6331,40 @@ sctp_connectx_helper_find(struct sctp_in *bad_addr = 1; return (NULL); } - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6; - - sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - /* Must be non-mapped for connectx */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); - } - (*num_v6) += 1; - incr = sizeof(struct sockaddr_in6); - if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + break; +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + /* Must be non-mapped for connectx */ + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + *bad_addr = 1; + return (NULL); + } + (*num_v6) += 1; + incr = sizeof(struct sockaddr_in6); + if (sa->sa_len != incr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + *bad_addr = 1; + return (NULL); + } + break; } - } else { +#endif + default: *totaddr = i; /* we are done */ break; } + if (i == (size_t)*totaddr) { + break; + } SCTP_INP_INCR_REF(inp); stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb != NULL) { @@ -6364,7 +6405,7 @@ sctp_bindx_add_address(struct socket *so return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#ifdef INET6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; @@ -6393,6 +6434,7 @@ sctp_bindx_add_address(struct socket *so } } #endif +#ifdef INET if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); @@ -6407,6 +6449,7 @@ sctp_bindx_add_address(struct socket *so return; } } +#endif if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { if (p == NULL) { /* Can't get proc for Net/Open BSD */ @@ -6519,6 +6562,7 @@ sctp_bindx_delete_address(struct socket } } #endif +#ifdef INET if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); @@ -6533,6 +6577,7 @@ sctp_bindx_delete_address(struct socket return; } } +#endif /* * No lock required mgmt_ep_sa does its own locking. If the FIX: * below is ever changed we may need to lock before calling @@ -6599,6 +6644,7 @@ sctp_local_addr_count(struct sctp_tcb *s if (sctp_is_addr_restricted(stcb, sctp_ifa)) continue; switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET case AF_INET: if (ipv4_addr_legal) { struct sockaddr_in *sin; @@ -6621,6 +6667,7 @@ sctp_local_addr_count(struct sctp_tcb *s continue; } break; +#endif #ifdef INET6 case AF_INET6: if (ipv6_addr_legal) { @@ -6715,6 +6762,8 @@ sctp_log_trace(uint32_t subsys, const ch } #endif +/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ +#ifdef INET /* We will need to add support * to bind the ports and such here * so we can do UDP tunneling. In @@ -6816,7 +6865,7 @@ out: m_freem(m); } -void +void sctp_over_udp_stop(void) { struct socket *sop; @@ -6833,7 +6882,8 @@ sctp_over_udp_stop(void) soclose(sop); SCTP_BASE_INFO(udp_tun_socket) = NULL; } -int + +int sctp_over_udp_start(void) { uint16_t port; @@ -6886,3 +6936,5 @@ exit_stage_left: */ return (0); } + +#endif Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 20:29:55 2012 (r231427) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 20:31:59 2012 (r231428) @@ -313,10 +313,14 @@ do { \ } \ } while (0) -/* new functions to start/stop udp tunneling */ +/* functions to start/stop udp tunneling */ +/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ +#ifdef INET void sctp_over_udp_stop(void); int sctp_over_udp_start(void); +#endif + int sctp_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:34:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CC8E1065672; Fri, 10 Feb 2012 20:34:21 +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 475B58FC0A; Fri, 10 Feb 2012 20: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 q1AKYLL1093067; Fri, 10 Feb 2012 20:34:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKYLcw093065; Fri, 10 Feb 2012 20:34:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102034.q1AKYLcw093065@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231429 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:34:21 -0000 Author: tuexen Date: Fri Feb 10 20:34:20 2012 New Revision: 231429 URL: http://svn.freebsd.org/changeset/base/231429 Log: MFC r221410: Add a missing break. This bug was introduced in r221249. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:31:59 2012 (r231428) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:34:20 2012 (r231429) @@ -2930,6 +2930,7 @@ sctp_process_initack_addresses(struct sc } sin.sin_addr.s_addr = a4p->addr; sa = (struct sockaddr *)&sin; + break; } #endif default: From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:36:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9926106566B; Fri, 10 Feb 2012 20:36:17 +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 A3A8D8FC13; Fri, 10 Feb 2012 20:36: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 q1AKaHk9093176; Fri, 10 Feb 2012 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKaHIN093171; Fri, 10 Feb 2012 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102036.q1AKaHIN093171@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231430 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:36:17 -0000 Author: tuexen Date: Fri Feb 10 20:36:17 2012 New Revision: 231430 URL: http://svn.freebsd.org/changeset/base/231430 Log: MFC r221411: Remove code with any effect. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:36:17 2012 (r231430) @@ -2813,7 +2813,6 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup->ph.param_length = htons(SCTP_SIZE32(p_size)); memcpy(lookup->addr, addr_ptr, addr_size); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(p_size); - lookup_used = 1; } else { /* uh oh... don't have any address?? */ SCTPDBG(SCTP_DEBUG_ASCONF1, @@ -2823,7 +2822,6 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); bzero(lookup->addr, sizeof(struct in_addr)); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)); - lookup_used = 1; } } /* chain it all together */ Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:36:17 2012 (r231430) @@ -1949,9 +1949,6 @@ sctp_validate_init_auth_params(struct mb case SCTP_ASCONF_ACK: peer_supports_asconf = 1; break; - case SCTP_AUTHENTICATION: - peer_supports_auth = 1; - break; default: /* one we don't care about */ break; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:36:17 2012 (r231430) @@ -3850,8 +3850,6 @@ sctp_abort_an_association(struct sctp_in #endif ) { - uint32_t vtag; - #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -3872,7 +3870,6 @@ sctp_abort_an_association(struct sctp_in } else { stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - vtag = stcb->asoc.peer_vtag; /* notify the ulp */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) sctp_abort_notification(stcb, error, so_locked); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 20:36:17 2012 (r231430) @@ -1066,10 +1066,8 @@ sctp6_connect(struct socket *so, struct SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return EINVAL; } - } else + } #endif /* INET */ - addr = addr; /* for true v6 address case */ - /* Now do we connect? */ if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { stcb = LIST_FIRST(&inp->sctp_asoc_list); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:38:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BFFB1065670; Fri, 10 Feb 2012 20:38:45 +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 658CC8FC08; Fri, 10 Feb 2012 20:38: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 q1AKcj40093298; Fri, 10 Feb 2012 20:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKcjdY093293; Fri, 10 Feb 2012 20:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102038.q1AKcjdY093293@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231431 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:38:45 -0000 Author: tuexen Date: Fri Feb 10 20:38:44 2012 New Revision: 231431 URL: http://svn.freebsd.org/changeset/base/231431 Log: MFC r221460: Implement Resource Pooling V2 and an MPTCP like congestion control. Based on a patch received from Martin Becke. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:38:44 2012 (r231431) @@ -265,6 +265,13 @@ struct sctp_paramhdr { #define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 #define SCTP_CC_OPT_STEADY_STEP 0x00002002 +#define SCTP_CMT_OFF 0 +#define SCTP_CMT_BASE 1 +#define SCTP_CMT_RPV1 2 +#define SCTP_CMT_RPV2 3 +#define SCTP_CMT_MPTCP 4 +#define SCTP_CMT_MAX SCTP_CMT_MPTCP + /* RS - Supported stream scheduling modules for pluggable * stream scheduling */ Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:38:44 2012 (r231431) @@ -47,6 +47,10 @@ #include __FBSDID("$FreeBSD$"); +#define SHIFT_MPTCP_MULTI_N 40 +#define SHIFT_MPTCP_MULTI_Z 16 +#define SHIFT_MPTCP_MULTI 8 + static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -67,7 +71,8 @@ sctp_set_initial_cc_param(struct sctp_tc cwnd_in_mtu = assoc->max_burst; net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } - if (stcb->asoc.sctp_cmt_on_off == 2) { + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2)) { /* In case of resource pooling initialize appropriately */ net->cwnd /= assoc->numnets; if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { @@ -91,14 +96,23 @@ sctp_cwnd_update_after_fr(struct sctp_tc { struct sctp_nets *net; uint32_t t_ssthresh, t_cwnd; + uint64_t t_ucwnd_sbw; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (asoc->sctp_cmt_on_off == 2) { + t_ucwnd_sbw = 0; + if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || + (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; + if (net->lastsa > 0) { + t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) net->lastsa; + } + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; } } /*- @@ -119,11 +133,37 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_tmit_chunk *lchk; int old_cwnd = net->cwnd; - if (asoc->sctp_cmt_on_off == 2) { - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); + if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || + (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { + if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + + } + if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2) { + uint32_t srtt; + + srtt = net->lastsa; + /* + * lastsa>>3; we don't need + * to devide ... + */ + if (srtt == 0) { + srtt = 1; + } + /* + * Short Version => Equal to + * Contel Version MBe + */ + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * + t_ucwnd_sbw)); + /* INCREASE FACTOR */ ; + } if ((net->cwnd > t_cwnd / 2) && (net->ssthresh < net->cwnd - t_cwnd / 2)) { net->ssthresh = net->cwnd - t_cwnd / 2; @@ -629,14 +669,47 @@ sctp_cwnd_update_after_sack_common(struc struct sctp_nets *net; int old_cwnd; uint32_t t_ssthresh, t_cwnd, incr; + uint64_t t_ucwnd_sbw; + uint64_t t_path_mptcp; + uint64_t mptcp_like_alpha; + uint32_t srtt; + uint64_t max_path; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (stcb->asoc.sctp_cmt_on_off == 2) { + t_ucwnd_sbw = 0; + t_path_mptcp = 0; + mptcp_like_alpha = 1; + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_MPTCP)) { + max_path = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; + /* lastsa>>3; we don't need to devide ... */ + srtt = net->lastsa; + if (srtt > 0) { + uint64_t tmp; + + t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) srtt; + t_path_mptcp += (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_Z) / + (((uint64_t) net->mtu) * (uint64_t) srtt); + tmp = (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_N) / + ((uint64_t) net->mtu * (uint64_t) (srtt * srtt)); + if (tmp > max_path) { + max_path = tmp; + } + } + } + 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; } } /******************************/ @@ -818,10 +891,11 @@ sctp_cwnd_update_after_sack_common(struc if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - old_cwnd = net->cwnd; - if (stcb->asoc.sctp_cmt_on_off == 2) { - uint32_t limit; + uint32_t limit; + old_cwnd = net->cwnd; + switch (asoc->sctp_cmt_on_off) { + case SCTP_CMT_RPV1: limit = (uint32_t) (((uint64_t) net->mtu * (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * (uint64_t) net->ssthresh) / @@ -835,11 +909,56 @@ sctp_cwnd_update_after_sack_common(struc if (incr == 0) { incr = 1; } - } else { + break; + case SCTP_CMT_RPV2: + /* + * lastsa>>3; we don't need + * to divide ... + */ + srtt = net->lastsa; + if (srtt == 0) { + srtt = 1; + } + limit = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * t_ucwnd_sbw)); + /* INCREASE FACTOR */ + incr = (uint32_t) (((uint64_t) net->net_ack * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * t_ucwnd_sbw)); + /* INCREASE FACTOR */ + if (incr > limit) { + incr = limit; + } + if (incr == 0) { + incr = 1; + } + break; + case SCTP_CMT_MPTCP: + limit = (uint32_t) (((uint64_t) net->mtu * + mptcp_like_alpha * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) >> + SHIFT_MPTCP_MULTI); + incr = (uint32_t) (((uint64_t) net->net_ack * + mptcp_like_alpha) >> + SHIFT_MPTCP_MULTI); + if (incr > limit) { + incr = limit; + } + if (incr > net->net_ack) { + incr = net->net_ack; + } + if (incr > net->mtu) { + incr = net->mtu; + } + break; + default: incr = net->net_ack; if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); } + break; } net->cwnd += incr; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -868,15 +987,44 @@ sctp_cwnd_update_after_sack_common(struc (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; old_cwnd = net->cwnd; - if (asoc->sctp_cmt_on_off == 2) { + switch (asoc->sctp_cmt_on_off) { + case SCTP_CMT_RPV1: incr = (uint32_t) (((uint64_t) net->mtu * (uint64_t) net->ssthresh) / (uint64_t) t_ssthresh); if (incr == 0) { incr = 1; } - } else { + break; + case SCTP_CMT_RPV2: + /* + * lastsa>>3; we don't need + * to divide ... + */ + srtt = net->lastsa; + if (srtt == 0) { + srtt = 1; + } + incr = (uint32_t) ((uint64_t) net->mtu * + (uint64_t) net->cwnd / + ((uint64_t) srtt * + t_ucwnd_sbw)); + /* INCREASE FACTOR */ + if (incr == 0) { + incr = 1; + } + break; + case SCTP_CMT_MPTCP: + incr = (uint32_t) ((mptcp_like_alpha * + (uint64_t) net->cwnd) >> + SHIFT_MPTCP_MULTI); + if (incr > net->mtu) { + incr = net->mtu; + } + break; + default: incr = net->mtu; + break; } net->cwnd += incr; SDT_PROBE(sctp, cwnd, net, ack, @@ -926,21 +1074,49 @@ sctp_cwnd_update_after_timeout(struct sc { int old_cwnd = net->cwnd; uint32_t t_ssthresh, t_cwnd; + uint64_t t_ucwnd_sbw; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (stcb->asoc.sctp_cmt_on_off == 2) { + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2)) { struct sctp_nets *lnet; + uint32_t srtt; + t_ucwnd_sbw = 0; TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { t_ssthresh += lnet->ssthresh; t_cwnd += lnet->cwnd; + srtt = lnet->lastsa; + /* lastsa>>3; we don't need to divide ... */ + if (srtt > 0) { + t_ucwnd_sbw += (uint64_t) lnet->cwnd / (uint64_t) srtt; + } + } + if (t_ucwnd_sbw < 1) { + t_ucwnd_sbw = 1; + } + if (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + } else { + uint64_t cc_delta; + + srtt = net->lastsa; + /* lastsa>>3; we don't need to divide ... */ + if (srtt == 0) { + srtt = 1; + } + cc_delta = t_ucwnd_sbw * (uint64_t) srtt / 2; + if (cc_delta < t_cwnd) { + net->ssthresh = (uint32_t) ((uint64_t) t_cwnd - cc_delta); + } else { + net->ssthresh = net->mtu; + } } - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); if ((net->cwnd > t_cwnd / 2) && (net->ssthresh < net->cwnd - t_cwnd / 2)) { net->ssthresh = net->cwnd - t_cwnd / 2; Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:38:44 2012 (r231431) @@ -336,9 +336,9 @@ struct sctp_sysctl { /* cmt_on_off: CMT on/off flag */ #define SCTPCTL_CMT_ON_OFF_DESC "CMT settings" -#define SCTPCTL_CMT_ON_OFF_MIN 0 -#define SCTPCTL_CMT_ON_OFF_MAX 2 -#define SCTPCTL_CMT_ON_OFF_DEFAULT 0 +#define SCTPCTL_CMT_ON_OFF_MIN SCTP_CMT_OFF +#define SCTPCTL_CMT_ON_OFF_MAX SCTP_CMT_MAX +#define SCTPCTL_CMT_ON_OFF_DEFAULT SCTP_CMT_OFF /* EY - nr_sack_on_off: NR_SACK on/off flag */ #define SCTPCTL_NR_SACK_ON_OFF_DESC "NR_SACK on/off flag" Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:38:44 2012 (r231431) @@ -2989,18 +2989,22 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { - stcb->asoc.sctp_cmt_on_off = av->assoc_value; - if (stcb->asoc.sctp_cmt_on_off > 2) { - stcb->asoc.sctp_cmt_on_off = 2; + if (av->assoc_value > SCTP_CMT_MAX) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + stcb->asoc.sctp_cmt_on_off = av->assoc_value; } SCTP_TCB_UNLOCK(stcb); } else { - SCTP_INP_WLOCK(inp); - inp->sctp_cmt_on_off = av->assoc_value; - if (inp->sctp_cmt_on_off > 2) { - inp->sctp_cmt_on_off = 2; + if (av->assoc_value > SCTP_CMT_MAX) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_WLOCK(inp); + inp->sctp_cmt_on_off = av->assoc_value; + SCTP_INP_WUNLOCK(inp); } - SCTP_INP_WUNLOCK(inp); } } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:45:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F3C1065670; Fri, 10 Feb 2012 20:45:17 +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 CA1C28FC12; Fri, 10 Feb 2012 20:45: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 q1AKjHLS093553; Fri, 10 Feb 2012 20:45:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKjHKv093550; Fri, 10 Feb 2012 20:45:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102045.q1AKjHKv093550@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231432 - in stable/8/lib: libc/net libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:45:18 -0000 Author: tuexen Date: Fri Feb 10 20:45:17 2012 New Revision: 231432 URL: http://svn.freebsd.org/changeset/base/231432 Log: MFC r221512: * Update copyright notice. * Cleanup usage of iov's. * Add support for SCTP_TIMEOUTS socketoption. * Fix a bug in sctp_recvmsg(): return the msg_flags in case of an error. * Fix a bug in the error handling of sctp_peeloff(): return the -1. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 20:38:44 2012 (r231431) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 20:45:17 2012 (r231432) @@ -1,33 +1,35 @@ -/* $KAME: sctp_sys_calls.c,v 1.9 2004/08/17 06:08:53 itojun Exp $ */ - -/* - * Copyright (C) 2002-2007 Cisco Systems Inc, - * All rights reserved. +/*- + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. 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. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 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. + * + * 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. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ + #include __FBSDID("$FreeBSD$"); #include @@ -58,7 +60,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_CONTROL_VEC_SIZE_SND 8192 #define SCTP_CONTROL_VEC_SIZE_RCV 16384 #define SCTP_STACK_BUF_SIZE 2048 -#define SCTP_SMALL_IOVEC_SIZE 2 #ifdef SCTP_DEBUG_PRINT_ADDRESS @@ -398,6 +399,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_LOCAL_AUTH_CHUNKS: ((struct sctp_authchunks *)arg)->gauth_assoc_id = id; break; + case SCTP_TIMEOUTS: + ((struct sctp_timeouts *)arg)->stimo_assoc_id = id; + break; default: break; } @@ -551,11 +555,10 @@ sctp_sendmsg(int s, return (syscall(SYS_sctp_generic_sendmsg, s, data, len, to, tolen, &sinfo, 0)); #else - ssize_t sz; struct msghdr msg; struct sctp_sndrcvinfo *s_info; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; struct sockaddr *who = NULL; @@ -564,20 +567,8 @@ sctp_sendmsg(int s, struct sockaddr_in6 in6; } addr; -/* - fprintf(io, "sctp_sendmsg(sd:%d, data:%x, len:%d, to:%x, tolen:%d, ppid:%x, flags:%x str:%d ttl:%d ctx:%x\n", - s, - (u_int)data, - (int)len, - (u_int)to, - (int)tolen, - ppid, flags, - (int)stream_no, - (int)timetolive, - (u_int)context); - fflush(io); -*/ - if ((tolen > 0) && ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { + if ((tolen > 0) && + ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { errno = EINVAL; return -1; } @@ -587,7 +578,8 @@ sctp_sendmsg(int s, errno = EINVAL; return -1; } - if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in))) { + if ((to->sa_len > 0) && + (to->sa_len != sizeof(struct sockaddr_in))) { errno = EINVAL; return -1; } @@ -598,7 +590,8 @@ sctp_sendmsg(int s, errno = EINVAL; return -1; } - if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in6))) { + if ((to->sa_len > 0) && + (to->sa_len != sizeof(struct sockaddr_in6))) { errno = EINVAL; return -1; } @@ -610,10 +603,8 @@ sctp_sendmsg(int s, } who = (struct sockaddr *)&addr; } - iov[0].iov_base = (char *)data; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = (char *)data; + iov.iov_len = len; if (who) { msg.msg_name = (caddr_t)who; @@ -622,7 +613,7 @@ sctp_sendmsg(int s, msg.msg_name = (caddr_t)NULL; msg.msg_namelen = 0; } - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; @@ -681,7 +672,7 @@ sctp_send(int sd, const void *data, size #else ssize_t sz; struct msghdr msg; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; struct sctp_sndrcvinfo *s_info; char controlVector[SCTP_CONTROL_VEC_SIZE_SND]; struct cmsghdr *cmsg; @@ -690,14 +681,12 @@ sctp_send(int sd, const void *data, size errno = EINVAL; return (-1); } - iov[0].iov_base = (char *)data; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = (char *)data; + iov.iov_len = len; msg.msg_name = 0; msg.msg_namelen = 0; - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; @@ -736,7 +725,7 @@ sctp_sendx(int sd, const void *msg, size return (-1); } #ifdef SYS_sctp_generic_sendmsg - if (addrcnt < SCTP_SMALL_IOVEC_SIZE) { + if (addrcnt == 1) { socklen_t l; /* @@ -846,18 +835,18 @@ sctp_recvmsg(int s, int *msg_flags) { #ifdef SYS_sctp_generic_recvmsg - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; - iov[0].iov_base = dbuf; - iov[0].iov_len = len; + iov.iov_base = dbuf; + iov.iov_len = len; return (syscall(SYS_sctp_generic_recvmsg, s, - iov, 1, from, fromlen, sinfo, msg_flags)); + &iov, 1, from, fromlen, sinfo, msg_flags)); #else struct sctp_sndrcvinfo *s_info; ssize_t sz; int sinfo_found = 0; struct msghdr msg; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; @@ -866,30 +855,28 @@ sctp_recvmsg(int s, return (-1); } msg.msg_flags = 0; - iov[0].iov_base = dbuf; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = dbuf; + iov.iov_len = len; msg.msg_name = (caddr_t)from; if (fromlen == NULL) msg.msg_namelen = 0; else msg.msg_namelen = *fromlen; - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; msg.msg_controllen = sizeof(controlVector); errno = 0; sz = recvmsg(s, &msg, *msg_flags); - if (sz <= 0) + *msg_flags = msg.msg_flags; + if (sz <= 0) { return (sz); - + } s_info = NULL; len = sz; - *msg_flags = msg.msg_flags; - if (sinfo) + if (sinfo) { sinfo->sinfo_assoc_id = 0; - + } if ((msg.msg_controllen) && sinfo) { /* * parse through and see if we find the sctp_sndrcvinfo (if @@ -940,7 +927,7 @@ int sctp_peeloff(int sd, sctp_assoc_t assoc_id) { struct sctp_peeloff_opt peeloff; - int error; + int result; socklen_t optlen; /* set in the socket option params */ @@ -948,10 +935,9 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ peeloff.s = sd; peeloff.assoc_id = assoc_id; optlen = sizeof(peeloff); - error = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, - &optlen); - if (error) { - errno = error; + result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen); + + if (result < 0) { return (-1); } else { return (peeloff.new_sd); @@ -984,4 +970,3 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ #undef SCTP_CONTROL_VEC_SIZE_SND #undef SCTP_CONTROL_VEC_SIZE_RCV #undef SCTP_STACK_BUF_SIZE -#undef SCTP_SMALL_IOVEC_SIZE From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:49:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5326106566B; Fri, 10 Feb 2012 20:49:18 +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 9F41C8FC16; Fri, 10 Feb 2012 20:49: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 q1AKnIA3093721; Fri, 10 Feb 2012 20:49:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKnI32093719; Fri, 10 Feb 2012 20:49:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102049.q1AKnI32093719@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231433 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:49:18 -0000 Author: tuexen Date: Fri Feb 10 20:49:18 2012 New Revision: 231433 URL: http://svn.freebsd.org/changeset/base/231433 Log: MFC r221549: Change the name of an internal structure, since the name is used by a structure of the (new) SCTP API. Modified: stable/8/sys/netinet/sctp_auth.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:45:17 2012 (r231432) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:49:18 2012 (r231433) @@ -89,7 +89,7 @@ typedef struct sctp_hmaclist { } sctp_hmaclist_t; /* authentication info */ -typedef struct sctp_authinfo { +typedef struct sctp_authinformation { sctp_key_t *random; /* local random key (concatenated) */ uint32_t random_len; /* local random number length for param */ sctp_key_t *peer_random;/* peer's random key (concatenated) */ @@ -98,7 +98,7 @@ typedef struct sctp_authinfo { uint16_t active_keyid; /* active send keyid */ uint16_t assoc_keyid; /* current send keyid (cached) */ uint16_t recv_keyid; /* last recv keyid (cached) */ -} sctp_authinfo_t; +} sctp_authinfo_t; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:54:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 939BA106566B; Fri, 10 Feb 2012 20:54:21 +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 7CBE48FC0C; Fri, 10 Feb 2012 20:54: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 q1AKsLf2093946; Fri, 10 Feb 2012 20:54:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKsLNR093932; Fri, 10 Feb 2012 20:54:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102054.q1AKsLNR093932@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231434 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:54:21 -0000 Author: tuexen Date: Fri Feb 10 20:54:20 2012 New Revision: 231434 URL: http://svn.freebsd.org/changeset/base/231434 Log: MFC r221627: Fix a locking issue showing up on Mac OS X when subscribing to authentication events. DTLS/SCTP renegotiations trigger the bug. Modified: stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:54:20 2012 (r231434) @@ -598,7 +598,11 @@ sctp_auth_key_acquire(struct sctp_tcb *s } void -sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id) +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { sctp_sharedkey_t *skey; @@ -616,7 +620,7 @@ sctp_auth_key_release(struct sctp_tcb *s if ((skey->refcount <= 1) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, - key_id, 0, SCTP_SO_LOCKED); + key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, stcb, key_id, skey->refcount); Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:54:20 2012 (r231434) @@ -156,7 +156,9 @@ sctp_copy_skeylist(const struct sctp_key /* ref counts on shared keys, by key id */ extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid); -extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid); +extern void +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid, + int so_locked); /* hmac list handling */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:54:20 2012 (r231434) @@ -375,7 +375,7 @@ abandon: chk->data = NULL; } /* Now free the address and data */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } return; @@ -479,7 +479,7 @@ abandon: sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* free up the chk */ chk->data = NULL; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (asoc->fragmented_delivery_inprogress == 0) { /* @@ -1011,7 +1011,7 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { last_flags = at->rec.data.rcv_flags; @@ -2416,7 +2416,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } sctp_send_shutdown(stcb, stcb->asoc.primary_destination); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -2466,7 +2466,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i * there are gaps or duplicates. */ (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } } else { if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { @@ -3993,7 +3993,7 @@ sctp_express_handle_sack(struct sctp_tcb SCTP_LOG_FREE_SENT); } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); } else { break; } @@ -4709,7 +4709,7 @@ sctp_handle_sack(struct mbuf *m, int off 0, SCTP_LOG_FREE_SENT); } - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); wake_him++; } if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { @@ -5260,7 +5260,7 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we @@ -5431,7 +5431,7 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else { /* * Ok we have gone beyond the end of the fwd-tsn's Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:54:20 2012 (r231434) @@ -193,7 +193,11 @@ outnow: */ int -sctp_is_there_unsent_data(struct sctp_tcb *stcb) +sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { int unsent_data = 0; unsigned int i; @@ -242,7 +246,7 @@ sctp_is_there_unsent_data(struct sctp_tc sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); } else { unsent_data++; break; @@ -301,7 +305,7 @@ sctp_process_init(struct sctp_init_chunk chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -323,7 +327,7 @@ sctp_process_init(struct sctp_init_chunk sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -902,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); } /* Now is there unsent data on a stream somewhere? */ - some_on_streamwheel = sctp_is_there_unsent_data(stcb); + some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || @@ -3127,7 +3131,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun chk->data = NULL; } stcb->asoc.ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { break; } @@ -3367,7 +3371,7 @@ process_chunk_drop(struct sctp_tcb *stcb case SCTP_SELECTIVE_ACK: case SCTP_NR_SELECTIVE_ACK: /* resend the sack */ - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); break; case SCTP_HEARTBEAT_REQUEST: /* resend a demand HB */ @@ -3376,7 +3380,7 @@ process_chunk_drop(struct sctp_tcb *stcb * Only retransmit if we KNOW we wont destroy the * tcb */ - (void)sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); } break; case SCTP_SHUTDOWN: @@ -3547,7 +3551,7 @@ sctp_clean_up_stream_reset(struct sctp_t chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore NO_NULL_CHK */ stcb->asoc.str_reset = NULL; } @@ -3987,7 +3991,7 @@ strres_nochunk: sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return (ret_code); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_input.h Fri Feb 10 20:54:20 2012 (r231434) @@ -53,7 +53,7 @@ sctp_reset_in_stream(struct sctp_tcb *st uint16_t * list); -int sctp_is_there_unsent_data(struct sctp_tcb *stcb); +int sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked); #endif #endif Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:54:20 2012 (r231434) @@ -6178,7 +6178,7 @@ sctp_sendall_iterator(struct sctp_inpcb /* shutdown this assoc */ int cnt; - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && @@ -6425,7 +6425,7 @@ sctp_toss_old_cookies(struct sctp_tcb *s chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6454,7 +6454,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6553,7 +6553,11 @@ all_done: } static void -sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc) +sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk, *nchk; @@ -6580,7 +6584,7 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, asoc->ctrl_queue_cnt--; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) asoc->fwd_tsn_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { /* special handling, we must look into the param */ if (chk != asoc->str_reset) { @@ -6660,7 +6664,12 @@ sctp_move_to_outqueue(struct sctp_tcb *s int *locked, int *giveup, int eeor_mode, - int *bail) + int *bail, + int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /* Move from the stream to the send_queue keeping track of the total */ struct sctp_association *asoc; @@ -6731,7 +6740,7 @@ one_more_time: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; stcb->asoc.locked_on_sending = NULL; @@ -6897,7 +6906,7 @@ dont_do_it: chk->last_mbuf = NULL; if (chk->data == NULL) { sp->some_taken = some_taken; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); *bail = 1; to_move = 0; goto out_of; @@ -7001,7 +7010,7 @@ dont_do_it: atomic_add_int(&sp->length, to_move); chk->data = NULL; *bail = 1; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); to_move = 0; goto out_of; } else { @@ -7018,7 +7027,7 @@ dont_do_it: panic("prepend failes HELP?"); #else SCTP_PRINTF("prepend fails HELP?\n"); - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); #endif *bail = 1; to_move = 0; @@ -7140,7 +7149,7 @@ dont_do_it: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; @@ -7163,7 +7172,11 @@ out_of: static void sctp_fill_outqueue(struct sctp_tcb *stcb, - struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) + struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_association *asoc; struct sctp_stream_out *strq, *strqn; @@ -7200,7 +7213,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, - &giveup, eeor_mode, &bail); + &giveup, eeor_mode, &bail, so_locked); if (moved_how_much) stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); @@ -7440,7 +7453,7 @@ nothing_to_send: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, 4, SCTP_CWND_LOG_FILL_OUTQ_CALLED); } - sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now); + sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked); if (quit_now) { /* memory alloc failure */ no_data_chunks = 1; @@ -8378,7 +8391,7 @@ no_data_fill: } else { *reason_code = 5; } - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } @@ -8403,7 +8416,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, chk->copy_by_ref = 0; SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_DONTWAIT); if (op_err == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } chk->send_size = 0; @@ -8992,7 +9005,7 @@ sctp_chunk_retransmission(struct sctp_in return (0); } else { /* Clean up the fwd-tsn list */ - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } } @@ -9446,7 +9459,7 @@ sctp_chunk_output(struct sctp_inpcb *inp * running, if so piggy-back the sack. */ if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - sctp_send_sack(stcb); + sctp_send_sack(stcb, so_locked); (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); } while (asoc->sent_queue_retran_cnt) { @@ -9730,7 +9743,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->whoTo = NULL; chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -9875,7 +9888,11 @@ sctp_fill_in_rest: } void -sctp_send_sack(struct sctp_tcb *stcb) +sctp_send_sack(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /*- * Queue up a SACK or NR-SACK in the control queue. @@ -10017,7 +10034,7 @@ sctp_send_sack(struct sctp_tcb *stcb) sctp_m_freem(a_chk->data); a_chk->data = NULL; } - sctp_free_a_chunk(stcb, a_chk); + sctp_free_a_chunk(stcb, a_chk, so_locked); /* sa_ignore NO_NULL_CHK */ if (stcb->asoc.delayed_ack) { sctp_timer_stop(SCTP_TIMER_TYPE_RECV, @@ -10691,7 +10708,11 @@ sctp_select_hb_destination(struct sctp_t } int -sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net) +sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk; struct sctp_nets *net; @@ -10747,7 +10768,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); return (0); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10836,7 +10857,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; } - sctp_free_a_chunk((struct sctp_tcb *)NULL, chk); + sctp_free_a_chunk((struct sctp_tcb *)NULL, chk, so_locked); return (-1); } } @@ -10892,7 +10913,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb chk->send_size = sizeof(struct sctp_ecne_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10955,7 +10976,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->copy_by_ref = 0; iph = mtod(m, struct ip *); if (iph == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } switch (iph->ip_v) { @@ -10995,7 +11016,7 @@ sctp_send_packet_dropped(struct sctp_tcb * INIT-ACK, because we can't know if the initiation * tag is correct or not. */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; default: break; @@ -11018,7 +11039,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { jump_out: - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11129,7 +11150,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str chk->send_size = sizeof(struct sctp_cwr_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11418,7 +11439,7 @@ sctp_send_str_reset_req(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -12108,7 +12129,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = sctp_copy_one(sp, uio, resv_in_first); skip_copy: if (*error) { - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); sp = NULL; } else { if (sp->sinfo_flags & SCTP_ADDR_OVER) { @@ -13206,7 +13227,7 @@ dataless_eof: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (cnt == 0)) { Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:54:20 2012 (r231434) @@ -152,9 +152,9 @@ sctp_send_abort_tcb(struct sctp_tcb *, s void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); -void sctp_send_sack(struct sctp_tcb *); +void sctp_send_sack(struct sctp_tcb *, int); -int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *); +int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *, int); void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:54:20 2012 (r231434) @@ -4988,7 +4988,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } sctp_free_spbufspace(stcb, asoc, sp); if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid); + sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); /* Free the zone stuff */ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); SCTP_DECR_STRMOQ_COUNT(); @@ -5021,7 +5021,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); atomic_subtract_int(&SCTP_BASE_INFO(ipi_free_chunks), 1); @@ -5043,7 +5043,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); if (chk->whoTo) { sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; @@ -5067,7 +5067,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5081,7 +5081,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5095,7 +5095,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5108,7 +5108,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -6895,7 +6895,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } /* Ok that was fun, now we will drain all the inbound streams? */ @@ -6958,7 +6958,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, asoc->last_revoke_count = cnt; (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); /* sa_ignore NO_NULL_CHK */ - sctp_send_sack(stcb); + 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++; Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:54:20 2012 (r231434) @@ -597,7 +597,7 @@ sctp_recover_sent_list(struct sctp_tcb * } } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } SCTP_PRINTF("after recover order is as follows\n"); @@ -1056,7 +1056,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * no recent feed back in an RTO or * more, request a RTT update */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* * Less than 0 means we lost * the assoc @@ -1120,7 +1120,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * but is in PF state, a PF-heartbeat needs to be sent * manually. */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* Return less than 0 means we lost the association */ return (1); } @@ -1598,7 +1598,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * } /* Send a new HB, this will do threshold managment, pick a new dest */ if (cnt_of_unconf == 0) { - if (sctp_send_hb(stcb, 0, NULL) < 0) { + if (sctp_send_hb(stcb, 0, NULL, SCTP_SO_NOT_LOCKED) < 0) { return (1); } } else { @@ -1620,7 +1620,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * net->src_addr_selected = 0; } } - ret = sctp_send_hb(stcb, 1, net); + ret = sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); if (ret < 0) return 1; else if (ret == 0) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:54:20 2012 (r231434) @@ -3988,7 +3988,7 @@ sctp_setopt(struct socket *so, int optna /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ - if (sctp_send_hb(stcb, 1, net) < 0) { + if (sctp_send_hb(stcb, 1, net, SCTP_SO_LOCKED) < 0) { /* asoc destroyed */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; Modified: stable/8/sys/netinet/sctp_var.h ============================================================================== --- stable/8/sys/netinet/sctp_var.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_var.h Fri Feb 10 20:54:20 2012 (r231434) @@ -87,9 +87,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_strmoq(_stcb, _strmoq) { \ +#define sctp_free_a_strmoq(_stcb, _strmoq, _so_locked) { \ if ((_strmoq)->holds_key_ref) { \ - sctp_auth_key_release(stcb, sp->auth_keyid); \ + sctp_auth_key_release(stcb, sp->auth_keyid, _so_locked); \ (_strmoq)->holds_key_ref = 0; \ } \ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), (_strmoq)); \ @@ -105,9 +105,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_chunk(_stcb, _chk) { \ +#define sctp_free_a_chunk(_stcb, _chk, _so_locked) { \ if ((_chk)->holds_key_ref) {\ - sctp_auth_key_release((_stcb), (_chk)->auth_keyid); \ + sctp_auth_key_release((_stcb), (_chk)->auth_keyid, _so_locked); \ (_chk)->holds_key_ref = 0; \ } \ if (_stcb) { \ Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:54:20 2012 (r231434) @@ -1634,7 +1634,7 @@ sctp_timeout_handler(void *t) } { SCTP_STAT_INCR(sctps_timosack); stcb->asoc.timosack++; - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } #ifdef SCTP_AUDITING_ENABLED sctp_auditing(4, inp, stcb, net); @@ -3656,7 +3656,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } /* pending send queue SHOULD be empty */ @@ -3672,7 +3672,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } for (i = 0; i < asoc->streamoutcnt; i++) { @@ -3697,7 +3697,7 @@ sctp_report_all_outbound(struct sctp_tcb sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* sa_ignore FREED_MEMORY */ } } @@ -5033,7 +5033,7 @@ sctp_user_rcvd(struct sctp_tcb *stcb, ui goto out; } SCTP_STAT_INCR(sctps_wu_sacks_sent); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_USR_RCVD, SCTP_SO_LOCKED); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 20:57:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C69106566B; Fri, 10 Feb 2012 20:57:46 +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 B257D8FC0A; Fri, 10 Feb 2012 20:57: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 q1AKvkxs094106; Fri, 10 Feb 2012 20:57:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKvkBt094103; Fri, 10 Feb 2012 20:57:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102057.q1AKvkBt094103@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231435 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:57:47 -0000 Author: tuexen Date: Fri Feb 10 20:57:46 2012 New Revision: 231435 URL: http://svn.freebsd.org/changeset/base/231435 Log: MFC r221904: Fix the source address selection for boundall sockets when sending INITs to a global IPv4 address having only private IPv4 address. Allow the usage of a private address and make sure that no other private address will be used by the association. Initial work was done by rrs@. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:54:20 2012 (r231434) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:57:46 2012 (r231435) @@ -2022,7 +2022,8 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct mbuf * -sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_scoping *scope, +sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to) { struct sctp_vrf *vrf = NULL; @@ -2056,6 +2057,9 @@ sctp_add_addresses_to_i_ia(struct sctp_i continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2088,6 +2092,9 @@ skip_count: continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2295,32 +2302,46 @@ sctp_is_ifa_addr_acceptable(struct sctp_ { uint8_t dest_is_global = 0; - /* + /** * Here we determine if its a acceptable address. A acceptable * address means it is the same scope or higher scope but we can * allow for NAT which means its ok to have a global dest and a * private src. - * + * * L = loopback, P = private, G = global - * ----------------------------------------- src | dest | result - * ----------------------------------------- L | L | yes - * ----------------------------------------- P | L | - * yes-v4 no-v6 ----------------------------------------- G | - * L | yes ----------------------------------------- L | - * P | no ----------------------------------------- P | P - * | yes ----------------------------------------- G | P - * | yes - May not work ----------------------------------------- - * L | G | no ----------------------------------------- P - * | G | yes - May not work - * ----------------------------------------- G | G | yes + * ----------------------------------------- + * src | dest | result + * ----------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | yes - May not work + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | yes - May not work + * ----------------------------------------- + * G | G | yes * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { /* forget non matching family */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa_fam:%d fam:%d\n", + ifa->address.sa.sa_family, fam); return (NULL); } /* Ok the address may be ok */ + SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT3, &ifa->address.sa); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "dst_is_loop:%d dest_is_priv:%d\n", + dest_is_loop, dest_is_priv); if ((dest_is_loop == 0) && (dest_is_priv == 0)) { dest_is_global = 1; } @@ -2342,12 +2363,19 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * theory be done slicker (it used to be), but this is * straightforward and easier to validate :-) */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_priv:%d\n", + ifa->src_is_loop, + dest_is_priv); if ((ifa->src_is_loop == 1) && (dest_is_priv)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_glob:%d\n", + ifa->src_is_loop, + dest_is_global); if ((ifa->src_is_loop == 1) && (dest_is_global)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "address is acceptable\n"); /* its an acceptable address */ return (ifa); } @@ -2854,6 +2882,10 @@ sctp_choose_boundall(struct sctp_inpcb * uint32_t ifn_index; struct sctp_vrf *vrf; +#ifdef INET + int retried = 0; + +#endif /*- * For boundall we can use any address in the association. * If non_asoc_addr_ok is set we can use any address (at least in @@ -2874,6 +2906,7 @@ sctp_choose_boundall(struct sctp_inpcb * ifn = SCTP_GET_IFN_VOID_FROM_ROUTE(ro); ifn_index = SCTP_GET_IF_INDEX_FROM_ROUTE(ro); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifn from route:%p ifn_index:%d\n", ifn, ifn_index); emit_ifn = looked_at = sctp_ifn = sctp_find_ifn(ifn, ifn_index); if (sctp_ifn == NULL) { /* ?? We don't have this guy ?? */ @@ -2982,22 +3015,30 @@ bound_all_plan_b: } atomic_add_int(&sifa->refcount, 1); return (sifa); - } - +#ifdef INET +again_with_private_addresses_allowed: +#endif /* plan_c: do we have an acceptable address on the emit interface */ + sifa = NULL; SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan C: find acceptable on interface\n"); if (emit_ifn == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jump to Plan D - no emit_ifn\n"); goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && - (non_asoc_addr_ok == 0)) + (non_asoc_addr_ok == 0)) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); continue; + } sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, dest_is_loop, dest_is_priv, fam); - if (sifa == NULL) + if (sifa == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "IFA not acceptable\n"); continue; + } if (stcb) { if (sctp_is_address_in_scope(sifa, stcb->asoc.ipv4_addr_legal, @@ -3006,6 +3047,8 @@ bound_all_plan_b: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3017,11 +3060,15 @@ bound_all_plan_b: * It is restricted for some reason.. * probably not yet added. */ + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Its resticted\n"); + sifa = NULL; continue; } + } else { + printf("Stcb is null - no print\n"); } atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } plan_d: /* @@ -3030,16 +3077,12 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D\n"); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ continue; } - if ((sctp_ifn == looked_at) && looked_at) - /* already looked at this guy */ - continue; - LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) @@ -3057,6 +3100,7 @@ plan_d: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3068,19 +3112,81 @@ plan_d: * It is restricted for some * reason.. probably not yet added. */ + sifa = NULL; continue; } } - atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } } - /* - * Ok we can find NO address to source from that is not on our - * restricted list and non_asoc_address is NOT ok, or it is on our - * restricted list. We can't source to it :-( - */ - return (NULL); +#ifdef INET + if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { + stcb->asoc.ipv4_local_scope = 1; + retried = 1; + goto again_with_private_addresses_allowed; + } else if (retried == 1) { + stcb->asoc.ipv4_local_scope = 0; + } +#endif +out: + if (sifa) { +#ifdef INET + if (retried == 1) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + /* wrong base scope */ + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + struct sctp_ifa *tmp_sifa; + + if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && + (non_asoc_addr_ok == 0)) + continue; + tmp_sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, + dest_is_loop, + dest_is_priv, fam); + if (tmp_sifa == NULL) { + continue; + } + if (tmp_sifa == sifa) { + continue; + } + if (stcb) { + if (sctp_is_address_in_scope(tmp_sifa, + stcb->asoc.ipv4_addr_legal, + stcb->asoc.ipv6_addr_legal, + stcb->asoc.loopback_scope, + stcb->asoc.ipv4_local_scope, + stcb->asoc.local_scope, + stcb->asoc.site_scope, 0) == 0) { + continue; + } + if (((non_asoc_addr_ok == 0) && + (sctp_is_addr_restricted(stcb, tmp_sifa))) || + (non_asoc_addr_ok && + (sctp_is_addr_restricted(stcb, tmp_sifa)) && + (!sctp_is_addr_pending(stcb, tmp_sifa)))) { + /* + * It is restricted + * for some reason.. + * probably not yet + * added. + */ + continue; + } + } + if ((tmp_sifa->address.sin.sin_family == AF_INET) && + (IN4_ISPRIVATE_ADDRESS(&(tmp_sifa->address.sin.sin_addr)))) { + sctp_add_local_addr_restricted(stcb, tmp_sifa); + } + } + } + } + atomic_add_int(&sifa->refcount, 1); + } +#endif + return (sifa); } @@ -3106,7 +3212,7 @@ sctp_source_address_selection(struct sct #endif - /*- + /** * Rules: - Find the route if needed, cache if I can. - Look at * interface address in route, Is it in the bound list. If so we * have the best source. - If not we must rotate amongst the @@ -3509,15 +3615,17 @@ sctp_lowlevel_chunk_output(struct sctp_i ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { - /* - * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet - * header WITH an SCTPHDR but no IP header, endpoint inp and sa - * structure: - fill in the HMAC digest of any AUTH chunk in the - * packet. - calculate and fill in the SCTP checksum. - prepend an - * IP address header. - if boundall use INADDR_ANY. - if - * boundspecific do source address selection. - set fragmentation - * option for ipV4. - On return from IP output, check/adjust mtu - * size of output interface and smallest_mtu size as well. + /** + * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header + * WITH an SCTPHDR but no IP header, endpoint inp and sa structure: + * - fill in the HMAC digest of any AUTH chunk in the packet. + * - calculate and fill in the SCTP checksum. + * - prepend an IP address header. + * - if boundall use INADDR_ANY. + * - if boundspecific do source address selection. + * - set fragmentation option for ipV4. + * - On return from IP output, check/adjust mtu size of output + * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ struct mbuf *o_pak; @@ -4409,7 +4517,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, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -5538,7 +5646,7 @@ do_a_abort: scp.ipv4_local_scope = stc.ipv4_scope; scp.local_scope = stc.local_scope; scp.site_scope = stc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* tack on the operational error if present */ Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:54:20 2012 (r231434) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:57:46 2012 (r231435) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 21:01:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0EC106566B; Fri, 10 Feb 2012 21:01: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 E0AA08FC08; Fri, 10 Feb 2012 21:01: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 q1AL163x094288; Fri, 10 Feb 2012 21:01:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL16Pm094286; Fri, 10 Feb 2012 21:01:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102101.q1AL16Pm094286@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231436 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:01:07 -0000 Author: tuexen Date: Fri Feb 10 21:01:06 2012 New Revision: 231436 URL: http://svn.freebsd.org/changeset/base/231436 Log: MFC r222028: Fix whitespacing. Reported by scf@ Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:57:46 2012 (r231435) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:01:06 2012 (r231436) @@ -2210,26 +2210,26 @@ sctp_is_ifa_addr_preferred(struct sctp_i * means it is the same scope or higher scope then the destination. * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result - * ---------------------------------------- - * L | L | yes - * ----------------------------------------- - * P | L | yes-v4 no-v6 - * ----------------------------------------- - * G | L | yes-v4 no-v6 - * ----------------------------------------- - * L | P | no - * ----------------------------------------- - * P | P | yes - * ----------------------------------------- - * G | P | no - * ----------------------------------------- - * L | G | no - * ----------------------------------------- - * P | G | no - * ----------------------------------------- - * G | G | yes - * ----------------------------------------- + * src | dest | result + * ---------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes-v4 no-v6 + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | no + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | no + * ----------------------------------------- + * G | G | yes + * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { @@ -2310,14 +2310,14 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result + * src | dest | result * ----------------------------------------- * L | L | yes * ----------------------------------------- * P | L | yes-v4 no-v6 * ----------------------------------------- * G | L | yes - * ----------------------------------------- + * ----------------------------------------- * L | P | no * ----------------------------------------- * P | P | yes @@ -2325,7 +2325,7 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * G | P | yes - May not work * ----------------------------------------- * L | G | no - * ----------------------------------------- + * ----------------------------------------- * P | G | yes - May not work * ----------------------------------------- * G | G | yes From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 21:03:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80AFC10656F3; Fri, 10 Feb 2012 21:03:18 +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 6A3BC8FC0C; Fri, 10 Feb 2012 21:03: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 q1AL3IOG094456; Fri, 10 Feb 2012 21:03:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL3IWD094454; Fri, 10 Feb 2012 21:03:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102103.q1AL3IWD094454@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231438 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:03:18 -0000 Author: tuexen Date: Fri Feb 10 21:03:17 2012 New Revision: 231438 URL: http://svn.freebsd.org/changeset/base/231438 Log: MFC r222029: Copy out the mtu when calling getsockopt() with SCTP_GET_PEER_ADDR_INFO. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 21:03:04 2012 (r231437) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 21:03:17 2012 (r231438) @@ -2486,6 +2486,7 @@ flags_out: paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; paddri->spinfo_rto = net->RTO; paddri->spinfo_assoc_id = sctp_get_associd(stcb); + paddri->spinfo_mtu = net->mtu; SCTP_TCB_UNLOCK(stcb); } else { if (stcb) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 21:05:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D918A106566B; Fri, 10 Feb 2012 21:05:34 +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 C3D4C8FC08; Fri, 10 Feb 2012 21:05: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 q1AL5YK6094575; Fri, 10 Feb 2012 21:05:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL5YZ8094573; Fri, 10 Feb 2012 21:05:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102105.q1AL5YZ8094573@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231439 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:05:35 -0000 Author: tuexen Date: Fri Feb 10 21:05:34 2012 New Revision: 231439 URL: http://svn.freebsd.org/changeset/base/231439 Log: MFC r222077: Unbreak INET-less build. Reported by bz@ Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:03:17 2012 (r231438) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:05:34 2012 (r231439) @@ -3129,8 +3129,8 @@ plan_d: } #endif out: - if (sifa) { #ifdef INET + if (sifa) { if (retried == 1) { LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 21:07:53 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A287106566C; Fri, 10 Feb 2012 21:07:53 +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 73EBA8FC08; Fri, 10 Feb 2012 21:07: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 q1AL7rOS094697; Fri, 10 Feb 2012 21:07:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL7rHD094692; Fri, 10 Feb 2012 21:07:53 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102107.q1AL7rHD094692@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231440 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:07:53 -0000 Author: tuexen Date: Fri Feb 10 21:07:52 2012 New Revision: 231440 URL: http://svn.freebsd.org/changeset/base/231440 Log: MFC r222459: Get rid of unused functions. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:07:52 2012 (r231440) @@ -247,49 +247,6 @@ sctp_build_ctl_nchunk(struct sctp_inpcb } -char * -sctp_build_ctl_cchunk(struct sctp_inpcb *inp, - int *control_len, - struct sctp_sndrcvinfo *sinfo) -{ - struct sctp_sndrcvinfo *outinfo; - struct cmsghdr *cmh; - char *buf; - int len; - int use_extended = 0; - - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { - /* user does not want the sndrcv ctl */ - return (NULL); - } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { - use_extended = 1; - len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); - } else { - len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - } - SCTP_MALLOC(buf, char *, len, SCTP_M_CMSG); - if (buf == NULL) { - /* No space */ - return (buf); - } - /* We need a CMSG header followed by the struct */ - cmh = (struct cmsghdr *)buf; - outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); - cmh->cmsg_level = IPPROTO_SCTP; - if (use_extended) { - cmh->cmsg_type = SCTP_EXTRCV; - cmh->cmsg_len = len; - memcpy(outinfo, sinfo, len); - } else { - cmh->cmsg_type = SCTP_SNDRCV; - cmh->cmsg_len = len; - *outinfo = *sinfo; - } - *control_len = len; - return (buf); -} - static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 21:07:52 2012 (r231440) @@ -83,11 +83,6 @@ struct mbuf * sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo); -char * -sctp_build_ctl_cchunk(struct sctp_inpcb *inp, - int *control_len, - struct sctp_sndrcvinfo *sinfo); - void sctp_set_rwnd(struct sctp_tcb *, struct sctp_association *); uint32_t Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 21:07:52 2012 (r231440) @@ -6184,71 +6184,6 @@ sctp_soreceive(struct socket *so, } -int -sctp_l_soreceive(struct socket *so, - struct sockaddr **name, - struct uio *uio, - char **controlp, - int *controllen, - int *flag) -{ - int error, fromlen; - uint8_t sockbuf[256]; - struct sockaddr *from; - struct sctp_extrcvinfo sinfo; - int filling_sinfo = 1; - struct sctp_inpcb *inp; - - inp = (struct sctp_inpcb *)so->so_pcb; - /* pickup the assoc we are reading from */ - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - return (EINVAL); - } - if ((sctp_is_feature_off(inp, - SCTP_PCB_FLAGS_RECVDATAIOEVNT)) || - (controlp == NULL)) { - /* user does not want the sndrcv ctl */ - filling_sinfo = 0; - } - if (name) { - from = (struct sockaddr *)sockbuf; - fromlen = sizeof(sockbuf); - from->sa_len = 0; - } else { - from = NULL; - fromlen = 0; - } - - error = sctp_sorecvmsg(so, uio, - (struct mbuf **)NULL, - from, fromlen, flag, - (struct sctp_sndrcvinfo *)&sinfo, - filling_sinfo); - if ((controlp) && (filling_sinfo)) { - /* - * copy back the sinfo in a CMSG format note that the caller - * has reponsibility for freeing the memory. - */ - if (filling_sinfo) - *controlp = sctp_build_ctl_cchunk(inp, - controllen, - (struct sctp_sndrcvinfo *)&sinfo); - } - if (name) { - /* copy back the address info */ - if (from && from->sa_len) { - *name = sodupsockaddr(from, M_WAIT); - } else { - *name = NULL; - } - } - return (error); -} - - - - Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 21:07:52 2012 (r231440) @@ -328,20 +328,6 @@ sctp_soreceive(struct socket *so, struct struct mbuf **controlp, int *flagsp); - -/* For those not passing mbufs, this does the - * translations for you. Caller owns memory - * of size controllen returned in controlp. - */ -int -sctp_l_soreceive(struct socket *so, - struct sockaddr **name, - struct uio *uio, - char **controlp, - int *controllen, - int *flag); - - void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 21:28:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D5661065678; Fri, 10 Feb 2012 21:28: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 73FC18FC13; Fri, 10 Feb 2012 21:28: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 q1ALSdmc095632; Fri, 10 Feb 2012 21:28:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALSd6B095624; Fri, 10 Feb 2012 21:28:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102128.q1ALSd6B095624@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231442 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:28:39 -0000 Author: tuexen Date: Fri Feb 10 21:28:38 2012 New Revision: 231442 URL: http://svn.freebsd.org/changeset/base/231442 Log: MFC r223132: Add support for the newly added SCTP API. In particular add support for: * SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and SCTP_DSTADDRV6 cmsgs. * SCTP_NXTINFO and SCTP_RCVINFO cmgs. * SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO socket option. * Special association ids (SCTP_FUTURE_ASSOC, ...) * sctp_recvv() and sctp_sendv() functions. Modified because SCTP_MAXBURST was not backported. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:28:38 2012 (r231442) @@ -141,7 +141,7 @@ in6_sin6_2_sin(struct sockaddr_in *sin, int sctp_getaddrlen(sa_family_t family) { - int error, sd; + int ret, sd; socklen_t siz; struct sctp_assoc_value av; @@ -151,13 +151,15 @@ sctp_getaddrlen(sa_family_t family) sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); #elif defined(AF_INET6) sd = socket(AF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP); +#else + sd = -1; #endif if (sd == -1) { return (-1); } - error = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); + ret = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); close(sd); - if (error == 0) { + if (ret == 0) { return ((int)av.assoc_value); } else { return (-1); @@ -402,6 +404,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_TIMEOUTS: ((struct sctp_timeouts *)arg)->stimo_assoc_id = id; break; + case SCTP_EVENT: + ((struct sctp_event *)arg)->se_assoc_id = id; + break; default: break; } @@ -919,32 +924,259 @@ sctp_recvmsg(int s, #endif } +ssize_t +sctp_recvv(int sd, + const struct iovec *iov, + int iovlen, + struct sockaddr *from, + socklen_t * fromlen, + void *info, + socklen_t * infolen, + unsigned int *infotype, + int *flags) +{ + char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + struct msghdr msg; + struct cmsghdr *cmsg; + ssize_t n; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; -#if defined(HAVE_SCTP_PEELOFF_SOCKOPT) -#include + if (infotype) { + *infotype = SCTP_RECVV_NOINFO; + } + msg.msg_name = from; + if (fromlen == NULL) { + msg.msg_namelen = 0; + } else { + msg.msg_namelen = *fromlen; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovlen; + msg.msg_control = ctlbuf; + msg.msg_controllen = sizeof(ctlbuf); + errno = 0; + n = recvmsg(sd, &msg, *flags); + *flags = msg.msg_flags; + if ((n > 0) && + (msg.msg_controllen > 0) && + (infotype != NULL) && + (infolen != NULL) && + (*infolen > 0)) { + rcvinfo = NULL; + nxtinfo = NULL; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_RCVINFO) { + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + } + if (cmsg->cmsg_type == SCTP_NXTINFO) { + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); + } + if (rcvinfo && nxtinfo) { + break; + } + } + if (rcvinfo) { + if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_recvv_rn)) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } + } else { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; + } + } + } else if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); + *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); + *infotype = SCTP_RECVV_NXTINFO; + } + } + } + return (n); +} -int -sctp_peeloff(int sd, sctp_assoc_t assoc_id) +ssize_t +sctp_sendv(int sd, + const struct iovec *iov, int iovcnt, + struct sockaddr *addrs, int addrcnt, + void *info, socklen_t infolen, unsigned int infotype, + int flags) { - struct sctp_peeloff_opt peeloff; - int result; - socklen_t optlen; - - /* set in the socket option params */ - memset(&peeloff, 0, sizeof(peeloff)); - peeloff.s = sd; - peeloff.assoc_id = assoc_id; - optlen = sizeof(peeloff); - result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen); + ssize_t ret; + int i; + size_t addr_len; + struct sctp_sendv_spa *spa_info; + struct msghdr msg; + struct cmsghdr *cmsg; + char *cmsgbuf; + struct sockaddr *addr; + struct sockaddr_in *addr_in; + struct sockaddr_in6 *addr_in6; - if (result < 0) { + if ((addrcnt < 0) || (iovcnt < 0)) { + errno = EINVAL; + return (-1); + } + 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))); + if (cmsgbuf == NULL) { + errno = ENOBUFS; return (-1); + } + msg.msg_control = cmsgbuf; + msg.msg_controllen = 0; + cmsg = (struct cmsghdr *)cmsgbuf; + switch (infotype) { + case SCTP_SENDV_SNDINFO: + if (infolen < sizeof(struct sctp_sndinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + break; + case SCTP_SENDV_PRINFO: + if (infolen < sizeof(struct sctp_prinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + break; + case SCTP_SENDV_AUTHINFO: + if (infolen < sizeof(struct sctp_authinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + break; + case SCTP_SENDV_SPA: + if (infolen < sizeof(struct sctp_sendv_spa)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + spa_info = (struct sctp_sendv_spa *)info; + if (spa_info->sendv_flags & SCTP_SEND_SNDINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_prinfo, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_AUTHINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_authinfo, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + } + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = addrs; + if (addrcnt == 1) { + msg.msg_name = addr; + switch (addr->sa_family) { + case AF_INET: + msg.msg_namelen = sizeof(struct sockaddr_in); + break; + case AF_INET6: + msg.msg_namelen = sizeof(struct sockaddr_in6); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } } else { - return (peeloff.new_sd); + msg.msg_name = NULL; + msg.msg_namelen = 0; + for (i = 0; i < addrcnt; i++) { + switch (addr->sa_family) { + case AF_INET: + addr_len = sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + break; + case AF_INET6: + addr_len = sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovcnt; + msg.msg_flags = 0; + ret = sendmsg(sd, &msg, flags); + free(cmsgbuf); + return (ret); } -#endif #if !defined(SYS_sctp_peeloff) && !defined(HAVE_SCTP_PEELOFF_SOCKOPT) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 21:28:38 2012 (r231442) @@ -91,7 +91,7 @@ struct sctp_paramhdr { #define SCTP_PEER_ADDR_PARAMS 0x0000000a #define SCTP_DEFAULT_SEND_PARAM 0x0000000b /* ancillary data/notification interest options */ -#define SCTP_EVENTS 0x0000000c +#define SCTP_EVENTS 0x0000000c /* deprecated */ /* Without this applied we will give V4 and V6 addresses on a V6 socket */ #define SCTP_I_WANT_MAPPED_V4_ADDR 0x0000000d #define SCTP_MAXSEG 0x0000000e @@ -114,6 +114,10 @@ struct sctp_paramhdr { #define SCTP_EXPLICIT_EOR 0x0000001b #define SCTP_REUSE_PORT 0x0000001c /* rw */ #define SCTP_AUTH_DEACTIVATE_KEY 0x0000001d +#define SCTP_EVENT 0x0000001e +#define SCTP_RECVRCVINFO 0x0000001f +#define SCTP_RECVNXTINFO 0x00000020 +#define SCTP_DEFAULT_SNDINFO 0x00000021 /* * read-only options @@ -490,7 +494,7 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ -#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 +#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */ #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004 #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008 #define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x00000010 @@ -500,7 +504,7 @@ struct sctp_error_unrecognized_chunk { /* socket options */ #define SCTP_PCB_FLAGS_NODELAY 0x00000100 #define SCTP_PCB_FLAGS_AUTOCLOSE 0x00000200 -#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 +#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 /* deprecated */ #define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x00000800 #define SCTP_PCB_FLAGS_RECVPADDREVNT 0x00001000 #define SCTP_PCB_FLAGS_RECVPEERERR 0x00002000 @@ -516,6 +520,9 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x01000000 #define SCTP_PCB_FLAGS_PORTREUSE 0x02000000 #define SCTP_PCB_FLAGS_DRYEVNT 0x04000000 +#define SCTP_PCB_FLAGS_RECVRCVINFO 0x08000000 +#define SCTP_PCB_FLAGS_RECVNXTINFO 0x10000000 + /*- * mobility_features parameters (by micchie).Note * these features are applied against the Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 21:28:38 2012 (r231442) @@ -1866,7 +1866,7 @@ sctp_notify_authentication(struct sctp_t /* If the socket is gone we are out of here */ return; } - if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTHEVNT)) + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ return; Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:28:38 2012 (r231442) @@ -201,48 +201,110 @@ failed_build: struct mbuf * -sctp_build_ctl_nchunk(struct sctp_inpcb *inp, - struct sctp_sndrcvinfo *sinfo) +sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) { + struct sctp_extrcvinfo *seinfo; struct sctp_sndrcvinfo *outinfo; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; struct cmsghdr *cmh; struct mbuf *ret; int len; - int use_extended = 0; + int use_extended; + int provide_nxt; - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { - /* user does not want the sndrcv ctl */ + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) { + /* user does not want any ancillary data */ return (NULL); } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { - use_extended = 1; - len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + len = 0; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + seinfo = (struct sctp_extrcvinfo *)sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) && + (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) { + provide_nxt = 1; + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); } else { - len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + provide_nxt = 0; + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { + use_extended = 1; + len += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + use_extended = 0; + len += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } + } else { + use_extended = 0; } - - ret = sctp_get_mbuf_for_msg(len, - 0, M_DONTWAIT, 1, MT_DATA); - + ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); if (ret == NULL) { /* No space */ return (ret); } - /* We need a CMSG header followed by the struct */ + SCTP_BUF_LEN(ret) = 0; + + /* We need a CMSG header followed by the struct */ cmh = mtod(ret, struct cmsghdr *); - outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); - cmh->cmsg_level = IPPROTO_SCTP; - if (use_extended) { - cmh->cmsg_type = SCTP_EXTRCV; - cmh->cmsg_len = len; - memcpy(outinfo, sinfo, len); - } else { - cmh->cmsg_type = SCTP_SNDRCV; - cmh->cmsg_len = len; - *outinfo = *sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo)); + cmh->cmsg_type = SCTP_RCVINFO; + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmh); + rcvinfo->rcv_sid = sinfo->sinfo_stream; + rcvinfo->rcv_ssn = sinfo->sinfo_ssn; + rcvinfo->rcv_flags = sinfo->sinfo_flags; + rcvinfo->rcv_ppid = sinfo->sinfo_ppid; + rcvinfo->rcv_tsn = sinfo->sinfo_tsn; + rcvinfo->rcv_cumtsn = sinfo->sinfo_cumtsn; + rcvinfo->rcv_context = sinfo->sinfo_context; + rcvinfo->rcv_assoc_id = sinfo->sinfo_assoc_id; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_rcvinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + if (provide_nxt) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo)); + cmh->cmsg_type = SCTP_NXTINFO; + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh); + nxtinfo->nxt_sid = seinfo->sreinfo_next_stream; + nxtinfo->nxt_flags = 0; + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) { + nxtinfo->nxt_flags |= SCTP_UNORDERED; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) { + nxtinfo->nxt_flags |= SCTP_NOTIFICATION; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) { + nxtinfo->nxt_flags |= SCTP_COMPLETE; + } + nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid; + nxtinfo->nxt_length = seinfo->sreinfo_next_length; + nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo)); + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + cmh->cmsg_level = IPPROTO_SCTP; + outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); + if (use_extended) { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + cmh->cmsg_type = SCTP_EXTRCV; + memcpy(outinfo, sinfo, sizeof(struct sctp_extrcvinfo)); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + cmh->cmsg_type = SCTP_SNDRCV; + *outinfo = *sinfo; + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } } - SCTP_BUF_LEN(ret) = cmh->cmsg_len; return (ret); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:28:38 2012 (r231442) @@ -3355,54 +3355,338 @@ sctp_source_address_selection(struct sct } static int -sctp_find_cmsg(int c_type, void *data, struct mbuf *control, int cpsize) +sctp_find_cmsg(int c_type, void *data, struct mbuf *control, size_t cpsize) { struct cmsghdr cmh; - int tlen, at; + int tlen, at, found; + struct sctp_sndinfo sndinfo; + struct sctp_prinfo prinfo; + struct sctp_authinfo authinfo; tlen = SCTP_BUF_LEN(control); at = 0; + found = 0; /* * Independent of how many mbufs, find the c_type inside the control * structure and copy out the data. */ while (at < tlen) { if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { - /* not enough room for one more we are done. */ - return (0); + /* There is not enough room for one more. */ + return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + return (found); + } if (((int)cmh.cmsg_len + at) > tlen) { - /* - * this is real messed up since there is not enough - * data here to cover the cmsg header. We are done. - */ - return (0); + /* We don't have the complete CMSG. */ + return (found); } if ((cmh.cmsg_level == IPPROTO_SCTP) && - (c_type == cmh.cmsg_type)) { - /* found the one we want, copy it out */ - at += CMSG_ALIGN(sizeof(struct cmsghdr)); - if ((int)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { - /* - * space of cmsg_len after header not big - * enough - */ - return (0); + ((c_type == cmh.cmsg_type) || + ((c_type == SCTP_SNDRCV) && + ((cmh.cmsg_type == SCTP_SNDINFO) || + (cmh.cmsg_type == SCTP_PRINFO) || + (cmh.cmsg_type == SCTP_AUTHINFO))))) { + if (c_type == cmh.cmsg_type) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + return (found); + } + /* It is exactly what we want. Copy it out. */ + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + return (1); + } else { + struct sctp_sndrcvinfo *sndrcvinfo; + + sndrcvinfo = (struct sctp_sndrcvinfo *)data; + if (found == 0) { + if (cpsize < sizeof(struct sctp_sndrcvinfo)) { + return (found); + } + memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); + } + switch (cmh.cmsg_type) { + case SCTP_SNDINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + sndrcvinfo->sinfo_stream = sndinfo.snd_sid; + sndrcvinfo->sinfo_flags = sndinfo.snd_flags; + sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; + sndrcvinfo->sinfo_context = sndinfo.snd_context; + sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; + break; + case SCTP_PRINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + sndrcvinfo->sinfo_timetolive = prinfo.pr_value; + sndrcvinfo->sinfo_flags |= prinfo.pr_policy; + break; + case SCTP_AUTHINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + sndrcvinfo->sinfo_keynumber_valid = 1; + sndrcvinfo->sinfo_keynumber = authinfo.auth_keyid; + break; + default: + return (found); + } + found = 1; } - m_copydata(control, at, cpsize, data); + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (found); +} + +static int +sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_initmsg initmsg; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; return (1); - } else { - at += CMSG_ALIGN(cmh.cmsg_len); - if (cmh.cmsg_len == 0) { + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (1); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (1); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { + case SCTP_INIT: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + *error = EINVAL; + return (1); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + if (initmsg.sinit_max_attempts) + stcb->asoc.max_init_times = initmsg.sinit_max_attempts; + if (initmsg.sinit_num_ostreams) + stcb->asoc.pre_open_streams = initmsg.sinit_num_ostreams; + if (initmsg.sinit_max_instreams) + stcb->asoc.max_inbound_streams = initmsg.sinit_max_instreams; + if (initmsg.sinit_max_init_timeo) + stcb->asoc.initial_init_rto_max = initmsg.sinit_max_init_timeo; + if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) { + struct sctp_stream_out *tmp_str; + unsigned int i; + + /* Default is NOT correct */ + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, default:%d pre_open:%d\n", + stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams); + SCTP_TCB_UNLOCK(stcb); + SCTP_MALLOC(tmp_str, + struct sctp_stream_out *, + (stcb->asoc.pre_open_streams * sizeof(struct sctp_stream_out)), + SCTP_M_STRMO); + SCTP_TCB_LOCK(stcb); + if (tmp_str != NULL) { + SCTP_FREE(stcb->asoc.strmout, SCTP_M_STRMO); + stcb->asoc.strmout = tmp_str; + stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt = stcb->asoc.pre_open_streams; + } else { + stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; + } + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_sent = 0; + TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].stream_no = i; + stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); + } + } + break; +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { + *error = EINVAL; + return (-1); + } +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + } else +#endif + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif + default: break; } } + at += CMSG_ALIGN(cmh.cmsg_len); } - /* not found */ return (0); } +static struct sctp_tcb * +sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, + in_port_t port, + struct mbuf *control, + struct sctp_nets **net_p, + int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_tcb *stcb; + struct sockaddr *addr; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; + return (NULL); + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (NULL); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (NULL); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + addr = (struct sockaddr *)&sin; + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + addr = (struct sockaddr *)&sin; + } else +#endif + addr = (struct sockaddr *)&sin6; + break; +#endif + default: + addr = NULL; + break; + } + if (addr) { + stcb = sctp_findassociation_ep_addr(inp_p, addr, net_p, NULL, NULL); + if (stcb != NULL) { + return (stcb); + } + } + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (NULL); +} + static struct mbuf * sctp_add_cookie(struct sctp_inpcb *inp, struct mbuf *init, int init_offset, struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t ** signature) @@ -5989,19 +6273,26 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->some_taken = 0; sp->data = m; sp->tail_mbuf = NULL; - sp->length = 0; - at = m; sctp_set_prsctp_policy(sp); /* * We could in theory (for sendall) sifa the length in, but we would * still have to hunt through the chain since we need to setup the * tail_mbuf */ - while (at) { + sp->length = 0; + for (at = m; at; at = SCTP_BUF_NEXT(at)) { if (SCTP_BUF_NEXT(at) == NULL) sp->tail_mbuf = at; sp->length += SCTP_BUF_LEN(at); - at = SCTP_BUF_NEXT(at); + } + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } + if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { + sctp_auth_key_acquire(stcb, sp->auth_keyid); + sp->holds_key_ref = 1; } SCTP_TCB_SEND_LOCK(stcb); sctp_snd_sb_alloc(stcb, sp->length); @@ -6478,7 +6769,9 @@ sctp_sendall(struct sctp_inpcb *inp, str memset(ca, 0, sizeof(struct sctp_copy_all)); ca->inp = inp; - memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + if (srcv) { + memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + } /* * take off the sendall flag, it would be bad if we failed to do * this :-0 @@ -12229,9 +12522,13 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = 0; goto skip_copy; } - sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { - sctp_auth_key_acquire(stcb, stcb->asoc.authinfo.active_keyid); + sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } *error = sctp_copy_one(sp, uio, resv_in_first); @@ -12263,8 +12560,8 @@ sctp_sosend(struct socket *so, struct thread *p ) { - int error, use_rcvinfo = 0; - struct sctp_sndrcvinfo srcv; + int error, use_sndinfo = 0; + struct sctp_sndrcvinfo sndrcvninfo; struct sockaddr *addr_to_use; #if defined(INET) && defined(INET6) @@ -12274,10 +12571,10 @@ sctp_sosend(struct socket *so, if (control) { /* process cmsg snd/rcv info (maybe a assoc-id) */ - if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&srcv, control, - sizeof(srcv))) { + if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&sndrcvninfo, control, + sizeof(sndrcvninfo))) { /* got one */ - use_rcvinfo = 1; + use_sndinfo = 1; } } addr_to_use = addr; @@ -12295,7 +12592,7 @@ sctp_sosend(struct socket *so, error = sctp_lower_sosend(so, addr_to_use, uio, top, control, flags, - use_rcvinfo ? &srcv : NULL + use_sndinfo ? &sndrcvninfo : NULL ,p ); return (error); @@ -12500,6 +12797,9 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); /* With the lock applied look again */ stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); + if ((stcb == NULL) && (control != NULL) && (port > 0)) { + stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); + } if (stcb == NULL) { SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); @@ -12507,6 +12807,9 @@ sctp_lower_sosend(struct socket *so, } else { hold_tcblock = 1; } + if (error) { + goto out_unlocked; + } if (t_inp != inp) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); error = ENOTCONN; @@ -12555,6 +12858,7 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } + hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = 0; @@ -12574,84 +12878,13 @@ sctp_lower_sosend(struct socket *so, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:06:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543951065670; Fri, 10 Feb 2012 22:06:09 +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 3A0318FC08; Fri, 10 Feb 2012 22:06: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 q1AM697j097586; Fri, 10 Feb 2012 22:06:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AM68Km097583; Fri, 10 Feb 2012 22:06:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102206.q1AM68Km097583@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231444 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:06:09 -0000 Author: tuexen Date: Fri Feb 10 22:06:08 2012 New Revision: 231444 URL: http://svn.freebsd.org/changeset/base/231444 Log: MFC r223152: * Fix the handling of addresses in sctp_sendv(). * Add support for SCTP_SENDV_NOINFO. * Improve the error handling of sctp_sendv() and sctp_recv(). Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:33:12 2012 (r231443) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:06:08 2012 (r231444) @@ -942,6 +942,12 @@ sctp_recvv(int sd, struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; + if (((info != NULL) && (infolen == NULL)) | + ((info == NULL) && (infolen != NULL) && (*infolen != 0)) || + ((info != NULL) && (infotype == NULL))) { + errno = EINVAL; + return (-1); + } if (infotype) { *infotype = SCTP_RECVV_NOINFO; } @@ -1017,16 +1023,22 @@ sctp_sendv(int sd, { ssize_t ret; int i; - size_t addr_len; - struct sctp_sendv_spa *spa_info; + socklen_t addr_len; struct msghdr msg; + in_port_t port; + struct sctp_sendv_spa *spa_info; struct cmsghdr *cmsg; char *cmsgbuf; struct sockaddr *addr; struct sockaddr_in *addr_in; struct sockaddr_in6 *addr_in6; - if ((addrcnt < 0) || (iovcnt < 0)) { + if ((addrcnt < 0) || + (iovcnt < 0) || + ((addr == NULL) && (addrcnt > 0)) || + ((addr != NULL) && (addrcnt == 0)) || + ((iov == NULL) && (iovcnt > 0)) || + ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; return (-1); } @@ -1042,8 +1054,15 @@ sctp_sendv(int sd, msg.msg_controllen = 0; cmsg = (struct cmsghdr *)cmsgbuf; switch (infotype) { + case SCTP_SENDV_NOINFO: + if ((infolen != 0) || (info != NULL)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + break; case SCTP_SENDV_SNDINFO: - if (infolen < sizeof(struct sctp_sndinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sndinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1056,7 +1075,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); break; case SCTP_SENDV_PRINFO: - if (infolen < sizeof(struct sctp_prinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1069,7 +1088,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); break; case SCTP_SENDV_AUTHINFO: - if (infolen < sizeof(struct sctp_authinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_authinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1082,7 +1101,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); break; case SCTP_SENDV_SPA: - if (infolen < sizeof(struct sctp_sendv_spa)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sendv_spa))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1119,52 +1138,74 @@ sctp_sendv(int sd, return (-1); } addr = addrs; - if (addrcnt == 1) { - msg.msg_name = addr; + msg.msg_name = NULL; + msg.msg_namelen = 0; + + for (i = 0; i < addrcnt; i++) { switch (addr->sa_family) { case AF_INET: - msg.msg_namelen = sizeof(struct sockaddr_in); + addr_len = (socklen_t) sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + if (addr_in->sin_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in->sin_port; + } else { + if (port == addr_in->sin_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; case AF_INET6: - msg.msg_namelen = sizeof(struct sockaddr_in6); + addr_len = (socklen_t) sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + if (addr_in6->sin6_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in6->sin6_port; + } else { + if (port == addr_in6->sin6_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; default: free(cmsgbuf); errno = EINVAL; return (-1); } - } else { - msg.msg_name = NULL; - msg.msg_namelen = 0; - for (i = 0; i < addrcnt; i++) { - switch (addr->sa_family) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - addr_in = (struct sockaddr_in *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV4; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); - break; - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - addr_in6 = (struct sockaddr_in6 *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV6; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); - break; - default: - free(cmsgbuf); - errno = EINVAL; - return (-1); - } - addr = (struct sockaddr *)((caddr_t)addr + addr_len); + if (i == 0) { + msg.msg_name = addr; + msg.msg_namelen = addr_len; } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; } if (msg.msg_controllen == 0) { msg.msg_control = NULL; Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 21:33:12 2012 (r231443) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:06:08 2012 (r231444) @@ -201,6 +201,7 @@ struct sctp_recvv_rn { #define SCTP_RECVV_NXTINFO 2 #define SCTP_RECVV_RN 3 +#define SCTP_SENDV_NOINFO 0 #define SCTP_SENDV_SNDINFO 1 #define SCTP_SENDV_PRINFO 2 #define SCTP_SENDV_AUTHINFO 3 From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:07:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD291065670; Fri, 10 Feb 2012 22:07:52 +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 EE7DB8FC12; Fri, 10 Feb 2012 22:07: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 q1AM7pK9097679; Fri, 10 Feb 2012 22:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AM7pFK097677; Fri, 10 Feb 2012 22:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102207.q1AM7pFK097677@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231445 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:07:52 -0000 Author: tuexen Date: Fri Feb 10 22:07:51 2012 New Revision: 231445 URL: http://svn.freebsd.org/changeset/base/231445 Log: MFC r223154: Fix two typos and remove redundant code. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:06:08 2012 (r231444) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:07:51 2012 (r231445) @@ -1035,8 +1035,8 @@ sctp_sendv(int sd, if ((addrcnt < 0) || (iovcnt < 0) || - ((addr == NULL) && (addrcnt > 0)) || - ((addr != NULL) && (addrcnt == 0)) || + ((addrs == NULL) && (addrcnt > 0)) || + ((addrs != NULL) && (addrcnt == 0)) || ((iov == NULL) && (iovcnt > 0)) || ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; @@ -1207,9 +1207,6 @@ sctp_sendv(int sd, if (msg.msg_controllen == 0) { msg.msg_control = NULL; } - if (msg.msg_controllen == 0) { - msg.msg_control = NULL; - } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovcnt; msg.msg_flags = 0; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:10:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 776FF106564A; Fri, 10 Feb 2012 22:10:37 +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 61FC08FC0A; Fri, 10 Feb 2012 22:10:37 +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 q1AMAbqI097806; Fri, 10 Feb 2012 22:10:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMAbHA097802; Fri, 10 Feb 2012 22:10:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102210.q1AMAbHA097802@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231446 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:10:37 -0000 Author: tuexen Date: Fri Feb 10 22:10:36 2012 New Revision: 231446 URL: http://svn.freebsd.org/changeset/base/231446 Log: MFC 223162: Add SCTP_DEFAULT_PRINFO socket option. Fix the SCTP_DEFAULT_SNDINFO socket option: Don't clear the PR SCTP policy when setting sinfo_flags. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 22:10:36 2012 (r231446) @@ -118,6 +118,7 @@ struct sctp_paramhdr { #define SCTP_RECVRCVINFO 0x0000001f #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 +#define SCTP_DEFAULT_PRINFO 0x00000022 /* * read-only options Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:10:36 2012 (r231446) @@ -162,6 +162,12 @@ struct sctp_prinfo { uint32_t pr_value; }; +struct sctp_default_prinfo { + uint16_t pr_policy; + uint32_t pr_value; + sctp_assoc_t pr_assoc_id; +}; + struct sctp_authinfo { uint16_t auth_keyid; }; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:10:36 2012 (r231446) @@ -3021,6 +3021,7 @@ flags_out: if (stcb) { info->snd_sid = stcb->asoc.def_send.sinfo_stream; info->snd_flags = stcb->asoc.def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = stcb->asoc.def_send.sinfo_ppid; info->snd_context = stcb->asoc.def_send.sinfo_context; SCTP_TCB_UNLOCK(stcb); @@ -3029,6 +3030,7 @@ flags_out: SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = inp->def_send.sinfo_ppid; info->snd_context = inp->def_send.sinfo_context; SCTP_INP_RUNLOCK(inp); @@ -3042,6 +3044,33 @@ flags_out: } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, *optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (stcb) { + info->pr_policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); + info->pr_value = stcb->asoc.def_send.sinfo_timetolive; + SCTP_TCB_UNLOCK(stcb); + } else { + if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) { + SCTP_INP_RLOCK(inp); + info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); + info->pr_value = inp->def_send.sinfo_timetolive; + 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_default_prinfo); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -5015,6 +5044,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_DEFAULT_SNDINFO: { struct sctp_sndinfo *info; + uint16_t policy; SCTP_CHECK_AND_CAST(info, optval, struct sctp_sndinfo, optsize); SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id); @@ -5022,7 +5052,9 @@ sctp_setopt(struct socket *so, int optna if (stcb) { if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } else { @@ -5035,7 +5067,9 @@ sctp_setopt(struct socket *so, int optna (info->snd_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); inp->def_send.sinfo_flags = info->snd_flags; + inp->def_send.sinfo_flags |= policy; inp->def_send.sinfo_ppid = info->snd_ppid; inp->def_send.sinfo_context = info->snd_context; SCTP_INP_WUNLOCK(inp); @@ -5047,7 +5081,9 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } @@ -5058,6 +5094,44 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (PR_SCTP_INVALID_POLICY(info->pr_policy)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; + } + if (stcb) { + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->def_send.sinfo_flags &= 0xfff0; + inp->def_send.sinfo_flags |= info->pr_policy; + SCTP_INP_WUNLOCK(inp); + } + if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_RLOCK(inp); + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + SCTP_TCB_LOCK(stcb); + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_RUNLOCK(inp); + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:13:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF19106564A; Fri, 10 Feb 2012 22:13:11 +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 BA7B78FC18; Fri, 10 Feb 2012 22:13: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 q1AMDBe1097942; Fri, 10 Feb 2012 22:13:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMDBtY097940; Fri, 10 Feb 2012 22:13:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102213.q1AMDBtY097940@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231447 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:13:11 -0000 Author: tuexen Date: Fri Feb 10 22:13:11 2012 New Revision: 231447 URL: http://svn.freebsd.org/changeset/base/231447 Log: MFC r223178: Update the list of supported socket options for sctp_opt_info(). Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:10:36 2012 (r231446) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:13:11 2012 (r231447) @@ -365,9 +365,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_SEND_PARAM: ((struct sctp_assocparams *)arg)->sasoc_assoc_id = id; break; - case SCTP_SET_PEER_PRIMARY_ADDR: - ((struct sctp_setpeerprim *)arg)->sspp_assoc_id = id; - break; case SCTP_PRIMARY_ADDR: ((struct sctp_setprim *)arg)->ssp_assoc_id = id; break; @@ -407,6 +404,12 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_EVENT: ((struct sctp_event *)arg)->se_assoc_id = id; break; + case SCTP_DEFAULT_SNDINFO: + ((struct sctp_sndinfo *)arg)->snd_assoc_id = id; + break; + case SCTP_DEFAULT_PRINFO: + ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; + break; default: break; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:14:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F8C7106564A; Fri, 10 Feb 2012 22:14: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 789788FC1D; Fri, 10 Feb 2012 22:14: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 q1AMEZXs098028; Fri, 10 Feb 2012 22:14:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMEZ9C098026; Fri, 10 Feb 2012 22:14:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102214.q1AMEZ9C098026@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231448 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:14:35 -0000 Author: tuexen Date: Fri Feb 10 22:14:34 2012 New Revision: 231448 URL: http://svn.freebsd.org/changeset/base/231448 Log: MFC r223225: Document the latest changes to sctp_opt_info() in the code. This makes sctp_opt_info() compiliant with the latest version of the socket API ID. Modified: stable/8/lib/libc/net/sctp_opt_info.3 Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_opt_info.3 ============================================================================== --- stable/8/lib/libc/net/sctp_opt_info.3 Fri Feb 10 22:13:11 2012 (r231447) +++ stable/8/lib/libc/net/sctp_opt_info.3 Fri Feb 10 22:14:34 2012 (r231448) @@ -32,7 +32,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd June 18, 2011 .Dt SCTP_OPT_INFO 3 .Os .Sh NAME @@ -76,14 +76,30 @@ socket options. .Pp .Dv SCTP_PRIMARY_ADDR .Pp -.Dv SCTP_SET_PEER_PRIMARY_ADDR +.Dv SCTP_PEER_ADDR_PARAMS .Pp -.Dv SCTP_STATUS +.Dv SCTP_DEFAULT_SEND_PARAM .Pp -.Dv SCTP_GET_PEER_ADDR_INFO +.Dv SCTP_MAX_SEG .Pp .Dv SCTP_AUTH_ACTIVE_KEY .Pp +.Dv SCTP_DELAYED_SACK +.Pp +.Dv SCTP_MAX_BURST +.Pp +.Dv SCTP_CONTEXT +.Pp +.Dv SCTP_EVENT +.Pp +.Dv SCTP_DEFAULT_SNDINFO +.Pp +.Dv SCTP_DEFAULT_PRINFO +.Pp +.Dv SCTP_STATUS +.Pp +.Dv SCTP_GET_PEER_ADDR_INFO +.Pp .Dv SCTP_PEER_AUTH_CHUNKS .Pp .Dv SCTP_LOCAL_AUTH_CHUNKS @@ -115,3 +131,14 @@ is not a socket. .Sh SEE ALSO .Xr getsockopt 2 , .Xr sctp 4 +.Sh BUGS +Because the structure used for +.Fa arg +of the +.Dv SCTP_MAX_BURST +socket option has changed in FreeBSD 9.0 and higher, +using +.Dv SCTP_MAX_BURST +as +.Fa opt +is only supported in FreeBSD 9.0 and higher. From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:16:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A00451065672; Fri, 10 Feb 2012 22:16:52 +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 8A2988FC1C; Fri, 10 Feb 2012 22:16: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 q1AMGqlp098252; Fri, 10 Feb 2012 22:16:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMGqAf098250; Fri, 10 Feb 2012 22:16:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102216.q1AMGqAf098250@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231450 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:16:52 -0000 Author: tuexen Date: Fri Feb 10 22:16:52 2012 New Revision: 231450 URL: http://svn.freebsd.org/changeset/base/231450 Log: MFC r223613: Add support for SCTP_PR_SCTP_NONE which I misded to add. This constant is defined in the socket API ID. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:17 2012 (r231449) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:52 2012 (r231450) @@ -251,12 +251,13 @@ struct sctp_snd_all_completes { /* for the endpoint */ /* The lower byte is an enumeration of PR-SCTP policies */ +#define SCTP_PR_SCTP_NONE 0x0000/* Reliable transfer */ #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */ #define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */ #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */ #define PR_SCTP_POLICY(x) ((x) & 0x0f) -#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != 0) +#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE) #define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL) #define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF) #define PR_SCTP_RTX_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX) From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:19:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F2E106566B; Fri, 10 Feb 2012 22:19: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 8CFE48FC14; Fri, 10 Feb 2012 22:19: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 q1AMJ8FW098377; Fri, 10 Feb 2012 22:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMJ8pK098374; Fri, 10 Feb 2012 22:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102219.q1AMJ8pK098374@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231451 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:19:08 -0000 Author: tuexen Date: Fri Feb 10 22:19:07 2012 New Revision: 231451 URL: http://svn.freebsd.org/changeset/base/231451 Log: MFC r223697: Add the missing sca_keylength field to the sctp_authkey structure, which is used the the SCTP_AUTH_KEY socket option. Modified: stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:52 2012 (r231450) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:19:07 2012 (r231451) @@ -591,6 +591,7 @@ struct sctp_authchunk { struct sctp_authkey { sctp_assoc_t sca_assoc_id; uint16_t sca_keynumber; + uint16_t sca_keylength; uint8_t sca_key[]; }; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:16:52 2012 (r231450) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:19:07 2012 (r231451) @@ -3562,8 +3562,18 @@ sctp_setopt(struct socket *so, int optna size_t size; SCTP_CHECK_AND_CAST(sca, optval, struct sctp_authkey, optsize); + if (sca->sca_keylength == 0) { + size = optsize - sizeof(struct sctp_authkey); + } else { + if (sca->sca_keylength + sizeof(struct sctp_authkey) <= optsize) { + size = sca->sca_keylength; + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; + } + } SCTP_FIND_STCB(inp, stcb, sca->sca_assoc_id); - size = optsize - sizeof(struct sctp_authkey); if (stcb) { shared_keys = &stcb->asoc.shared_keys; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:21:51 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542A5106564A; Fri, 10 Feb 2012 22:21: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 4137C8FC15; Fri, 10 Feb 2012 22:21: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 q1AMLpCs098506; Fri, 10 Feb 2012 22:21:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMLpte098504; Fri, 10 Feb 2012 22:21:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102221.q1AMLpte098504@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231452 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:21:51 -0000 Author: tuexen Date: Fri Feb 10 22:21:50 2012 New Revision: 231452 URL: http://svn.freebsd.org/changeset/base/231452 Log: MFC r223947: Truncate link addresses like it is done for any other address type. Modified: stable/8/usr.bin/netstat/if.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Fri Feb 10 22:19:07 2012 (r231451) +++ stable/8/usr.bin/netstat/if.c Fri Feb 10 22:21:50 2012 (r231452) @@ -402,7 +402,7 @@ intpr(int interval1, u_long ifnetaddr, v n = cp - sa->sa_data + 1; cp = sa->sa_data; hexprint: - while (--n >= 0) + while ((--n >= 0) && (m < 30)) m += printf("%02x%c", *cp++ & 0xff, n > 0 ? ':' : ' '); m = 32 - m; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:26:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEF5106564A; Fri, 10 Feb 2012 22:26: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 8C9798FC17; Fri, 10 Feb 2012 22:26: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 q1AMQXT8098697; Fri, 10 Feb 2012 22:26:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMQXxs098694; Fri, 10 Feb 2012 22:26:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102226.q1AMQXxs098694@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231453 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:26:33 -0000 Author: tuexen Date: Fri Feb 10 22:26:33 2012 New Revision: 231453 URL: http://svn.freebsd.org/changeset/base/231453 Log: MFC r223963: The socket API only specifies SCTP for SOCK_SEQPACKET and SOCK_STREAM, but not SOCK_DGRAM. So don't register it for SOCK_DGRAM. While there, fix some indentation. Modified: stable/8/sys/netinet/in_proto.c stable/8/sys/netinet6/in6_proto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/in_proto.c ============================================================================== --- stable/8/sys/netinet/in_proto.c Fri Feb 10 22:21:50 2012 (r231452) +++ stable/8/sys/netinet/in_proto.c Fri Feb 10 22:26:33 2012 (r231453) @@ -150,7 +150,7 @@ struct protosw inetsw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, + .pr_type = SOCK_SEQPACKET, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_WANTRCVD, @@ -164,18 +164,6 @@ struct protosw inetsw[] = { .pr_drain = sctp_drain, .pr_usrreqs = &sctp_usrreqs }, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs -}, - { .pr_type = SOCK_STREAM, .pr_domain = &inetdomain, Modified: stable/8/sys/netinet6/in6_proto.c ============================================================================== --- stable/8/sys/netinet6/in6_proto.c Fri Feb 10 22:21:50 2012 (r231452) +++ stable/8/sys/netinet6/in6_proto.c Fri Feb 10 22:26:33 2012 (r231453) @@ -184,38 +184,29 @@ struct ip6protosw inet6sw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs -}, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs + .pr_type = SOCK_SEQPACKET, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp6_input, + .pr_ctlinput = sctp6_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = sctp_init, +#endif + .pr_usrreqs = &sctp6_usrreqs }, - { - .pr_type = SOCK_STREAM, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs + .pr_type = SOCK_STREAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp6_input, + .pr_ctlinput = sctp6_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp6_usrreqs }, #endif /* SCTP */ { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:29:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1198106564A; Fri, 10 Feb 2012 22:29:41 +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 8F87A8FC1D; Fri, 10 Feb 2012 22:29:41 +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 q1AMTf5k098834; Fri, 10 Feb 2012 22:29:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMTf3E098832; Fri, 10 Feb 2012 22:29:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102229.q1AMTf3E098832@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231454 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:29:41 -0000 Author: tuexen Date: Fri Feb 10 22:29:41 2012 New Revision: 231454 URL: http://svn.freebsd.org/changeset/base/231454 Log: MFC r223965: Don't check for SOCK_DGRAM anymore. Also remove multicast related code which is not necessary anymore. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:26:33 2012 (r231453) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:29:41 2012 (r231454) @@ -2523,8 +2523,7 @@ sctp_inpcb_alloc(struct socket *so, uint so->so_pcb = (caddr_t)inp; - if ((SCTP_SO_TYPE(so) == SOCK_DGRAM) || - (SCTP_SO_TYPE(so) == SOCK_SEQPACKET)) { + if (SCTP_SO_TYPE(so) == SOCK_SEQPACKET) { /* UDP style socket */ inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE | SCTP_PCB_FLAGS_UNBOUND); @@ -3721,13 +3720,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (void)sctp_m_free(ip_pcb->inp_options); ip_pcb->inp_options = 0; } -#ifdef INET - if (ip_pcb->inp_moptions) { - inp_freemoptions(ip_pcb->inp_moptions); - ip_pcb->inp_moptions = 0; - } -#endif - #ifdef INET6 if (ip_pcb->inp_vflag & INP_IPV6) { struct in6pcb *in6p; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:31:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DD31065678; Fri, 10 Feb 2012 22:31:47 +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 6E37B8FC18; Fri, 10 Feb 2012 22:31: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 q1AMVlDp098947; Fri, 10 Feb 2012 22:31:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMVlBp098945; Fri, 10 Feb 2012 22:31:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102231.q1AMVlBp098945@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231455 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:31:47 -0000 Author: tuexen Date: Fri Feb 10 22:31:47 2012 New Revision: 231455 URL: http://svn.freebsd.org/changeset/base/231455 Log: MFC r224271: Fix the following bugs related to the SCTP support of netstat: * Correctly handle -a. * -A isn't supported. * Show all closed 1-to-1 and 1-to-many style sockets. * Show all listening 1-to-many style sockets. * Use consistent formatting for -W. Modified: stable/8/usr.bin/netstat/sctp.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/sctp.c ============================================================================== --- stable/8/usr.bin/netstat/sctp.c Fri Feb 10 22:29:41 2012 (r231454) +++ stable/8/usr.bin/netstat/sctp.c Fri Feb 10 22:31:47 2012 (r231455) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved. + * Copyright (c) 2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -63,7 +64,6 @@ __FBSDID("$FreeBSD$"); #ifdef SCTP -void inetprint(struct in_addr *, int, const char *, int); static void sctp_statesprint(uint32_t state); #define NETSTAT_SCTP_STATES_CLOSED 0x0 @@ -102,6 +102,124 @@ struct xraddr_entry { LIST_ENTRY(xraddr_entry) xraddr_entries; }; +/* + * Construct an Internet address representation. + * If numeric_addr has been supplied, give + * numeric value, otherwise try for symbolic name. + */ +static char * +inetname(struct in_addr *inp) +{ + char *cp; + static char line[MAXHOSTNAMELEN]; + struct hostent *hp; + struct netent *np; + + cp = 0; + if (!numeric_addr && inp->s_addr != INADDR_ANY) { + int net = inet_netof(*inp); + int lna = inet_lnaof(*inp); + + if (lna == INADDR_ANY) { + np = getnetbyaddr(net, AF_INET); + if (np) + cp = np->n_name; + } + if (cp == 0) { + hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); + if (hp) { + cp = hp->h_name; + trimdomain(cp, strlen(cp)); + } + } + } + if (inp->s_addr == INADDR_ANY) + strcpy(line, "*"); + else if (cp) { + strlcpy(line, cp, sizeof(line)); + } else { + inp->s_addr = ntohl(inp->s_addr); +#define C(x) ((u_int)((x) & 0xff)) + sprintf(line, "%u.%u.%u.%u", C(inp->s_addr >> 24), + C(inp->s_addr >> 16), C(inp->s_addr >> 8), C(inp->s_addr)); + inp->s_addr = htonl(inp->s_addr); + } + return (line); +} + +#ifdef INET6 +static char ntop_buf[INET6_ADDRSTRLEN]; + +static char * +inet6name(struct in6_addr *in6p) +{ + char *cp; + static char line[50]; + struct hostent *hp; + static char domain[MAXHOSTNAMELEN]; + static int first = 1; + + if (first && !numeric_addr) { + first = 0; + if (gethostname(domain, MAXHOSTNAMELEN) == 0 && + (cp = index(domain, '.'))) + (void) strcpy(domain, cp + 1); + else + domain[0] = 0; + } + cp = 0; + if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { + hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); + if (hp) { + if ((cp = index(hp->h_name, '.')) && + !strcmp(cp + 1, domain)) + *cp = 0; + cp = hp->h_name; + } + } + if (IN6_IS_ADDR_UNSPECIFIED(in6p)) + strcpy(line, "*"); + else if (cp) + strcpy(line, cp); + else + sprintf(line, "%s", + inet_ntop(AF_INET6, (void *)in6p, ntop_buf, + sizeof(ntop_buf))); + return (line); +} +#endif + +static void +sctp_print_address(union sctp_sockstore *address, int port, int num_port) +{ + struct servent *sp = 0; + char line[80], *cp; + int width; + + switch (address->sa.sa_family) { + case AF_INET: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); + break; +#ifdef INET6 + case AF_INET6: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); + break; +#endif + default: + sprintf(line, "%.*s.", Wflag ? 39 : 16, ""); + break; + } + cp = index(line, '\0'); + if (!num_port && port) + sp = getservbyport((int)port, "sctp"); + if (sp || port == 0) + sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); + else + sprintf(cp, "%d ", ntohs((u_short)port)); + width = Wflag ? 45 : 22; + printf("%-*.*s ", width, width, line); +} + static int sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset) { @@ -150,18 +268,14 @@ sctp_skip_xinpcb_ifneed(char *buf, const } static void -sctp_process_tcb(struct xsctp_tcb *xstcb, const char *name, +sctp_process_tcb(struct xsctp_tcb *xstcb, char *buf, const size_t buflen, size_t *offset, int *indent) { int i, xl_total = 0, xr_total = 0, x_max; - struct sockaddr *sa; struct xsctp_raddr *xraddr; struct xsctp_laddr *xladdr; struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp; struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif LIST_INIT(&xladdr_head); LIST_INIT(&xraddr_head); @@ -220,38 +334,22 @@ sctp_process_tcb(struct xsctp_tcb *xstcb x_max = (xl_total > xr_total) ? xl_total : xr_total; for (i = 0; i < x_max; i++) { if (((*indent == 0) && i > 0) || *indent > 0) - printf("%-11s ", " "); + printf("%-12s ", " "); if (xl != NULL) { - sa = &(xl->xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->local_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->local_port), - name, numeric_port); + sctp_print_address(&(xl->xladdr->address), + htons(xstcb->local_port), numeric_port); + } else { + if (Wflag) { + printf("%-45s ", " "); + } else { + printf("%-22s ", " "); } -#endif } if (xr != NULL && !Lflag) { - sa = &(xr->xraddr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->remote_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->remote_port), - name, numeric_port); - } -#endif + sctp_print_address(&(xr->xraddr->address), + htons(xstcb->remote_port), numeric_port); } if (xl != NULL) @@ -285,53 +383,21 @@ out: } } -#ifdef SCTP_DEBUG -uint32_t sctp_pdup[64]; -int sctp_pcnt = 0; -#endif - static void -sctp_process_inpcb(struct xsctp_inpcb *xinpcb, const char *name, +sctp_process_inpcb(struct xsctp_inpcb *xinpcb, char *buf, const size_t buflen, size_t *offset) { - int offset_backup, indent = 0, xladdr_total = 0, is_listening = 0; + int indent = 0, xladdr_total = 0, is_listening = 0; static int first = 1; - char *tname; + char *tname, *pname; struct xsctp_tcb *xstcb; struct xsctp_laddr *xladdr; - struct sockaddr *sa; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif + size_t offset_laddr; + int process_closed; - if ((xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) == - SCTP_PCB_FLAGS_TCPTYPE && xinpcb->maxqlen > 0) + if (xinpcb->maxqlen > 0) is_listening = 1; - if (!Lflag && !is_listening && - !(xinpcb->flags & SCTP_PCB_FLAGS_CONNECTED)) { -#ifdef SCTP_DEBUG - int i, found = 0; - - for (i = 0; i < sctp_pcnt; i++) { - if (sctp_pdup[i] == xinpcb->flags) { - found = 1; - break; - } - } - if (!found) { - sctp_pdup[sctp_pcnt++] = xinpcb->flags; - if (sctp_pcnt >= 64) - sctp_pcnt = 0; - printf("[0x%08x]", xinpcb->flags); - } -#endif - offset_backup = *offset; - if (!sctp_skip_xinpcb_ifneed(buf, buflen, offset)) - return; - *offset = offset_backup; - } - if (first) { if (!Lflag) { printf("Active SCTP associations"); @@ -340,90 +406,115 @@ sctp_process_inpcb(struct xsctp_inpcb *x } else printf("Current listen queue sizes (qlen/maxqlen)"); putchar('\n'); - if (Aflag) - printf("%-8.8s ", "Socket"); if (Lflag) - printf("%-5.5s %-5.5s %-8.8s %-22.22s\n", + printf("%-6.6s %-5.5s %-8.8s %-22.22s\n", "Proto", "Type", "Listen", "Local Address"); else - printf((Aflag && !Wflag) ? - "%-5.5s %-5.5s %-18.18s %-18.18s %s\n" : - "%-5.5s %-5.5s %-22.22s %-22.22s %s\n", - "Proto", "Type", - "Local Address", "Foreign Address", - "(state)"); + if (Wflag) + printf("%-6.6s %-5.5s %-45.45s %-45.45s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); + else + printf("%-6.6s %-5.5s %-22.22s %-22.22s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); first = 0; } - if (Lflag && xinpcb->maxqlen == 0) { + xladdr = (struct xsctp_laddr *)(buf + *offset); + if (Lflag && !is_listening) { (int)sctp_skip_xinpcb_ifneed(buf, buflen, offset); return; } - if (Aflag) - printf("%8lx ", (u_long)xinpcb); - printf("%-5.5s ", name); + if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { + /* Can't distinguish between sctp46 and sctp6 */ + pname = "sctp46"; + } else { + pname = "sctp4"; + } if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) tname = "1to1"; else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) tname = "1toN"; else - return; - - printf("%-5.5s ", tname); + tname = "????"; if (Lflag) { char buf1[9]; snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); + printf("%-6.6s %-5.5s ", pname, tname); printf("%-8.8s ", buf1); } - /* - * process the local address. This routine are used for Lflag. - */ + + offset_laddr = *offset; + process_closed = 0; +retry: while (*offset < buflen) { xladdr = (struct xsctp_laddr *)(buf + *offset); *offset += sizeof(struct xsctp_laddr); - if (xladdr->last == 1) + if (xladdr->last) { + if (aflag && !Lflag && (xladdr_total == 0) && process_closed) { + printf("%-6.6s %-5.5s ", pname, tname); + if (Wflag) { + printf("%-91.91s CLOSED", " "); + } else { + printf("%-45.45s CLOSED", " "); + } + } + if (process_closed || is_listening) { + putchar('\n'); + } break; + } - if (!Lflag && !is_listening) + if (!Lflag && !is_listening && !process_closed) continue; - if (xladdr_total != 0) + if (xladdr_total == 0) { + printf("%-6.6s %-5.5s ", pname, tname); + } else { putchar('\n'); - if (xladdr_total > 0) printf((Lflag) ? - "%-20.20s " : "%-11.11s ", " "); - - sa = &(xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xinpcb->local_port), name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xinpcb->local_port), name, numeric_port); + "%-21.21s " : "%-12.12s ", " "); + } + sctp_print_address(&(xladdr->address), + htons(xinpcb->local_port), numeric_port); + if (aflag && !Lflag && xladdr_total == 0) { + if (Wflag) { + if (process_closed) { + printf("%-45.45s CLOSED", " "); + } else { + printf("%-45.45s LISTEN", " "); + } + } else { + if (process_closed) { + printf("%-22.22s CLOSED", " "); + } else { + printf("%-22.22s LISTEN", " "); + } + } } -#endif - - if (!Lflag && xladdr_total == 0 && is_listening == 1) - printf("%-22.22s LISTEN", " "); - xladdr_total++; } xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); + if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) { + process_closed = 1; + *offset = offset_laddr; + goto retry; + } while (xstcb->last == 0 && *offset < buflen) { - sctp_process_tcb(xstcb, name, buf, buflen, offset, &indent); + printf("%-6.6s %-5.5s ", pname, tname); + sctp_process_tcb(xstcb, buf, buflen, offset, &indent); indent++; xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); } - - putchar('\n'); } /* @@ -461,7 +552,7 @@ sctp_protopr(u_long off __unused, xinpcb = (struct xsctp_inpcb *)(buf + offset); offset += sizeof(struct xsctp_inpcb); while (xinpcb->last == 0 && offset < len) { - sctp_process_inpcb(xinpcb, name, buf, (const size_t)len, + sctp_process_inpcb(xinpcb, buf, (const size_t)len, &offset); xinpcb = (struct xsctp_inpcb *)(buf + offset); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:42:04 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E7C9106564A; Fri, 10 Feb 2012 22:42: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 891F28FC13; Fri, 10 Feb 2012 22:42: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 q1AMg4UC099307; Fri, 10 Feb 2012 22:42:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMg4Z9099298; Fri, 10 Feb 2012 22:42:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102242.q1AMg4Z9099298@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231456 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:42:04 -0000 Author: tuexen Date: Fri Feb 10 22:42:03 2012 New Revision: 231456 URL: http://svn.freebsd.org/changeset/base/231456 Log: MFC r224641: The result of a joint work between rrs@ and myself at the IETF: * Decouple the path supervision using a separate HB timer per path. * Add support for potentially failed state. * Bring back RTO.min to 1 second. * Accept packets on IP-addresses already announced via an ASCONF * While there: do some cleanups. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:42:03 2012 (r231456) @@ -410,6 +410,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_PRINFO: ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; break; + case SCTP_PEER_ADDR_THLDS: + ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; + break; default: break; } Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 22:42:03 2012 (r231456) @@ -119,6 +119,7 @@ struct sctp_paramhdr { #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 +#define SCTP_PEER_ADDR_THLDS 0x00000023 /* * read-only options @@ -564,7 +565,6 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BLK_LOGGING_ENABLE 0x00000001 #define SCTP_CWND_MONITOR_ENABLE 0x00000002 #define SCTP_CWND_LOGGING_ENABLE 0x00000004 -#define SCTP_EARLYFR_LOGGING_ENABLE 0x00000010 #define SCTP_FLIGHT_LOGGING_ENABLE 0x00000020 #define SCTP_FR_LOGGING_ENABLE 0x00000040 #define SCTP_LOCK_LOGGING_ENABLE 0x00000080 @@ -572,23 +572,23 @@ struct sctp_error_unrecognized_chunk { #define SCTP_MBCNT_LOGGING_ENABLE 0x00000200 #define SCTP_MBUF_LOGGING_ENABLE 0x00000400 #define SCTP_NAGLE_LOGGING_ENABLE 0x00000800 -#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 +#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 #define SCTP_RTTVAR_LOGGING_ENABLE 0x00002000 #define SCTP_SACK_LOGGING_ENABLE 0x00004000 -#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 +#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 #define SCTP_SB_LOGGING_ENABLE 0x00010000 #define SCTP_STR_LOGGING_ENABLE 0x00020000 #define SCTP_WAKE_LOGGING_ENABLE 0x00040000 #define SCTP_LOG_MAXBURST_ENABLE 0x00080000 #define SCTP_LOG_RWND_ENABLE 0x00100000 -#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 -#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 -#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 -#define SCTP_LAST_PACKET_TRACING 0x01000000 -#define SCTP_THRESHOLD_LOGGING 0x02000000 -#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 -#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 -#define SCTP_LOG_TRY_ADVANCE 0x10000000 +#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 +#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 +#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 +#define SCTP_LAST_PACKET_TRACING 0x01000000 +#define SCTP_THRESHOLD_LOGGING 0x02000000 +#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 +#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 +#define SCTP_LOG_TRY_ADVANCE 0x10000000 #undef SCTP_PACKED Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:42:03 2012 (r231456) @@ -198,8 +198,9 @@ sctp_asconf_error_response(uint32_t id, static struct mbuf * sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, - struct sctp_tcb *stcb, int response_required) + struct sctp_tcb *stcb, int send_hb, int response_required) { + struct sctp_nets *net; struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; struct sctp_paramhdr *ph; @@ -284,7 +285,7 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); } /* add the address */ - if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, + if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); @@ -298,10 +299,12 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, - NULL, SCTP_FROM_SCTP_ASCONF + SCTP_LOC_1); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, NULL); + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } return m_reply; } @@ -554,7 +557,12 @@ sctp_process_asconf_set_primary(struct m "process_asconf_set_primary: primary address set\n"); /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa, SCTP_SO_NOT_LOCKED); - + if ((stcb->asoc.primary_destination->dest_state & SCTP_ADDR_REACHABLE) && + (!(stcb->asoc.primary_destination->dest_state & SCTP_ADDR_PF)) && + (stcb->asoc.alternate)) { + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } @@ -622,7 +630,7 @@ sctp_handle_asconf(struct mbuf *m, unsig struct sctp_asconf_ack_chunk *ack_cp; struct sctp_asconf_paramhdr *aph, *ack_aph; struct sctp_ipv6addr_param *p_addr; - unsigned int asconf_limit; + unsigned int asconf_limit, cnt; int error = 0; /* did an error occur? */ /* asconf param buffer */ @@ -717,6 +725,7 @@ sctp_handle_asconf(struct mbuf *m, unsig goto send_reply; } /* process through all parameters */ + cnt = 0; while (aph != NULL) { unsigned int param_length, param_type; @@ -749,7 +758,8 @@ sctp_handle_asconf(struct mbuf *m, unsig case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_add_ip(m, aph, stcb, - error); + (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); + cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; @@ -1959,7 +1969,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 && + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ return; @@ -2075,8 +2085,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - addr_locked); + sctp_send_asconf(stcb, NULL, addr_locked); #endif } } @@ -2328,8 +2337,7 @@ sctp_asconf_iterator_stcb(struct sctp_in * If we have queued params in the open state, send out an ASCONF. */ if (num_queued > 0) { - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); } } @@ -2384,8 +2392,7 @@ sctp_set_primary_ip_address_sa(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } else { @@ -2421,8 +2428,7 @@ sctp_set_primary_ip_address(struct sctp_ stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -2965,8 +2971,7 @@ sctp_process_initack_addresses(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -3540,5 +3545,5 @@ sctp_asconf_send_nat_state_update(struct } skip_rest: /* Now we must send the asconf into the queue */ - sctp_send_asconf(stcb, net, 0); + sctp_send_asconf(stcb, net, SCTP_ADDR_NOT_LOCKED); } Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 22:42:03 2012 (r231456) @@ -728,40 +728,6 @@ sctp_cwnd_update_after_sack_common(struc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -769,51 +735,6 @@ sctp_cwnd_update_after_sack_common(struc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - old_cwnd = net->cwnd; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, - old_cwnd, net->cwnd); - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -833,7 +754,7 @@ sctp_cwnd_update_after_sack_common(struc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * Did any measurements go on for this network? @@ -856,7 +777,7 @@ sctp_cwnd_update_after_sack_common(struc if (net->cc_mod.rtcc.lbw) { if (cc_bw_limit(stcb, net, nbw)) { /* Hold here, no update */ - goto skip_cwnd_update; + continue; } } else { uint64_t vtag, probepoint; @@ -1049,27 +970,25 @@ sctp_cwnd_update_after_sack_common(struc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } static void +sctp_cwnd_update_exit_pf_common(struct sctp_tcb *stcb, struct sctp_nets *net) +{ + int old_cwnd; + + old_cwnd = net->cwnd; + net->cwnd = net->mtu; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); + SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", + net, net->cwnd); +} + + +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -1344,32 +1263,6 @@ sctp_cwnd_update_after_output(struct sct } static void -sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - SDT_PROBE(sctp, cwnd, net, fr, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1858,40 +1751,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -1899,47 +1758,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -1959,7 +1777,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2004,23 +1822,6 @@ sctp_hs_cwnd_update_after_sack(struct sc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2340,40 +2141,6 @@ sctp_htcp_cwnd_update_after_sack(struct } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -2381,47 +2148,6 @@ sctp_htcp_cwnd_update_after_sack(struct } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -2441,7 +2167,7 @@ sctp_htcp_cwnd_update_after_sack(struct * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2457,23 +2183,6 @@ sctp_htcp_cwnd_update_after_sack(struct SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2566,30 +2275,6 @@ sctp_htcp_cwnd_update_after_timeout(stru } static void -sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd; - - old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) { @@ -2618,42 +2303,42 @@ struct sctp_cc_functions sctp_cc_functio { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 22:42:03 2012 (r231456) @@ -416,7 +416,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE 0x0010 -#define SCTP_STR_RESET_ADD_STREAMS 0x0011 +#define SCTP_STR_RESET_ADD_STREAMS 0x0011 #define SCTP_MAX_RESET_PARAMS 2 #define SCTP_STREAM_RESET_TSN_DELTA 0x1000 @@ -508,14 +508,10 @@ __FBSDID("$FreeBSD$"); /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 -#define SCTP_ADDR_NOT_REACHABLE 0x002 #define SCTP_ADDR_NOHB 0x004 #define SCTP_ADDR_BEING_DELETED 0x008 #define SCTP_ADDR_NOT_IN_ASSOC 0x010 -#define SCTP_ADDR_WAS_PRIMARY 0x020 -#define SCTP_ADDR_SWITCH_PRIMARY 0x040 #define SCTP_ADDR_OUT_OF_SCOPE 0x080 -#define SCTP_ADDR_DOUBLE_SWITCH 0x100 #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ @@ -579,14 +575,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_EVENTWAKE 13 #define SCTP_TIMER_TYPE_STRRESET 14 #define SCTP_TIMER_TYPE_INPKILL 15 -#define SCTP_TIMER_TYPE_EARLYFR 17 -#define SCTP_TIMER_TYPE_ASOCKILL 18 -#define SCTP_TIMER_TYPE_ADDR_WQ 19 -#define SCTP_TIMER_TYPE_ZERO_COPY 20 -#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 21 -#define SCTP_TIMER_TYPE_PRIM_DELETED 22 +#define SCTP_TIMER_TYPE_ASOCKILL 16 +#define SCTP_TIMER_TYPE_ADDR_WQ 17 +#define SCTP_TIMER_TYPE_ZERO_COPY 18 +#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 19 +#define SCTP_TIMER_TYPE_PRIM_DELETED 20 /* add new timers here - and increment LAST */ -#define SCTP_TIMER_TYPE_LAST 23 +#define SCTP_TIMER_TYPE_LAST 21 #define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \ ((t) < SCTP_TIMER_TYPE_LAST)) @@ -655,16 +650,17 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ +#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ #define SCTP_INP_KILL_TIMEOUT 20/* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ -#define SCTP_DEF_MAX_INIT 8 -#define SCTP_DEF_MAX_SEND 10 -#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_MAX_INIT 8 +#define SCTP_DEF_MAX_SEND 10 +#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_PATH_PF_THRESHOLD SCTP_DEF_MAX_PATH_RTX #define SCTP_DEF_PMTU_RAISE_SEC 600 /* 10 min between raise attempts */ @@ -679,7 +675,7 @@ __FBSDID("$FreeBSD$"); /* Send window update (incr * this > hiwat). Should be a power of 2 */ #define SCTP_MINIMAL_RWND (4096) /* minimal rwnd */ -#define SCTP_ADDRMAX 24 +#define SCTP_ADDRMAX 16 /* SCTP DEBUG Switch parameters */ #define SCTP_DEBUG_TIMER1 0x00000001 Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 22:42:03 2012 (r231456) @@ -98,9 +98,10 @@ struct sctp_heartbeat_info_param { uint32_t time_value_2; uint32_t random_value1; uint32_t random_value2; - uint16_t user_req; uint8_t addr_family; uint8_t addr_len; + /* make sure that this structure is 4 byte aligned */ + uint8_t padding[2]; char address[SCTP_ADDRMAX]; } SCTP_PACKED; Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 22:42:03 2012 (r231456) @@ -2434,7 +2434,8 @@ sctp_sack_check(struct sctp_tcb *stcb, i sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } - sctp_send_shutdown(stcb, stcb->asoc.primary_destination); + sctp_send_shutdown(stcb, + ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -4054,9 +4055,50 @@ sctp_express_handle_sack(struct sctp_tcb } /* JRS - Use the congestion control given in the CC module */ - if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) + if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); + /* Done with this net */ + net->net_ack = 0; + } + /* restore any doubled timers */ + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; + if (net->RTO < stcb->asoc.minrto) { + net->RTO = stcb->asoc.minrto; + } + if (net->RTO > stcb->asoc.maxrto) { + net->RTO = stcb->asoc.maxrto; + } + } + } asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); - + } asoc->last_acked_seq = cumack; if (TAILQ_EMPTY(&asoc->sent_queue)) { @@ -4127,13 +4169,6 @@ again: stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_22); } - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck4); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_23); - } - } } } if ((j == 0) && @@ -4222,6 +4257,8 @@ again: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, oper, SCTP_SO_NOT_LOCKED); } else { + struct sctp_nets *netp; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4229,26 +4266,36 @@ again: SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, - stcb->asoc.primary_destination); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { + struct sctp_nets *netp; + + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, - stcb->asoc.primary_destination); + sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } /*********************************************/ @@ -4380,7 +4427,7 @@ sctp_handle_sack(struct mbuf *m, int off num_dup, SCTP_LOG_NEW_SACK); } - if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_FR_LOGGING_ENABLE | SCTP_EARLYFR_LOGGING_ENABLE))) { + if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE)) { uint16_t i; uint32_t *dupdata, dblock; @@ -4468,13 +4515,6 @@ sctp_handle_sack(struct mbuf *m, int off TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck1); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - } - } net->partial_bytes_acked = 0; net->flight_size = 0; } @@ -4830,20 +4870,54 @@ sctp_handle_sack(struct mbuf *m, int off asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ - if (ecne_seen == 0) + if (ecne_seen == 0) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:44:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01D64106566B; Fri, 10 Feb 2012 22:44:37 +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 E38418FC13; Fri, 10 Feb 2012 22:44:36 +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 q1AMiaTD099447; Fri, 10 Feb 2012 22:44:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMiaOf099440; Fri, 10 Feb 2012 22:44:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102244.q1AMiaOf099440@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231457 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:44:37 -0000 Author: tuexen Date: Fri Feb 10 22:44:36 2012 New Revision: 231457 URL: http://svn.freebsd.org/changeset/base/231457 Log: MFC r224870: Add support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMS socket option. Backwards compatibility is provided by still supporting the spp_ipv4_tos field. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:44:36 2012 (r231457) @@ -3967,7 +3967,7 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_v = IPVERSION; ip->ip_hl = (sizeof(struct ip) >> 2); if (net) { - tos_value = net->tos_flowlabel & 0x000000ff; + tos_value = net->dscp; } else { tos_value = inp->ip_inp.inp.inp_ip_tos; } @@ -4204,7 +4204,7 @@ sctp_lowlevel_chunk_output(struct sctp_i int len; if (net != NULL) { - flowlabel = net->tos_flowlabel; + flowlabel = net->flowlabel; } else { flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:44:36 2012 (r231457) @@ -4009,20 +4009,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.numnets++; *(&net->ref_count) = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); } else { net->port = 0; } -#ifdef INET - if (newaddr->sa_family == AF_INET) - net->tos_flowlabel = stcb->asoc.default_tos; -#endif -#ifdef INET6 - if (newaddr->sa_family == AF_INET6) - net->tos_flowlabel = stcb->asoc.default_flowlabel; -#endif + net->dscp = stcb->asoc.default_dscp; + net->flowlabel = stcb->asoc.default_flowlabel; if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:44:36 2012 (r231457) @@ -321,7 +321,8 @@ struct sctp_nets { uint32_t fast_recovery_tsn; uint32_t heartbeat_random1; uint32_t heartbeat_random2; - uint32_t tos_flowlabel; + uint32_t flowlabel; + uint8_t dscp; struct timeval start_time; /* time when this net was created */ uint32_t marked_retrans;/* number or DATA chunks marked for timer @@ -1137,7 +1138,7 @@ struct sctp_association { uint8_t last_flags_delivered; uint8_t hb_ect_randombit; uint8_t hb_random_idx; - uint8_t default_tos; + uint8_t default_dscp; uint8_t asconf_del_pending; /* asconf delete last addr pending */ /* Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:44:36 2012 (r231457) @@ -505,9 +505,11 @@ struct sctp_paddrparams { uint32_t spp_flags; uint32_t spp_ipv6_flowlabel; uint16_t spp_pathmaxrxt; - uint8_t spp_ipv4_tos; + uint8_t spp_dscp; }; +#define spp_ipv4_tos spp_dscp + #define SPP_HB_ENABLE 0x00000001 #define SPP_HB_DISABLE 0x00000002 #define SPP_HB_DEMAND 0x00000004 @@ -515,7 +517,8 @@ struct sctp_paddrparams { #define SPP_PMTUD_DISABLE 0x00000010 #define SPP_HB_TIME_IS_ZERO 0x00000080 #define SPP_IPV6_FLOWLABEL 0x00000100 -#define SPP_IPV4_TOS 0x00000200 +#define SPP_DSCP 0x00000200 +#define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { sctp_assoc_t spt_assoc_id; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:44:36 2012 (r231457) @@ -2407,13 +2407,13 @@ flags_out: } #ifdef INET if (net->ro._l_addr.sin.sin_family == AF_INET) { - paddrp->spp_ipv4_tos = net->tos_flowlabel & 0x000000fc; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = net->dscp; + paddrp->spp_flags |= SPP_DSCP; } #endif #ifdef INET6 if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - paddrp->spp_ipv6_flowlabel = net->tos_flowlabel; + paddrp->spp_ipv6_flowlabel = net->flowlabel; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -2427,8 +2427,8 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); #ifdef INET - paddrp->spp_ipv4_tos = stcb->asoc.default_tos & 0x000000fc; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = stcb->asoc.default_dscp & 0x000000fc; + paddrp->spp_flags |= SPP_DSCP; #endif #ifdef INET6 paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel; @@ -2461,8 +2461,8 @@ flags_out: paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ #ifdef INET - paddrp->spp_ipv4_tos = inp->ip_inp.inp.inp_ip_tos; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = inp->ip_inp.inp.inp_ip_tos; + paddrp->spp_flags |= SPP_DSCP; #endif #ifdef INET6 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { @@ -4598,16 +4598,16 @@ sctp_setopt(struct socket *so, int optna net->failure_threshold = paddrp->spp_pathmaxrxt; } #ifdef INET - if (paddrp->spp_flags & SPP_IPV4_TOS) { + if (paddrp->spp_flags & SPP_DSCP) { if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->tos_flowlabel = paddrp->spp_ipv4_tos & 0x000000fc; + net->dscp = paddrp->spp_dscp & 0xfc; } } #endif #ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - net->tos_flowlabel = paddrp->spp_ipv6_flowlabel; + net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; } } #endif @@ -4696,27 +4696,18 @@ sctp_setopt(struct socket *so, int optna } } } -#ifdef INET - if (paddrp->spp_flags & SPP_IPV4_TOS) { + if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->tos_flowlabel = paddrp->spp_ipv4_tos & 0x000000fc; - } + net->dscp = paddrp->spp_dscp & 0x000000fc; } - stcb->asoc.default_tos = paddrp->spp_ipv4_tos & 0x000000fc; + stcb->asoc.default_dscp = paddrp->spp_dscp & 0x000000fc; } -#endif -#ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - net->tos_flowlabel = paddrp->spp_ipv6_flowlabel; - } + net->flowlabel = paddrp->spp_ipv6_flowlabel; } stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel; } -#endif - } SCTP_TCB_UNLOCK(stcb); } else { Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:44:36 2012 (r231457) @@ -924,9 +924,9 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_frag_point = m->sctp_frag_point; asoc->sctp_features = m->sctp_features; #ifdef INET - asoc->default_tos = m->ip_inp.inp.inp_ip_tos; + asoc->default_dscp = m->ip_inp.inp.inp_ip_tos; #else - asoc->default_tos = 0; + asoc->default_dscp = 0; #endif #ifdef INET6 From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:49:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53A9D106566C; Fri, 10 Feb 2012 22:49:09 +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 416458FC15; Fri, 10 Feb 2012 22:49: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 q1AMn9xY099630; Fri, 10 Feb 2012 22:49:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMn9Mn099628; Fri, 10 Feb 2012 22:49:09 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102249.q1AMn9Mn099628@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231458 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:49:09 -0000 Author: tuexen Date: Fri Feb 10 22:49:09 2012 New Revision: 231458 URL: http://svn.freebsd.org/changeset/base/231458 Log: MFC r224918: Fix the handling of [gs]etsockopt() unconnected 1-to-1 style sockets. While there: * Fix a locking issue in setsockopt() of SCTP_CMT_ON_OFF. * Fix a bug in setsockopt() of SCTP_DEFAULT_PRINFO, where the pr_value was ignored. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:44:36 2012 (r231457) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:49:09 2012 (r231458) @@ -1767,7 +1767,9 @@ flags_out: av->assoc_value = stcb->asoc.sctp_cmt_on_off; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_cmt_on_off; SCTP_INP_RUNLOCK(inp); @@ -1791,7 +1793,9 @@ flags_out: av->assoc_value = stcb->asoc.congestion_control_module; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_cc_module; SCTP_INP_RUNLOCK(inp); @@ -1834,7 +1838,9 @@ flags_out: av->assoc_value = stcb->asoc.stream_scheduling_module; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_ss_module; SCTP_INP_RUNLOCK(inp); @@ -1949,7 +1955,9 @@ flags_out: av->assoc_value = stcb->asoc.context; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_context; SCTP_INP_RUNLOCK(inp); @@ -2022,7 +2030,9 @@ flags_out: sack->sack_freq = stcb->asoc.sack_freq; SCTP_TCB_UNLOCK(stcb); } else { - if (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sack->sack_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]); sack->sack_freq = inp->sctp_ep.sctp_sack_freq; @@ -2084,7 +2094,9 @@ flags_out: av->assoc_value = sctp_get_frag_point(stcb, &stcb->asoc); SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { ovh = SCTP_MED_OVERHEAD; @@ -2453,7 +2465,9 @@ flags_out: paddrp->spp_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); } else { - if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -2628,7 +2642,9 @@ flags_out: srto->srto_min = stcb->asoc.minrto; SCTP_TCB_UNLOCK(stcb); } else { - if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); srto->srto_initial = inp->sctp_ep.initial_rto; srto->srto_max = inp->sctp_ep.sctp_maxrto; @@ -2682,7 +2698,9 @@ flags_out: sasoc->sasoc_local_rwnd = stcb->asoc.my_rwnd; SCTP_TCB_UNLOCK(stcb); } else { - if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life); sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times; @@ -2711,7 +2729,9 @@ flags_out: memcpy(s_info, &stcb->asoc.def_send, sizeof(stcb->asoc.def_send)); SCTP_TCB_UNLOCK(stcb); } else { - if (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); memcpy(s_info, &inp->def_send, sizeof(inp->def_send)); SCTP_INP_RUNLOCK(inp); @@ -2813,7 +2833,9 @@ flags_out: scact->scact_keynumber = stcb->asoc.authinfo.active_keyid; SCTP_TCB_UNLOCK(stcb); } else { - if (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scact->scact_assoc_id == SCTP_FUTURE_ASSOC)) { /* get the endpoint active key */ SCTP_INP_RLOCK(inp); scact->scact_keynumber = inp->sctp_ep.default_keyid; @@ -2852,7 +2874,9 @@ flags_out: } SCTP_TCB_UNLOCK(stcb); } else { - if (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC)) { /* get off the endpoint */ SCTP_INP_RLOCK(inp); chklist = inp->sctp_ep.local_auth_chunks; @@ -2958,7 +2982,9 @@ flags_out: event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type); SCTP_TCB_UNLOCK(stcb); } else { - if (event->se_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (event->se_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); event->se_on = sctp_is_feature_on(inp, event_type); SCTP_INP_RUNLOCK(inp); @@ -3026,7 +3052,9 @@ flags_out: info->snd_context = stcb->asoc.def_send.sinfo_context; SCTP_TCB_UNLOCK(stcb); } else { - if (info->snd_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->snd_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; @@ -3056,7 +3084,9 @@ flags_out: info->pr_value = stcb->asoc.def_send.sinfo_timetolive; SCTP_TCB_UNLOCK(stcb); } else { - if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->pr_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); info->pr_value = inp->def_send.sinfo_timetolive; @@ -3144,7 +3174,9 @@ flags_out: thlds->spt_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); } else { - if (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -3338,7 +3370,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.sctp_cmt_on_off = av->assoc_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_cmt_on_off = av->assoc_value; @@ -3351,8 +3385,8 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); stcb->asoc.sctp_cmt_on_off = av->assoc_value; SCTP_TCB_UNLOCK(stcb); - SCTP_INP_RUNLOCK(inp); } + SCTP_INP_RUNLOCK(inp); } } } else { @@ -3385,7 +3419,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; @@ -3465,7 +3501,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_ss_module = av->assoc_value; @@ -3539,7 +3577,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.context = av->assoc_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_context = av->assoc_value; @@ -3605,7 +3645,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || (sack->sack_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sack->sack_delay) { @@ -3700,7 +3742,9 @@ sctp_setopt(struct socket *so, int optna error = sctp_insert_sharedkey(shared_keys, shared_key); SCTP_TCB_UNLOCK(stcb); } else { - if ((sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || (sca->sca_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); shared_keys = &inp->sctp_ep.shared_keys; @@ -3844,7 +3888,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || (scact->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_auth_setactivekey_ep(inp, scact->scact_keynumber)) { @@ -3881,7 +3927,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_delete_sharedkey_ep(inp, scdel->scact_keynumber)) { @@ -3918,7 +3966,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_deact_sharedkey_ep(inp, keyid->scact_keynumber)) { @@ -4205,7 +4255,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); /* * FIXME MT: I think this is not in @@ -4413,7 +4465,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send))); @@ -4712,7 +4766,9 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); } else { /************************NO TCB, SET TO default stuff ******************/ - if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); /* * For the TOS/FLOWLABEL stuff you @@ -4778,7 +4834,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); if (srto->srto_initial) new_init = srto->srto_initial; @@ -4830,7 +4888,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); if (sasoc->sasoc_asocmaxrxt) inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt; @@ -5150,13 +5210,17 @@ sctp_setopt(struct socket *so, int optna * sender dry events */ if ((event_type == SCTP_PCB_FLAGS_DRYEVNT) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) == 0) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) && ((event->se_assoc_id == SCTP_ALL_ASSOC) || (event->se_assoc_id == SCTP_CURRENT_ASSOC))) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP); error = ENOTSUP; break; } - if ((event->se_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (event->se_assoc_id == SCTP_FUTURE_ASSOC) || (event->se_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (event->se_on) { @@ -5234,7 +5298,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((info->snd_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->snd_assoc_id == SCTP_FUTURE_ASSOC) || (info->snd_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; @@ -5280,13 +5346,17 @@ sctp_setopt(struct socket *so, int optna if (stcb) { stcb->asoc.def_send.sinfo_flags &= 0xfff0; stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + stcb->asoc.def_send.sinfo_timetolive = info->pr_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->pr_assoc_id == SCTP_FUTURE_ASSOC) || (info->pr_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_flags &= 0xfff0; inp->def_send.sinfo_flags |= info->pr_policy; + inp->def_send.sinfo_timetolive = info->pr_value; SCTP_INP_WUNLOCK(inp); } if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || @@ -5296,6 +5366,7 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); stcb->asoc.def_send.sinfo_flags &= 0xfff0; stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + stcb->asoc.def_send.sinfo_timetolive = info->pr_value; SCTP_TCB_UNLOCK(stcb); } SCTP_INP_RUNLOCK(inp); @@ -5431,7 +5502,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; } } else { - if (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.def_net_failure = thlds->spt_pathmaxrxt; inp->sctp_ep.def_net_pf_threshold = thlds->spt_pathpfthld; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:52:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0E2106566C; Fri, 10 Feb 2012 22:52:09 +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 0D1358FC16; Fri, 10 Feb 2012 22:52: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 q1AMq8MU099772; Fri, 10 Feb 2012 22:52:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMq8eb099770; Fri, 10 Feb 2012 22:52:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102252.q1AMq8eb099770@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231459 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:52:09 -0000 Author: tuexen Date: Fri Feb 10 22:52:08 2012 New Revision: 231459 URL: http://svn.freebsd.org/changeset/base/231459 Log: MFC r225462: Improve implementation of the Nagle algorithm for SCTP: Don't delay the final fragment of a fragmented user message. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:49:09 2012 (r231458) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:52:08 2012 (r231459) @@ -9821,19 +9821,22 @@ sctp_chunk_output(struct sctp_inpcb *inp unsigned int burst_cnt = 0; struct timeval now; int now_filled = 0; - int nagle_on = 0; + int nagle_on; int frag_point = sctp_get_frag_point(stcb, &stcb->asoc); int un_sent = 0; int fr_done; unsigned int tot_frs = 0; asoc = &stcb->asoc; + /* The Nagle algorithm is only applied when handling a send call. */ if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) { nagle_on = 0; } else { nagle_on = 1; } + } else { + nagle_on = 0; } SCTP_TCB_LOCK_ASSERT(stcb); @@ -10007,15 +10010,18 @@ sctp_chunk_output(struct sctp_inpcb *inp } } if (nagle_on) { - /*- - * When nagle is on, we look at how much is un_sent, then - * if its smaller than an MTU and we have data in - * flight we stop. + /* + * When the Nagle algorithm is used, look at how + * much is unsent, then if its smaller than an MTU + * and we have data in flight we stop, except if we + * are handling a fragmented user message. */ un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); if ((un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD)) && - (stcb->asoc.total_flight > 0)) { + (stcb->asoc.total_flight > 0) && + ((stcb->asoc.locked_on_sending == NULL) || + sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { break; } } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:54:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB25106566B; Fri, 10 Feb 2012 22:54:58 +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 69FF38FC17; Fri, 10 Feb 2012 22:54: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 q1AMswa6099899; Fri, 10 Feb 2012 22:54:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMswqv099892; Fri, 10 Feb 2012 22:54:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102254.q1AMswqv099892@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231460 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:54:58 -0000 Author: tuexen Date: Fri Feb 10 22:54:58 2012 New Revision: 231460 URL: http://svn.freebsd.org/changeset/base/231460 Log: MFC r225549: Fix the handling of the flowlabel and DSCP value in the SCTP_PEER_ADDR_PARAMS socket option. Honor the net.inet6.ip6.auto_flowlabel sysctl setting. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:54:58 2012 (r231460) @@ -3904,6 +3904,7 @@ sctp_lowlevel_chunk_output(struct sctp_i uint32_t vrf_id; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; + uint8_t tos_value; #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; @@ -3925,13 +3926,20 @@ sctp_lowlevel_chunk_output(struct sctp_i if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); } + if (net) { + tos_value = net->dscp; + } else if (stcb) { + tos_value = stcb->asoc.default_dscp; + } else { + tos_value = inp->sctp_ep.default_dscp; + } + switch (to->sa_family) { #ifdef INET case AF_INET: { struct ip *ip = NULL; sctp_route_t iproute; - uint8_t tos_value; int len; len = sizeof(struct ip) + sizeof(struct sctphdr); @@ -3966,11 +3974,18 @@ sctp_lowlevel_chunk_output(struct sctp_i ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; ip->ip_hl = (sizeof(struct ip) >> 2); - if (net) { - tos_value = net->dscp; - } else { + if (tos_value == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ tos_value = inp->ip_inp.inp.inp_ip_tos; } + tos_value &= 0xfc; + if (ecn_ok) { + tos_value |= sctp_get_ect(stcb, chk); + } if ((nofragment_flag) && (port == 0)) { ip->ip_off = IP_DF; } else @@ -3981,10 +3996,7 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_ttl = inp->ip_inp.inp.inp_ip_ttl; ip->ip_len = packet_length; - ip->ip_tos = tos_value & 0xfc; - if (ecn_ok) { - ip->ip_tos |= sctp_get_ect(stcb, chk); - } + ip->ip_tos = tos_value; if (port) { ip->ip_p = IPPROTO_UDP; } else { @@ -4189,13 +4201,10 @@ sctp_lowlevel_chunk_output(struct sctp_i #ifdef INET6 case AF_INET6: { - uint32_t flowlabel; + uint32_t flowlabel, flowinfo; struct ip6_hdr *ip6h; struct route_in6 ip6route; struct ifnet *ifp; - u_char flowTop; - uint16_t flowBottom; - u_char tosBottom, tosTop; struct sockaddr_in6 *sin6, tmp, *lsa6, lsa6_tmp; int prev_scope = 0; struct sockaddr_in6 lsa6_storage; @@ -4203,12 +4212,22 @@ sctp_lowlevel_chunk_output(struct sctp_i u_short prev_port = 0; int len; - if (net != NULL) { + if (net) { flowlabel = net->flowlabel; + } else if (stcb) { + flowlabel = stcb->asoc.default_flowlabel; } else { - flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; + flowlabel = inp->sctp_ep.default_flowlabel; } - + if (flowlabel == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ + flowlabel = ntohl(((struct in6pcb *)inp)->in6p_flowinfo); + } + flowlabel &= 0x000fffff; len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr); if (port) { len += sizeof(struct udphdr); @@ -4240,13 +4259,6 @@ sctp_lowlevel_chunk_output(struct sctp_i packet_length = sctp_calculate_len(m); ip6h = mtod(m, struct ip6_hdr *); - /* - * We assume here that inp_flow is in host byte - * order within the TCB! - */ - flowBottom = flowlabel & 0x0000ffff; - flowTop = ((flowlabel & 0x000f0000) >> 16); - tosTop = (((flowlabel & 0xf0) >> 4) | IPV6_VERSION); /* protect *sin6 from overwrite */ sin6 = (struct sockaddr_in6 *)to; tmp = *sin6; @@ -4264,12 +4276,28 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { ro = (sctp_route_t *) & net->ro; } - tosBottom = (((struct in6pcb *)inp)->in6p_flowinfo & 0x0c); + /* + * We assume here that inp_flow is in host byte + * order within the TCB! + */ + if (tos_value == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ + tos_value = (ntohl(((struct in6pcb *)inp)->in6p_flowinfo) >> 20) & 0xff; + } + tos_value &= 0xfc; if (ecn_ok) { - tosBottom |= sctp_get_ect(stcb, chk); + tos_value |= sctp_get_ect(stcb, chk); } - tosBottom <<= 4; - ip6h->ip6_flow = htonl(((tosTop << 24) | ((tosBottom | flowTop) << 16) | flowBottom)); + flowinfo = 0x06; + flowinfo <<= 8; + flowinfo |= tos_value; + flowinfo <<= 20; + flowinfo |= flowlabel; + ip6h->ip6_flow = htonl(flowinfo); if (port) { ip6h->ip6_nxt = IPPROTO_UDP; } else { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:54:58 2012 (r231460) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #include #include #include @@ -2503,6 +2506,11 @@ sctp_inpcb_alloc(struct socket *so, uint /* setup socket pointers */ inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; +#ifdef INET6 + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } +#endif inp->sctp_associd_counter = 1; inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; @@ -2668,6 +2676,10 @@ sctp_inpcb_alloc(struct socket *so, uint */ m->local_hmacs = sctp_default_supported_hmaclist(); m->local_auth_chunks = sctp_alloc_chunklist(); + m->default_dscp = 0; +#ifdef INET6 + m->default_flowlabel = 0; +#endif sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -4015,7 +4027,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->port = 0; } net->dscp = stcb->asoc.default_dscp; +#ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; +#endif if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 22:54:58 2012 (r231460) @@ -322,6 +322,10 @@ struct sctp_pcb { uint32_t store_at; uint32_t max_burst; uint32_t fr_max_burst; +#ifdef INET6 + uint32_t default_flowlabel; +#endif + uint8_t default_dscp; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:54:58 2012 (r231460) @@ -321,7 +321,9 @@ struct sctp_nets { uint32_t fast_recovery_tsn; uint32_t heartbeat_random1; uint32_t heartbeat_random2; +#ifdef INET6 uint32_t flowlabel; +#endif uint8_t dscp; struct timeval start_time; /* time when this net was created */ @@ -987,7 +989,9 @@ struct sctp_association { uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ +#ifdef INET6 uint32_t default_flowlabel; +#endif uint32_t pr_sctp_cnt; int ctrl_queue_cnt; /* could be removed REM - NO IT CAN'T!! RRS */ /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:54:58 2012 (r231460) @@ -2417,15 +2417,14 @@ flags_out: } else { paddrp->spp_flags |= SPP_PMTUD_DISABLE; } -#ifdef INET - if (net->ro._l_addr.sin.sin_family == AF_INET) { - paddrp->spp_dscp = net->dscp; + if (net->dscp & 0x01) { + paddrp->spp_dscp = net->dscp >> 2; paddrp->spp_flags |= SPP_DSCP; } -#endif #ifdef INET6 - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - paddrp->spp_ipv6_flowlabel = net->flowlabel; + if ((net->ro._l_addr.sa.sa_family == AF_INET6) && + (net->flowlabel & 0x80000000)) { + paddrp->spp_ipv6_flowlabel = net->flowlabel & 0x000fffff; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -2438,13 +2437,15 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); -#ifdef INET - paddrp->spp_dscp = stcb->asoc.default_dscp & 0x000000fc; - paddrp->spp_flags |= SPP_DSCP; -#endif + if (stcb->asoc.default_dscp & 0x01) { + paddrp->spp_dscp = stcb->asoc.default_dscp >> 2; + paddrp->spp_flags |= SPP_DSCP; + } #ifdef INET6 - paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel; - paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; + if (stcb->asoc.default_flowlabel & 0x80000000) { + paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel & 0x000fffff; + paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; + } #endif /* default settings should be these */ if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { @@ -2474,13 +2475,14 @@ flags_out: paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ -#ifdef INET - paddrp->spp_dscp = inp->ip_inp.inp.inp_ip_tos; - paddrp->spp_flags |= SPP_DSCP; -#endif + if (inp->sctp_ep.default_dscp & 0x01) { + paddrp->spp_dscp = inp->sctp_ep.default_dscp >> 2; + paddrp->spp_flags |= SPP_DSCP; + } #ifdef INET6 - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - paddrp->spp_ipv6_flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && + (inp->sctp_ep.default_flowlabel & 0x80000000)) { + paddrp->spp_ipv6_flowlabel = inp->sctp_ep.default_flowlabel & 0x000fffff; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -4651,17 +4653,15 @@ sctp_setopt(struct socket *so, int optna } net->failure_threshold = paddrp->spp_pathmaxrxt; } -#ifdef INET if (paddrp->spp_flags & SPP_DSCP) { - if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->dscp = paddrp->spp_dscp & 0xfc; - } + net->dscp = paddrp->spp_dscp << 2; + net->dscp |= 0x01; } -#endif #ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { + if (net->ro._l_addr.sa.sa_family == AF_INET6) { net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + net->flowlabel |= 0x80000000; } } #endif @@ -4752,16 +4752,24 @@ sctp_setopt(struct socket *so, int optna } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->dscp = paddrp->spp_dscp & 0x000000fc; + net->dscp = paddrp->spp_dscp << 2; + net->dscp |= 0x01; } - stcb->asoc.default_dscp = paddrp->spp_dscp & 0x000000fc; + stcb->asoc.default_dscp = paddrp->spp_dscp << 2; + stcb->asoc.default_dscp |= 0x01; } +#ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->flowlabel = paddrp->spp_ipv6_flowlabel; + if (net->ro._l_addr.sa.sa_family == AF_INET6) { + net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + net->flowlabel |= 0x80000000; + } } - stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel; + stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + stcb->asoc.default_flowlabel |= 0x80000000; } +#endif } SCTP_TCB_UNLOCK(stcb); } else { @@ -4795,6 +4803,18 @@ sctp_setopt(struct socket *so, int optna } else if (paddrp->spp_flags & SPP_HB_DISABLE) { sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } + if (paddrp->spp_flags & SPP_DSCP) { + inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; + inp->sctp_ep.default_dscp |= 0x01; + } +#ifdef INET6 + if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + inp->sctp_ep.default_flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + inp->sctp_ep.default_flowlabel |= 0x80000000; + } + } +#endif SCTP_INP_WUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:54:58 2012 (r231460) @@ -923,16 +923,19 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_cmt_pf = (uint8_t) 0; asoc->sctp_frag_point = m->sctp_frag_point; asoc->sctp_features = m->sctp_features; -#ifdef INET - asoc->default_dscp = m->ip_inp.inp.inp_ip_tos; -#else - asoc->default_dscp = 0; -#endif - + asoc->default_dscp = m->sctp_ep.default_dscp; #ifdef INET6 - asoc->default_flowlabel = ((struct in6pcb *)m)->in6p_flowinfo; -#else - asoc->default_flowlabel = 0; + if (m->sctp_ep.default_flowlabel) { + asoc->default_flowlabel = m->sctp_ep.default_flowlabel; + } else { + if (m->ip_inp.inp.inp_flags & IN6P_AUTOFLOWLABEL) { + asoc->default_flowlabel = sctp_select_initial_TSN(&m->sctp_ep); + asoc->default_flowlabel &= 0x000fffff; + asoc->default_flowlabel |= 0x80000000; + } else { + asoc->default_flowlabel = 0; + } + } #endif asoc->sb_send_resv = 0; if (override_tag) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 22:57:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54BD106566C; Fri, 10 Feb 2012 22:57:50 +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 D33A88FC13; Fri, 10 Feb 2012 22:57: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 q1AMvoCM000180; Fri, 10 Feb 2012 22:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMvo96000175; Fri, 10 Feb 2012 22:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102257.q1AMvo96000175@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231462 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:57:51 -0000 Author: tuexen Date: Fri Feb 10 22:57:50 2012 New Revision: 231462 URL: http://svn.freebsd.org/changeset/base/231462 Log: MFC r225559: Ensure that 1-to-1 style SCTP sockets can only be connected once. Allow implicit setup also for 1-to-1 style sockets as described in the latest version of the socket API ID. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:57:50 2012 (r231462) @@ -12628,14 +12628,10 @@ sctp_lower_sosend(struct socket *so, (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { SCTP_INP_RLOCK(inp); stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb == NULL) { - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); - error = ENOTCONN; - goto out_unlocked; + if (stcb) { + SCTP_TCB_LOCK(stcb); + hold_tcblock = 1; } - SCTP_TCB_LOCK(stcb); - hold_tcblock = 1; SCTP_INP_RUNLOCK(inp); } else if (sinfo_assoc_id) { stcb = sctp_findassociation_ep_asocid(inp, sinfo_assoc_id, 0); @@ -12700,21 +12696,12 @@ sctp_lower_sosend(struct socket *so, } } if (stcb == NULL) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); - error = ENOTCONN; - goto out_unlocked; - } if (addr == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOENT); error = ENOENT; goto out_unlocked; } else { - /* - * UDP style, we must go ahead and start the INIT - * process - */ + /* We must go ahead and start the INIT process */ uint32_t vrf_id; if ((sinfo_flags & SCTP_ABORT) || @@ -12741,6 +12728,14 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; + /* + * Set the connected flag so we can queue + * data + */ + soisconnecting(so); + } hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:57:50 2012 (r231462) @@ -4291,6 +4291,16 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, *error = EINVAL; return (NULL); } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) || + (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED)) { + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); + *error = EINVAL; + return (NULL); + } + } SCTPDBG(SCTP_DEBUG_PCB3, "Allocate an association for peer:"); #ifdef SCTP_DEBUG if (firstaddr) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:57:50 2012 (r231462) @@ -1541,6 +1541,11 @@ sctp_do_connect_x(struct socket *so, str /* Gak! no memory */ goto out_now; } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; + /* Set the connected flag so we can queue data */ + soisconnecting(so); + } SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); /* move to second address */ switch (sa->sa_family) { @@ -5740,15 +5745,6 @@ sctp_connect(struct socket *so, struct s if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; /* Set the connected flag so we can queue data */ - SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; - SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_state &= ~SBS_CANTSENDMORE; - SOCKBUF_UNLOCK(&so->so_snd); - SOCK_LOCK(so); - so->so_state &= ~SS_ISDISCONNECTING; - SOCK_UNLOCK(so); soisconnecting(so); } SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:57:50 2012 (r231462) @@ -3622,10 +3622,14 @@ sctp_abort_notification(struct sctp_tcb #endif ) { - if (stcb == NULL) { return; } + if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_CONNECTED))) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_WAS_ABORTED; + } if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { @@ -3633,11 +3637,6 @@ sctp_abort_notification(struct sctp_tcb } /* Tell them we lost the asoc */ sctp_report_all_outbound(stcb, 1, so_locked); - if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_CONNECTED))) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_WAS_ABORTED; - } sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, NULL, so_locked); } @@ -5098,17 +5097,6 @@ restart_nosblocks: */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); error = ECONNRESET; - /* - * You get this once if you are - * active open side - */ - if (!(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* - * Remove flag if on the - * active open side - */ - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_ABORTED; - } } so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | @@ -5118,8 +5106,6 @@ restart_nosblocks: if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); error = ENOTCONN; - } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_CONNECTED; } } goto out; @@ -5152,18 +5138,6 @@ restart_nosblocks: */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); error = ECONNRESET; - /* - * You get this once if you - * are active open side - */ - if (!(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* - * Remove flag if on - * the active open - * side - */ - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_ABORTED; - } } so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | @@ -5173,8 +5147,6 @@ restart_nosblocks: if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); error = ENOTCONN; - } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_CONNECTED; } } goto out; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:00:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B28106564A; Fri, 10 Feb 2012 23:00:25 +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 0D9358FC16; Fri, 10 Feb 2012 23:00: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 q1AN0OhQ000336; Fri, 10 Feb 2012 23:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AN0O0r000331; Fri, 10 Feb 2012 23:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102300.q1AN0O0r000331@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231463 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:00:25 -0000 Author: tuexen Date: Fri Feb 10 23:00:24 2012 New Revision: 231463 URL: http://svn.freebsd.org/changeset/base/231463 Log: MFC r225571: Make sure that SCTP rejects broadcast, multicast and wildcard addresses as remote addresses. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:00:24 2012 (r231463) @@ -207,6 +207,7 @@ sctp_process_asconf_add_ip(struct mbuf * uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; int zero_address = 0; + int bad_address = 0; #ifdef INET struct sockaddr_in *sin; @@ -239,6 +240,10 @@ sctp_process_asconf_add_ip(struct mbuf * sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; sin->sin_addr.s_addr = v4addr->addr; + if ((sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + bad_address = 1;; + } if (sin->sin_addr.s_addr == INADDR_ANY) zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); @@ -259,6 +264,9 @@ sctp_process_asconf_add_ip(struct mbuf * sin6->sin6_port = stcb->rport; memcpy((caddr_t)&sin6->sin6_addr, v6addr->addr, sizeof(struct in6_addr)); + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + bad_address = 1; + } if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); @@ -266,12 +274,8 @@ sctp_process_asconf_add_ip(struct mbuf * break; #endif default: - /* - * XXX: Is this the correct error cause? Maybe - * SCTP_CAUSE_INVALID_PARAM is a better choice. - */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); return m_reply; } /* end switch */ @@ -285,7 +289,11 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); } /* add the address */ - if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, + if (bad_address) { + m_reply = sctp_asconf_error_response(aph->correlation_id, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + aparam_length); + } else if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:00:24 2012 (r231463) @@ -3541,7 +3541,7 @@ sctp_process_cmsgs_for_init(struct sctp_ (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; - return (-1); + return (1); } if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { @@ -3564,7 +3564,7 @@ sctp_process_cmsgs_for_init(struct sctp_ if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { *error = EINVAL; - return (-1); + return (1); } #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { @@ -3573,7 +3573,7 @@ sctp_process_cmsgs_for_init(struct sctp_ (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; - return (-1); + return (1); } if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:00:24 2012 (r231463) @@ -4332,7 +4332,10 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr_in *sin; sin = (struct sockaddr_in *)firstaddr; - if ((sin->sin_port == 0) || (sin->sin_addr.s_addr == 0)) { + if ((ntohs(sin->sin_port) == 0) || + (sin->sin_addr.s_addr == INADDR_ANY) || + (sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); @@ -4349,8 +4352,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)firstaddr; - if ((sin6->sin6_port == 0) || - (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))) { + if ((ntohs(sin6->sin6_port) == 0) || + IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:00:24 2012 (r231463) @@ -560,7 +560,7 @@ sctp_bind(struct socket *so, struct sock struct sctp_inpcb *inp = NULL; int error; -#ifdef INET6 +#ifdef INET if (addr && addr->sa_family != AF_INET) { /* must be a v4 address! */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:00:24 2012 (r231463) @@ -6080,6 +6080,15 @@ sctp_connectx_helper_add(struct sctp_tcb struct sockaddr *sa; size_t incr = 0; +#ifdef INET + struct sockaddr_in *sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; + +#endif + sa = addr; inp = stcb->sctp_ep; *error = 0; @@ -6088,6 +6097,15 @@ sctp_connectx_helper_add(struct sctp_tcb #ifdef INET case AF_INET: incr = sizeof(struct sockaddr_in); + sin = (struct sockaddr_in *)sa; + if ((sin->sin_addr.s_addr == INADDR_ANY) || + (sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7); + *error = EINVAL; + goto out_now; + } if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); @@ -6101,6 +6119,14 @@ sctp_connectx_helper_add(struct sctp_tcb #ifdef INET6 case AF_INET6: incr = sizeof(struct sockaddr_in6); + sin6 = (struct sockaddr_in6 *)sa; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_8); + *error = EINVAL; + goto out_now; + } if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:02:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 262C91065672; Fri, 10 Feb 2012 23:02:46 +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 1489F8FC0C; Fri, 10 Feb 2012 23:02: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 q1AN2jfc000456; Fri, 10 Feb 2012 23:02:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AN2jd8000454; Fri, 10 Feb 2012 23:02:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102302.q1AN2jd8000454@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231464 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:02:46 -0000 Author: tuexen Date: Fri Feb 10 23:02:45 2012 New Revision: 231464 URL: http://svn.freebsd.org/changeset/base/231464 Log: MFC r225584: Fix a typo introduced in http://svn.freebsd.org/changeset/base/225571 Reported by Ilya A. Arkhipov. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:00:24 2012 (r231463) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:02:45 2012 (r231464) @@ -242,7 +242,7 @@ sctp_process_asconf_add_ip(struct mbuf * sin->sin_addr.s_addr = v4addr->addr; if ((sin->sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { - bad_address = 1;; + bad_address = 1; } if (sin->sin_addr.s_addr == INADDR_ANY) zero_address = 1; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:12:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDE7106564A; Fri, 10 Feb 2012 23:12:48 +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 8F29C8FC24; Fri, 10 Feb 2012 23:12: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 q1ANCmTC000857; Fri, 10 Feb 2012 23:12:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANCmjH000851; Fri, 10 Feb 2012 23:12:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102312.q1ANCmjH000851@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231466 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:12:48 -0000 Author: tuexen Date: Fri Feb 10 23:12:48 2012 New Revision: 231466 URL: http://svn.freebsd.org/changeset/base/231466 Log: MFC r225635: Fix the enabling/disabling of Heartbeats and path MTU discovery when using the SCTP_PEER_ADDR_PARAMS socket option. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 23:12:48 2012 (r231466) @@ -496,6 +496,7 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ +#define SCTP_PCB_FLAGS_DO_NOT_PMTUD 0x00000001 #define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */ #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004 #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008 Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 23:12:48 2012 (r231466) @@ -508,6 +508,7 @@ __FBSDID("$FreeBSD$"); /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 +#define SCTP_ADDR_NO_PMTUD 0x002 #define SCTP_ADDR_NOHB 0x004 #define SCTP_ADDR_BEING_DELETED 0x008 #define SCTP_ADDR_NOT_IN_ASSOC 0x010 Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:12:48 2012 (r231466) @@ -4030,11 +4030,16 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; #endif - if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { net->dest_state &= ~SCTP_ADDR_NOHB; } + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + net->dest_state |= SCTP_ADDR_NO_PMTUD; + } else { + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; + } net->heart_beat_delay = stcb->asoc.heart_beat_delay; /* Init the timer structure */ SCTP_OS_TIMER_INIT(&net->rxt_timer.timer); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:12:48 2012 (r231466) @@ -2412,12 +2412,13 @@ flags_out: paddrp->spp_pathmaxrxt = net->failure_threshold; paddrp->spp_pathmtu = net->mtu - ovh; /* get flags for HB */ - if (net->dest_state & SCTP_ADDR_NOHB) + if (net->dest_state & SCTP_ADDR_NOHB) { paddrp->spp_flags |= SPP_HB_DISABLE; - else + } else { paddrp->spp_flags |= SPP_HB_ENABLE; + } /* get flags for PMTU */ - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { paddrp->spp_flags |= SPP_PMTUD_ENABLE; } else { paddrp->spp_flags |= SPP_PMTUD_DISABLE; @@ -2438,8 +2439,6 @@ flags_out: * No destination so return default * value */ - int cnt = 0; - paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); if (stcb->asoc.default_dscp & 0x01) { @@ -2453,20 +2452,17 @@ flags_out: } #endif /* default settings should be these */ - if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { paddrp->spp_flags |= SPP_HB_DISABLE; } else { paddrp->spp_flags |= SPP_HB_ENABLE; } - paddrp->spp_hbinterval = stcb->asoc.heart_beat_delay; - TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { - cnt++; - } - } - if (cnt) { + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + paddrp->spp_flags |= SPP_PMTUD_DISABLE; + } else { paddrp->spp_flags |= SPP_PMTUD_ENABLE; } + paddrp->spp_hbinterval = stcb->asoc.heart_beat_delay; } paddrp->spp_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); @@ -2494,14 +2490,16 @@ flags_out: /* can't return this */ paddrp->spp_pathmtu = 0; - /* default behavior, no stcb */ - paddrp->spp_flags = SPP_PMTUD_ENABLE; - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { paddrp->spp_flags |= SPP_HB_ENABLE; } else { paddrp->spp_flags |= SPP_HB_DISABLE; } + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + paddrp->spp_flags |= SPP_PMTUD_ENABLE; + } else { + paddrp->spp_flags |= SPP_PMTUD_DISABLE; + } SCTP_INP_RUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -4619,6 +4617,7 @@ sctp_setopt(struct socket *so, int optna sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } + net->dest_state |= SCTP_ADDR_NO_PMTUD; if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { @@ -4627,9 +4626,10 @@ sctp_setopt(struct socket *so, int optna } } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); } + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } if (paddrp->spp_pathmaxrxt) { if (net->dest_state & SCTP_ADDR_PF) { @@ -4722,9 +4722,9 @@ sctp_setopt(struct socket *so, int optna SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } + sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } if (paddrp->spp_flags & SPP_HB_DISABLE) { - /* Turn back on the timer */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (!(net->dest_state & SCTP_ADDR_NOHB)) { net->dest_state |= SCTP_ADDR_NOHB; @@ -4733,6 +4733,7 @@ sctp_setopt(struct socket *so, int optna } } } + sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -4740,6 +4741,7 @@ sctp_setopt(struct socket *so, int optna sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } + net->dest_state |= SCTP_ADDR_NO_PMTUD; if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { @@ -4747,13 +4749,16 @@ sctp_setopt(struct socket *so, int optna } } } + sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); } + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } + sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -4808,6 +4813,11 @@ sctp_setopt(struct socket *so, int optna } else if (paddrp->spp_flags & SPP_HB_DISABLE) { sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } + if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { + sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); + } else if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { + sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); + } if (paddrp->spp_flags & SPP_DSCP) { inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; inp->sctp_ep.default_dscp |= 0x01; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:12:48 2012 (r231466) @@ -2052,6 +2052,9 @@ sctp_timer_start(int t_type, struct sctp if (net == NULL) { return; } + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { + return; + } to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_PMTU]; tmr = &net->pmtu_timer; break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:15:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55176106566C; Fri, 10 Feb 2012 23:15:11 +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 38C348FC13; Fri, 10 Feb 2012 23:15: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 q1ANFBVT000978; Fri, 10 Feb 2012 23:15:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANFBGQ000974; Fri, 10 Feb 2012 23:15:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102315.q1ANFBGQ000974@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231467 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:15:11 -0000 Author: tuexen Date: Fri Feb 10 23:15:10 2012 New Revision: 231467 URL: http://svn.freebsd.org/changeset/base/231467 Log: MFC r225676: Cleanup the iterator code, remove code that is never executed. Modified: stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 23:15:10 2012 (r231467) @@ -74,22 +74,6 @@ MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore" /* Global NON-VNET structure that controls the iterator */ struct iterator_control sctp_it_ctl; -static int __sctp_thread_based_iterator_started = 0; - - -static void -sctp_cleanup_itqueue(void) -{ - struct sctp_iterator *it, *nit; - - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - if (it->function_atend != NULL) { - (*it->function_atend) (it->pointer, it->val); - } - TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); - SCTP_FREE(it, SCTP_M_ITER); - } -} void @@ -102,17 +86,11 @@ static void sctp_iterator_thread(void *v) { SCTP_IPI_ITERATOR_WQ_LOCK(); + /* In FreeBSD this thread never terminates. */ while (1) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - SCTP_IPI_ITERATOR_WQ_DESTROY(); - SCTP_ITERATOR_LOCK_DESTROY(); - sctp_cleanup_itqueue(); - __sctp_thread_based_iterator_started = 0; - kthread_exit(); - } sctp_iterator_worker(); } } @@ -120,21 +98,21 @@ sctp_iterator_thread(void *v) void sctp_startup_iterator(void) { - if (__sctp_thread_based_iterator_started) { + static int called = 0; + int ret; + + if (called) { /* You only get one */ return; } /* init the iterator head */ - __sctp_thread_based_iterator_started = 1; + called = 1; sctp_it_ctl.iterator_running = 0; sctp_it_ctl.iterator_flags = 0; sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_LOCK_INIT(); SCTP_IPI_ITERATOR_WQ_INIT(); TAILQ_INIT(&sctp_it_ctl.iteratorhead); - - int ret; - ret = kproc_create(sctp_iterator_thread, (void *)NULL, &sctp_it_ctl.thread_proc, Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:15:10 2012 (r231467) @@ -185,9 +185,8 @@ struct iterator_control { uint32_t iterator_flags; }; -#define SCTP_ITERATOR_MUST_EXIT 0x00000001 -#define SCTP_ITERATOR_STOP_CUR_IT 0x00000002 -#define SCTP_ITERATOR_STOP_CUR_INP 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_IT 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_INP 0x00000008 struct sctp_net_route { sctp_rtentry_t *ro_rt; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:15:10 2012 (r231467) @@ -1293,10 +1293,6 @@ select_a_new_ep: SCTP_INP_DECR_REF(it->inp); atomic_add_int(&it->stcb->asoc.refcnt, -1); if (sctp_it_ctl.iterator_flags & - SCTP_ITERATOR_MUST_EXIT) { - goto done_with_iterator; - } - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_STOP_CUR_IT) { sctp_it_ctl.iterator_flags &= ~SCTP_ITERATOR_STOP_CUR_IT; goto done_with_iterator; @@ -1372,9 +1368,6 @@ sctp_iterator_worker(void) sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - break; - } /* sa_ignore FREED_MEMORY */ } sctp_it_ctl.iterator_running = 0; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:17:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795B31065675; Fri, 10 Feb 2012 23:17: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 67A898FC13; Fri, 10 Feb 2012 23:17: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 q1ANHX9j001183; Fri, 10 Feb 2012 23:17:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANHX3q001180; Fri, 10 Feb 2012 23:17:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102317.q1ANHX3q001180@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231468 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:17:33 -0000 Author: tuexen Date: Fri Feb 10 23:17:33 2012 New Revision: 231468 URL: http://svn.freebsd.org/changeset/base/231468 Log: MFC r226168: Update the inp stored in a HB-timer when moving an stcb to a new inp. Use only this stored inp when processing a HB timeout. This fixes a bug which results in a crash. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:15:10 2012 (r231467) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:17:33 2012 (r231468) @@ -2804,6 +2804,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpc /* now what about the nets? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { net->pmtu_timer.ep = (void *)new_inp; + net->hb_timer.ep = (void *)new_inp; net->rxt_timer.ep = (void *)new_inp; } SCTP_INP_WUNLOCK(new_inp); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:15:10 2012 (r231467) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:17:33 2012 (r231468) @@ -1661,7 +1661,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif if (!(net->dest_state & SCTP_ADDR_NOHB)) { - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_HB_TMR, SCTP_SO_NOT_LOCKED); } break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:19:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D7D106567A; Fri, 10 Feb 2012 23:19: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 6ECE18FC14; Fri, 10 Feb 2012 23:19: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 q1ANJXdL001348; Fri, 10 Feb 2012 23:19:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANJXF0001346; Fri, 10 Feb 2012 23:19:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102319.q1ANJXF0001346@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231469 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:19:33 -0000 Author: tuexen Date: Fri Feb 10 23:19:33 2012 New Revision: 231469 URL: http://svn.freebsd.org/changeset/base/231469 Log: MFC r226203: When moving an stcb to a new inp and we copy over the list of bound addresses, update the last used address pointer. If not, it might result in a crash if the old inp goes away. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:17:33 2012 (r231468) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:19:33 2012 (r231469) @@ -2786,6 +2786,9 @@ sctp_move_pcb_and_assoc(struct sctp_inpc LIST_INSERT_HEAD(&new_inp->sctp_addr_list, laddr, sctp_nxt_addr); new_inp->laddr_count++; + if (oladdr == stcb->asoc.last_used_address) { + stcb->asoc.last_used_address = laddr; + } } } /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:24:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22DC106566B; Fri, 10 Feb 2012 23:24:34 +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 8604D8FC12; Fri, 10 Feb 2012 23:24: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 q1ANOYK5001607; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANOYN1001605; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102324.q1ANOYN1001605@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231471 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:24:34 -0000 Author: tuexen Date: Fri Feb 10 23:24:34 2012 New Revision: 231471 URL: http://svn.freebsd.org/changeset/base/231471 Log: MFC r226252: Use the most significant 6 bits of the dscp instead of the least significant ones. This has changed in the latest version of the socket API ID and provides backwards compatibility and gets it in syn with the usage of the IP_TOS socket option. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:33 2012 (r231470) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:34 2012 (r231471) @@ -2424,7 +2424,7 @@ flags_out: paddrp->spp_flags |= SPP_PMTUD_DISABLE; } if (net->dscp & 0x01) { - paddrp->spp_dscp = net->dscp >> 2; + paddrp->spp_dscp = net->dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -2442,7 +2442,7 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); if (stcb->asoc.default_dscp & 0x01) { - paddrp->spp_dscp = stcb->asoc.default_dscp >> 2; + paddrp->spp_dscp = stcb->asoc.default_dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -2477,7 +2477,7 @@ flags_out: paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ if (inp->sctp_ep.default_dscp & 0x01) { - paddrp->spp_dscp = inp->sctp_ep.default_dscp >> 2; + paddrp->spp_dscp = inp->sctp_ep.default_dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -4659,7 +4659,7 @@ sctp_setopt(struct socket *so, int optna net->failure_threshold = paddrp->spp_pathmaxrxt; } if (paddrp->spp_flags & SPP_DSCP) { - net->dscp = paddrp->spp_dscp << 2; + net->dscp = paddrp->spp_dscp & 0xfc; net->dscp |= 0x01; } #ifdef INET6 @@ -4762,10 +4762,10 @@ sctp_setopt(struct socket *so, int optna } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->dscp = paddrp->spp_dscp << 2; + net->dscp = paddrp->spp_dscp & 0xfc; net->dscp |= 0x01; } - stcb->asoc.default_dscp = paddrp->spp_dscp << 2; + stcb->asoc.default_dscp = paddrp->spp_dscp & 0xfc; stcb->asoc.default_dscp |= 0x01; } #ifdef INET6 @@ -4819,7 +4819,7 @@ sctp_setopt(struct socket *so, int optna sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { - inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; + inp->sctp_ep.default_dscp = paddrp->spp_dscp & 0xfc; inp->sctp_ep.default_dscp |= 0x01; } #ifdef INET6 From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:26:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2617E106566C; Fri, 10 Feb 2012 23:26:44 +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 EE8FE8FC08; Fri, 10 Feb 2012 23:26: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 q1ANQhDf001717; Fri, 10 Feb 2012 23:26:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANQhVB001715; Fri, 10 Feb 2012 23:26:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102326.q1ANQhVB001715@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231472 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:26:44 -0000 Author: tuexen Date: Fri Feb 10 23:26:43 2012 New Revision: 231472 URL: http://svn.freebsd.org/changeset/base/231472 Log: MFC r226868: Send out control chunks which have no specific destination. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:24:34 2012 (r231471) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:26:43 2012 (r231472) @@ -8003,12 +8003,20 @@ again_one_more_time: if (chk->rec.chunk_id.id != SCTP_ASCONF) { continue; } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - break; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + break; + } + } else { + if (asoc->alternate != net) { + break; + } + } + } else { + if (chk->whoTo != net) { + break; + } } if (chk->data == NULL) { break; @@ -8092,6 +8100,10 @@ again_one_more_time: */ no_data_chunks = 1; chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; if (mtu == 0) { /* @@ -8198,12 +8210,20 @@ again_one_more_time: goto skip_net_check; } } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - continue; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + continue; + } + } else { + if (asoc->alternate != net) { + continue; + } + } + } else { + if (chk->whoTo != net) { + continue; + } } skip_net_check: if (chk->data == NULL) { @@ -8332,6 +8352,10 @@ again_one_more_time: SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; } if (mtu == 0) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:29:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07211065673; Fri, 10 Feb 2012 23:29: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 9EF6A8FC0C; Fri, 10 Feb 2012 23:29: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 q1ANT8Q6001832; Fri, 10 Feb 2012 23:29:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANT8Tl001830; Fri, 10 Feb 2012 23:29:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102329.q1ANT8Tl001830@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231473 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:29:08 -0000 Author: tuexen Date: Fri Feb 10 23:29:08 2012 New Revision: 231473 URL: http://svn.freebsd.org/changeset/base/231473 Log: MFC r226869: When add a new remote address using sctp_add_remote_addr(), return the correct net if requested. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:26:43 2012 (r231472) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:29:08 2012 (r231473) @@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INVARIANTS net->flowidset = 1; #endif + if (netp) { + *netp = net; + } netfirst = TAILQ_FIRST(&stcb->asoc.nets); if (net->ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4209,9 +4212,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } - if (netp) { - *netp = net; - } return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:32:04 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B43481065678; Fri, 10 Feb 2012 23:32: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 A28898FC1A; Fri, 10 Feb 2012 23:32: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 q1ANW47J002019; Fri, 10 Feb 2012 23:32:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANW4pW002017; Fri, 10 Feb 2012 23:32:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102332.q1ANW4pW002017@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231475 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:32:04 -0000 Author: tuexen Date: Fri Feb 10 23:32:04 2012 New Revision: 231475 URL: http://svn.freebsd.org/changeset/base/231475 Log: MFC r227266: Initialize all components of the sent COOKIE. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:30:29 2012 (r231474) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:32:04 2012 (r231475) @@ -5711,6 +5711,8 @@ do_a_abort: stc.laddress[2] = 0; stc.laddress[3] = 0; stc.laddr_type = SCTP_IPV4_ADDRESS; + /* scope_id is only for v6 */ + stc.scope_id = 0; break; #endif #ifdef INET6 @@ -5719,6 +5721,7 @@ do_a_abort: memcpy(&stc.address, &sin6->sin6_addr, sizeof(struct in6_addr)); stc.addr_type = SCTP_IPV6_ADDRESS; + stc.scope_id = sin6->sin6_scope_id; if (net->src_addr_selected == 0) { /* * strange case here, the INIT should have @@ -5746,6 +5749,7 @@ do_a_abort: /* who are we */ memcpy(stc.identification, SCTP_VERSION_STRING, min(strlen(SCTP_VERSION_STRING), sizeof(stc.identification))); + memset(stc.reserved, 0, SCTP_RESERVE_SPACE); /* now the chunk header */ initack->ch.chunk_type = SCTP_INITIATION_ACK; initack->ch.chunk_flags = 0; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:34:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 873731065678; Fri, 10 Feb 2012 23:34: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 758708FC14; Fri, 10 Feb 2012 23:34: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 q1ANY7W7002136; Fri, 10 Feb 2012 23:34:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANY7dJ002134; Fri, 10 Feb 2012 23:34:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102334.q1ANY7dJ002134@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231476 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:34:07 -0000 Author: tuexen Date: Fri Feb 10 23:34:07 2012 New Revision: 231476 URL: http://svn.freebsd.org/changeset/base/231476 Log: MFC r227320: When loading addresses from INITs, always use the correct local address. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:32:04 2012 (r231475) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:34:07 2012 (r231476) @@ -6181,54 +6181,65 @@ sctp_load_addresses_from_init(struct sct sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; #endif - if (altsa == NULL) { - iph = mtod(m, struct ip *); - switch (iph->ip_v) { + iph = mtod(m, struct ip *); + switch (iph->ip_v) { #ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *sin_2; - - sin_2 = (struct sockaddr_in *)(local_sa); - memset(sin_2, 0, sizeof(sin)); - sin_2->sin_family = AF_INET; - sin_2->sin_len = sizeof(sin); - sin_2->sin_port = sh->dest_port; - sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + case IPVERSION: + { + /* its IPv4 */ + struct sockaddr_in *sin_2; + + sin_2 = (struct sockaddr_in *)(local_sa); + memset(sin_2, 0, sizeof(sin)); + sin_2->sin_family = AF_INET; + sin_2->sin_len = sizeof(sin); + sin_2->sin_port = sh->dest_port; + sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin.sin_addr = iph->ip_src; sa = (struct sockaddr *)&sin; - break; } + break; + } #endif #ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *sin6_2; - - ip6 = mtod(m, struct ip6_hdr *); - sin6_2 = (struct sockaddr_in6 *)(local_sa); - memset(sin6_2, 0, sizeof(sin6)); - sin6_2->sin6_family = AF_INET6; - sin6_2->sin6_len = sizeof(struct sockaddr_in6); - sin6_2->sin6_port = sh->dest_port; + case IPV6_VERSION >> 4: + { + /* its IPv6 */ + struct ip6_hdr *ip6; + struct sockaddr_in6 *sin6_2; + + ip6 = mtod(m, struct ip6_hdr *); + sin6_2 = (struct sockaddr_in6 *)(local_sa); + memset(sin6_2, 0, sizeof(sin6)); + sin6_2->sin6_family = AF_INET6; + sin6_2->sin6_len = sizeof(struct sockaddr_in6); + sin6_2->sin6_port = sh->dest_port; + sin6_2->sin6_addr = ip6->ip6_dst; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin6.sin6_addr = ip6->ip6_src; sa = (struct sockaddr *)&sin6; - break; } -#endif - default: - return (-1); break; } - } else { - /* - * For cookies we use the src address NOT from the packet - * but from the original INIT - */ - sa = altsa; +#endif + default: + return (-1); + break; } /* Turn off ECN until we get through all params */ ecn_allowed = 0; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:36:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4D11065670; Fri, 10 Feb 2012 23:36:34 +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 0FA6C8FC1A; Fri, 10 Feb 2012 23:36: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 q1ANaXY2002254; Fri, 10 Feb 2012 23:36:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANaXhW002252; Fri, 10 Feb 2012 23:36:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102336.q1ANaXhW002252@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231477 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:36:34 -0000 Author: tuexen Date: Fri Feb 10 23:36:33 2012 New Revision: 231477 URL: http://svn.freebsd.org/changeset/base/231477 Log: MFC r227486: Don't copy uninitialized memory. Also simplify the comparison of interface names. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:34:07 2012 (r231476) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:36:33 2012 (r231477) @@ -559,9 +559,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - memcpy(sctp_ifnp->ifn_name, if_name, SCTP_IFNAMSIZ); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - memcpy(sctp_ifnp->ifn_name, "unknown", min(7, SCTP_IFNAMSIZ)); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -768,19 +768,9 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, * panda who might recycle indexes fast. */ if (if_name) { - int len1, len2; - - len1 = min(SCTP_IFNAMSIZ, strlen(if_name)); - len2 = min(SCTP_IFNAMSIZ, strlen(sctp_ifap->ifn_p->ifn_name)); - if (len1 && len2 && (len1 == len2)) { - /* we can compare them */ - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) == 0) { - /* - * They match its a correct - * delete - */ - valid = 1; - } + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { + /* They match its a correct delete */ + valid = 1; } } if (!valid) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:38:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1478106564A; Fri, 10 Feb 2012 23:38:38 +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 B57988FC17; Fri, 10 Feb 2012 23:38: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 q1ANcclK002358; Fri, 10 Feb 2012 23:38:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANccVm002356; Fri, 10 Feb 2012 23:38:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102338.q1ANccVm002356@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231478 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:38:39 -0000 Author: tuexen Date: Fri Feb 10 23:38:38 2012 New Revision: 231478 URL: http://svn.freebsd.org/changeset/base/231478 Log: MFC r227540: Set the MTU of an path to an approriate value if the interface MTU can't be determined. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:36:33 2012 (r231477) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:38:38 2012 (r231478) @@ -4064,13 +4064,8 @@ sctp_add_remote_addr(struct sctp_tcb *st /* Now get the interface MTU */ if (net->ro._s_addr && net->ro._s_addr->ifn_p) { net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); - } else { - net->mtu = 0; } - if (net->mtu == 0) { - /* Huh ?? */ - net->mtu = SCTP_DEFAULT_MTU; - } else { + if (net->mtu > 0) { uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); @@ -4090,11 +4085,31 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } - if (from == SCTP_ALLOC_ASOC) { - stcb->asoc.smallest_mtu = net->mtu; + } + if (net->mtu == 0) { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; } - } else { - net->mtu = stcb->asoc.smallest_mtu; + } + if (net->port) { + net->mtu -= (uint32_t) sizeof(struct udphdr); + } + if (from == SCTP_ALLOC_ASOC) { + stcb->asoc.smallest_mtu = net->mtu; + } + if (stcb->asoc.smallest_mtu > net->mtu) { + stcb->asoc.smallest_mtu = net->mtu; } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4104,12 +4119,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (void)sa6_recoverscope(sin6); } #endif - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; - } + /* JRS - Use the congestion control given in the CC module */ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:41:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 565B01065674; Fri, 10 Feb 2012 23:41:38 +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 2A85C8FC16; Fri, 10 Feb 2012 23:41: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 q1ANfc61002501; Fri, 10 Feb 2012 23:41:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANfclM002499; Fri, 10 Feb 2012 23:41:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102341.q1ANfclM002499@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231479 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:41:38 -0000 Author: tuexen Date: Fri Feb 10 23:41:37 2012 New Revision: 231479 URL: http://svn.freebsd.org/changeset/base/231479 Log: MFC r227655: Cleanup comparison of interface names. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:38:38 2012 (r231478) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:41:37 2012 (r231479) @@ -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-8@FreeBSD.ORG Fri Feb 10 23:49:05 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522C01065672; Fri, 10 Feb 2012 23:49:05 +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 28F678FC12; Fri, 10 Feb 2012 23:49: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 q1ANn5fr002785; Fri, 10 Feb 2012 23:49:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANn4G1002773; Fri, 10 Feb 2012 23:49:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102349.q1ANn4G1002773@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231480 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:49:05 -0000 Author: tuexen Date: Fri Feb 10 23:49:04 2012 New Revision: 231480 URL: http://svn.freebsd.org/changeset/base/231480 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/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 23:49:04 2012 (r231480) @@ -413,6 +413,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; default: break; } Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 23:49:04 2012 (r231480) @@ -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/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:49:04 2012 (r231480) @@ -4062,6 +4062,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; @@ -4413,6 +4419,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; @@ -10965,6 +10977,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; @@ -11925,6 +11941,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 */ @@ -12186,6 +12206,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/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:49:04 2012 (r231480) @@ -2650,6 +2650,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 */ @@ -3993,13 +3994,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/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 23:49:04 2012 (r231480) @@ -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/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:49:04 2012 (r231480) @@ -414,7 +414,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 { @@ -1211,6 +1211,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/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 23:49:04 2012 (r231480) @@ -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; @@ -666,10 +665,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); @@ -1089,10 +1084,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/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 23:49:04 2012 (r231480) @@ -110,7 +110,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; @@ -464,12 +463,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/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:49:04 2012 (r231480) @@ -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/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:49:04 2012 (r231480) @@ -3197,6 +3197,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; @@ -4494,7 +4580,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; @@ -5551,6 +5636,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/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:49:04 2012 (r231480) @@ -1117,6 +1117,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-8@FreeBSD.ORG Fri Feb 10 23:51:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7EA106564A; Fri, 10 Feb 2012 23:51:23 +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 AD1578FC08; Fri, 10 Feb 2012 23: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 q1ANpNL3002900; Fri, 10 Feb 2012 23:51:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANpN13002898; Fri, 10 Feb 2012 23:51:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102351.q1ANpN13002898@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231481 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:51:23 -0000 Author: tuexen Date: Fri Feb 10 23:51:23 2012 New Revision: 231481 URL: http://svn.freebsd.org/changeset/base/231481 Log: MFC r227930: Move up the address to the top of the sctp_paddrthlds structure like in all other structures. This avoids alignment problems. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:49:04 2012 (r231480) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:51:23 2012 (r231481) @@ -521,8 +521,8 @@ struct sctp_paddrparams { #define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { - sctp_assoc_t spt_assoc_id; struct sockaddr_storage spt_address; + sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; }; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 23:53:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDD10106564A; Fri, 10 Feb 2012 23:53:06 +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 CC8828FC13; Fri, 10 Feb 2012 23:53: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 q1ANr6LY002995; Fri, 10 Feb 2012 23:53:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANr6hL002993; Fri, 10 Feb 2012 23:53:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102353.q1ANr6hL002993@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231482 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:53:07 -0000 Author: tuexen Date: Fri Feb 10 23:53:06 2012 New Revision: 231482 URL: http://svn.freebsd.org/changeset/base/231482 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/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:51:23 2012 (r231481) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:53:06 2012 (r231482) @@ -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-8@FreeBSD.ORG Fri Feb 10 23:55:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC021065670; Fri, 10 Feb 2012 23:55:40 +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 91C388FC13; Fri, 10 Feb 2012 23:55: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 q1ANteed003128; Fri, 10 Feb 2012 23:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANtevS003125; Fri, 10 Feb 2012 23:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102355.q1ANtevS003125@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231483 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:55:40 -0000 Author: tuexen Date: Fri Feb 10 23:55:40 2012 New Revision: 231483 URL: http://svn.freebsd.org/changeset/base/231483 Log: MFC r228031: Fix a warning reported by arundel@. Fix a bug where the parameter length of a supported address types parameter is set to a wrong value if the kernel is built with with either INET or INET6, but not both. Modified: stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 23:53:06 2012 (r231482) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 23:55:40 2012 (r231483) @@ -81,8 +81,7 @@ struct sctp_host_name_param { /* supported address type */ struct sctp_supported_addr_param { struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ - uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address - * types */ + uint16_t addr_type[2]; /* array of supported address types */ } SCTP_PACKED; /* ECN parameter */ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:53:06 2012 (r231482) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:55:40 2012 (r231483) @@ -4680,24 +4680,24 @@ sctp_send_initiate(struct sctp_inpcb *in #ifdef INET6 #ifdef INET /* we support 2 types: IPv4/IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); #else /* we support 1 type: IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif #else /* we support 1 type: IPv4 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif - SCTP_BUF_LEN(m) += sizeof(*sup_addr) + sizeof(uint16_t); + SCTP_BUF_LEN(m) += sizeof(struct sctp_supported_addr_param); /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(*sup_addr) + sizeof(uint16_t)); + ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); ali->ph.param_length = htons(sizeof(*ali)); ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 11 00:46:06 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A551065672; Sat, 11 Feb 2012 00:46:06 +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 C70C78FC13; Sat, 11 Feb 2012 00:46: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 q1B0k6eM004843; Sat, 11 Feb 2012 00:46:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0k6XL004841; Sat, 11 Feb 2012 00:46:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110046.q1B0k6XL004841@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231486 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:46:07 -0000 Author: tuexen Date: Sat Feb 11 00:46:06 2012 New Revision: 231486 URL: http://svn.freebsd.org/changeset/base/231486 Log: MFC r228102: Remove debug code. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sat Feb 11 00:28:30 2012 (r231485) +++ stable/8/sys/netinet/sctp_pcb.c Sat Feb 11 00:46:06 2012 (r231486) @@ -6895,11 +6895,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) { @@ -7004,8 +6999,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-8@FreeBSD.ORG Sat Feb 11 00:48:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3770106566C; Sat, 11 Feb 2012 00:48: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 B7D0A8FC1A; Sat, 11 Feb 2012 00:48: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 q1B0mMKO004957; Sat, 11 Feb 2012 00:48:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0mMqM004954; Sat, 11 Feb 2012 00:48:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110048.q1B0mMqM004954@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231487 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:48:23 -0000 Author: tuexen Date: Sat Feb 11 00:48:22 2012 New Revision: 231487 URL: http://svn.freebsd.org/changeset/base/231487 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/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:46:06 2012 (r231486) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:48:22 2012 (r231487) @@ -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/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 00:46:06 2012 (r231486) +++ stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 00:48:22 2012 (r231487) @@ -4695,6 +4695,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-8@FreeBSD.ORG Sat Feb 11 00:49:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25C7106564A; Sat, 11 Feb 2012 00:49: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 D02988FC17; Sat, 11 Feb 2012 00:49: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 q1B0nsgP005049; Sat, 11 Feb 2012 00:49:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0nsfw005046; Sat, 11 Feb 2012 00:49:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110049.q1B0nsfw005046@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231488 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:49:55 -0000 Author: tuexen Date: Sat Feb 11 00:49:54 2012 New Revision: 231488 URL: http://svn.freebsd.org/changeset/base/231488 Log: MFC r228531: Fix a bug where sctp_sendmdg() uses uninitialized memory. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:48:22 2012 (r231487) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:49:54 2012 (r231488) @@ -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-8@FreeBSD.ORG Sat Feb 11 00:51:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89D2A1065678; Sat, 11 Feb 2012 00:51:26 +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 774CB8FC16; Sat, 11 Feb 2012 00:51: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 q1B0pQdu005150; Sat, 11 Feb 2012 00:51:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0pQnA005148; Sat, 11 Feb 2012 00:51:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110051.q1B0pQnA005148@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231489 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:51:26 -0000 Author: tuexen Date: Sat Feb 11 00:51:26 2012 New Revision: 231489 URL: http://svn.freebsd.org/changeset/base/231489 Log: MFC r228630: Address warnings found by clang. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:49:54 2012 (r231488) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:51:26 2012 (r231489) @@ -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-8@FreeBSD.ORG Sat Feb 11 00:54:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD035106566B; Sat, 11 Feb 2012 00:54:24 +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 A967A8FC13; Sat, 11 Feb 2012 00:54:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B0sOSk005301; Sat, 11 Feb 2012 00:54:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0sODo005283; Sat, 11 Feb 2012 00:54:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110054.q1B0sODo005283@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231490 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:54:24 -0000 Author: tuexen Date: Sat Feb 11 00:54:24 2012 New Revision: 231490 URL: http://svn.freebsd.org/changeset/base/231490 Log: MFC r228653: Fix unused parameter warnings. While there, fix some whitespace issues. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_os.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_asconf.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_auth.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_bsd_addr.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_bsd_addr.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_crc32.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_dtrace_define.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_header.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_indata.h Sat Feb 11 00:54:24 2012 (r231490) @@ -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/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:54:24 2012 (r231490) @@ -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-8@FreeBSD.ORG Sat Feb 11 00:57:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF9BB106566C; Sat, 11 Feb 2012 00:57: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 9CAA18FC0A; Sat, 11 Feb 2012 00:57: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 q1B0v8vO005487; Sat, 11 Feb 2012 00:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0v8rE005478; Sat, 11 Feb 2012 00:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110057.q1B0v8rE005478@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231492 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:57:08 -0000 Author: tuexen Date: Sat Feb 11 00:57:08 2012 New Revision: 231492 URL: http://svn.freebsd.org/changeset/base/231492 Log: MFC r228907: Address issues found by clang. While there, fix also some style issues. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_output.c Sat Feb 11 00:57:08 2012 (r231492) @@ -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) { @@ -4804,7 +4798,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; @@ -4813,9 +4806,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; @@ -4823,7 +4817,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 */ @@ -4853,7 +4847,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, @@ -5074,7 +5067,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; @@ -5317,6 +5309,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 @@ -5334,10 +5327,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 */ @@ -5546,7 +5541,7 @@ do_a_abort: default: goto do_a_abort; break; - }; + } if (net == NULL) { to = (struct sockaddr *)&store; @@ -5966,6 +5961,7 @@ do_a_abort: llen = 0; ol = op_err; + while (ol) { llen += SCTP_BUF_LEN(ol); ol = SCTP_BUF_NEXT(ol); @@ -6035,15 +6031,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; @@ -6242,7 +6234,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; @@ -6251,7 +6243,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); @@ -6320,7 +6311,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); @@ -6330,7 +6323,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); @@ -7597,7 +7592,6 @@ dont_do_it: out_of: if (send_lock_up) { SCTP_TCB_SEND_UNLOCK(stcb); - send_lock_up = 0; } return (to_move); } @@ -7612,7 +7606,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; @@ -7641,7 +7635,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; @@ -7954,7 +7947,7 @@ again_one_more_time: */ continue; } - ctl_cnt = bundle_at = 0; + bundle_at = 0; endoutchain = outchain = NULL; no_fragmentflg = 1; one_chunk = 0; @@ -8652,7 +8645,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) { @@ -8769,7 +8761,7 @@ no_data_fill: } else { asoc->ifp_had_enobuf = 0; } - outchain = endoutchain = NULL; + endoutchain = NULL; auth = NULL; auth_offset = 0; if (bundle_at || hbflag) { @@ -9233,7 +9225,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); @@ -9312,7 +9304,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; @@ -9405,7 +9396,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 @@ -9443,7 +9433,7 @@ sctp_chunk_retransmission(struct sctp_in SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* @@ -9613,16 +9603,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)) { @@ -9670,7 +9657,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; @@ -9702,7 +9688,7 @@ one_chunk_around: SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* For HB's */ @@ -10264,12 +10250,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-8@FreeBSD.ORG Sat Feb 11 00:59:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0117106564A; Sat, 11 Feb 2012 00:59: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 AEA3F8FC15; Sat, 11 Feb 2012 00:59: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 q1B0xMR0005597; Sat, 11 Feb 2012 00:59:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0xMMu005595; Sat, 11 Feb 2012 00:59:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110059.q1B0xMMu005595@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231493 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:59:22 -0000 Author: tuexen Date: Sat Feb 11 00:59:22 2012 New Revision: 231493 URL: http://svn.freebsd.org/changeset/base/231493 Log: MFC r229729: Use NULL instead of 0. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 00:57:08 2012 (r231492) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 00:59:22 2012 (r231493) @@ -1460,7 +1460,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-8@FreeBSD.ORG Sat Feb 11 01:01:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF04106566C; Sat, 11 Feb 2012 01:01: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 F30888FC0C; Sat, 11 Feb 2012 01:01: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 q1B117ln005719; Sat, 11 Feb 2012 01:01:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B117ie005717; Sat, 11 Feb 2012 01:01:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110101.q1B117ie005717@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231494 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:01:08 -0000 Author: tuexen Date: Sat Feb 11 01:01:07 2012 New Revision: 231494 URL: http://svn.freebsd.org/changeset/base/231494 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/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:59:22 2012 (r231493) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:01:07 2012 (r231494) @@ -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-8@FreeBSD.ORG Sat Feb 11 01:03:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8DC106564A; Sat, 11 Feb 2012 01:03:17 +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 8329C8FC0C; Sat, 11 Feb 2012 01:03: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 q1B13Hd2005832; Sat, 11 Feb 2012 01:03:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B13HmW005828; Sat, 11 Feb 2012 01:03:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110103.q1B13HmW005828@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231495 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:03:17 -0000 Author: tuexen Date: Sat Feb 11 01:03:17 2012 New Revision: 231495 URL: http://svn.freebsd.org/changeset/base/231495 Log: MFC r229775: 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/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:03:17 2012 (r231495) @@ -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/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:03:17 2012 (r231495) @@ -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; @@ -607,7 +606,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); @@ -876,10 +874,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/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:03:17 2012 (r231495) @@ -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; @@ -168,12 +167,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-8@FreeBSD.ORG Sat Feb 11 01:05:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31ED7106564A; Sat, 11 Feb 2012 01:05:42 +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 1F8288FC08; Sat, 11 Feb 2012 01:05: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 q1B15g6G005951; Sat, 11 Feb 2012 01:05:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B15fYV005945; Sat, 11 Feb 2012 01:05:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110105.q1B15fYV005945@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231496 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:05:42 -0000 Author: tuexen Date: Sat Feb 11 01:05:41 2012 New Revision: 231496 URL: http://svn.freebsd.org/changeset/base/231496 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/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:05:41 2012 (r231496) @@ -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/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:05:41 2012 (r231496) @@ -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)); @@ -665,6 +666,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); 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); @@ -1123,6 +1125,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/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:05:41 2012 (r231496) @@ -114,6 +114,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 @@ -519,6 +520,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/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 01:05:41 2012 (r231496) @@ -3801,6 +3801,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 */ @@ -3810,6 +3811,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) { @@ -3819,6 +3821,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; @@ -3844,7 +3849,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/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet6/sctp6_usrreq.c Sat Feb 11 01:05:41 2012 (r231496) @@ -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-8@FreeBSD.ORG Sat Feb 11 01:07:51 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0138106566C; Sat, 11 Feb 2012 01:07: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 BEB338FC0A; Sat, 11 Feb 2012 01:07: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 q1B17pH1006062; Sat, 11 Feb 2012 01:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B17pOc006060; Sat, 11 Feb 2012 01:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110107.q1B17pOc006060@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231497 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:07:51 -0000 Author: tuexen Date: Sat Feb 11 01:07:51 2012 New Revision: 231497 URL: http://svn.freebsd.org/changeset/base/231497 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/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 01:05:41 2012 (r231496) +++ stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 01:07:51 2012 (r231497) @@ -3008,7 +3008,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); } @@ -3027,7 +3027,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-8@FreeBSD.ORG Sat Feb 11 01:09:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31149106566B; Sat, 11 Feb 2012 01:09:47 +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 1F9E78FC0C; Sat, 11 Feb 2012 01:09: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 q1B19luO006164; Sat, 11 Feb 2012 01:09:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B19kT3006161; Sat, 11 Feb 2012 01:09:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110109.q1B19kT3006161@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231498 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:09:47 -0000 Author: tuexen Date: Sat Feb 11 01:09:46 2012 New Revision: 231498 URL: http://svn.freebsd.org/changeset/base/231498 Log: MFC r230136: Two cleanups. No functional change. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sat Feb 11 01:07:51 2012 (r231497) +++ stable/8/sys/netinet/sctp_output.c Sat Feb 11 01:09:46 2012 (r231498) @@ -12839,9 +12839,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/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 01:07:51 2012 (r231497) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 01:09:46 2012 (r231498) @@ -6373,7 +6373,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-8@FreeBSD.ORG Sat Feb 11 01:11:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DC8106564A; Sat, 11 Feb 2012 01:11:38 +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 216E68FC0C; Sat, 11 Feb 2012 01:11: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 q1B1Bc1r006278; Sat, 11 Feb 2012 01:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1Bc6h006276; Sat, 11 Feb 2012 01:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110111.q1B1Bc6h006276@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231499 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:11:38 -0000 Author: tuexen Date: Sat Feb 11 01:11:37 2012 New Revision: 231499 URL: http://svn.freebsd.org/changeset/base/231499 Log: MFC r230138: Small cleanup, no functional change. Modified: stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Sat Feb 11 01:09:46 2012 (r231498) +++ stable/8/sys/netinet6/sctp6_var.h Sat Feb 11 01:11:37 2012 (r231499) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -/* TODO __Userspace__ IPv6 stuff... */ #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 11 01:13:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E221065670; Sat, 11 Feb 2012 01:13: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 846918FC08; Sat, 11 Feb 2012 01: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 q1B1DZuM006381; Sat, 11 Feb 2012 01:13:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1DZlH006379; Sat, 11 Feb 2012 01:13:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110113.q1B1DZlH006379@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231500 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:13:35 -0000 Author: tuexen Date: Sat Feb 11 01:13:35 2012 New Revision: 231500 URL: http://svn.freebsd.org/changeset/base/231500 Log: MFC r230379: Fix a problem when using the CBAPI. While there, remove an old comment which does not apply anymore. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:11:37 2012 (r231499) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:13:35 2012 (r231500) @@ -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-8@FreeBSD.ORG Sat Feb 11 01:15:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E33A106566C; Sat, 11 Feb 2012 01:15:03 +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 EB1ED8FC15; Sat, 11 Feb 2012 01:15: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 q1B1F2Xq006480; Sat, 11 Feb 2012 01:15:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1F2GZ006478; Sat, 11 Feb 2012 01:15:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110115.q1B1F2GZ006478@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231501 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:15:03 -0000 Author: tuexen Date: Sat Feb 11 01:15:02 2012 New Revision: 231501 URL: http://svn.freebsd.org/changeset/base/231501 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/8/usr.bin/netstat/sctp.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/sctp.c ============================================================================== --- stable/8/usr.bin/netstat/sctp.c Sat Feb 11 01:13:35 2012 (r231500) +++ stable/8/usr.bin/netstat/sctp.c Sat Feb 11 01:15:02 2012 (r231501) @@ -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-8@FreeBSD.ORG Sat Feb 11 01:17:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9665D106566C; Sat, 11 Feb 2012 01:17: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 7B5F48FC08; Sat, 11 Feb 2012 01:17: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 q1B1HRLw006600; Sat, 11 Feb 2012 01:17:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1HRVH006598; Sat, 11 Feb 2012 01:17:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110117.q1B1HRVH006598@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231502 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:17:27 -0000 Author: tuexen Date: Sat Feb 11 01:17:27 2012 New Revision: 231502 URL: http://svn.freebsd.org/changeset/base/231502 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/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Sat Feb 11 01:15:02 2012 (r231501) +++ stable/8/sys/netinet/sctp_structs.h Sat Feb 11 01:17:27 2012 (r231502) @@ -414,7 +414,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-8@FreeBSD.ORG Sat Feb 11 08:58:12 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB4A106564A; Sat, 11 Feb 2012 08:58:12 +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 8F54F8FC0A; Sat, 11 Feb 2012 08:58:12 +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 q1B8wCia021919; Sat, 11 Feb 2012 08:58:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8wCUC021917; Sat, 11 Feb 2012 08:58:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110858.q1B8wCUC021917@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 08:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231513 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:58:12 -0000 Author: tuexen Date: Sat Feb 11 08:58:12 2012 New Revision: 231513 URL: http://svn.freebsd.org/changeset/base/231513 Log: MFC r218264: Fix typo (Tuneable -> Tunable). From brucec@. Modified: stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 08:34:33 2012 (r231512) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 08:58:12 2012 (r231513) @@ -193,13 +193,13 @@ struct sctp_sysctl { #define SCTPCTL_MAXCHUNKS_MAX 0xFFFFFFFF #define SCTPCTL_MAXCHUNKS_DEFAULT SCTP_ASOC_MAX_CHUNKS_ON_QUEUE -/* tcbhashsize: Tuneable for Hash table sizes */ +/* tcbhashsize: Tunable for Hash table sizes */ #define SCTPCTL_TCBHASHSIZE_DESC "Tunable for TCB hash table sizes" #define SCTPCTL_TCBHASHSIZE_MIN 1 #define SCTPCTL_TCBHASHSIZE_MAX 0xFFFFFFFF #define SCTPCTL_TCBHASHSIZE_DEFAULT SCTP_TCBHASHSIZE -/* pcbhashsize: Tuneable for PCB Hash table sizes */ +/* pcbhashsize: Tunable for PCB Hash table sizes */ #define SCTPCTL_PCBHASHSIZE_DESC "Tunable for PCB hash table sizes" #define SCTPCTL_PCBHASHSIZE_MIN 1 #define SCTPCTL_PCBHASHSIZE_MAX 0xFFFFFFFF @@ -211,8 +211,8 @@ struct sctp_sysctl { #define SCTPCTL_MIN_SPLIT_POINT_MAX 0xFFFFFFFF #define SCTPCTL_MIN_SPLIT_POINT_DEFAULT SCTP_DEFAULT_SPLIT_POINT_MIN -/* chunkscale: Tuneable for Scaling of number of chunks and messages */ -#define SCTPCTL_CHUNKSCALE_DESC "Tuneable for Scaling of number of chunks and messages" +/* chunkscale: Tunable for Scaling of number of chunks and messages */ +#define SCTPCTL_CHUNKSCALE_DESC "Tunable for Scaling of number of chunks and messages" #define SCTPCTL_CHUNKSCALE_MIN 1 #define SCTPCTL_CHUNKSCALE_MAX 0xFFFFFFFF #define SCTPCTL_CHUNKSCALE_DEFAULT SCTP_CHUNKQUEUE_SCALE From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 11 14:58:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C935106566B; Sat, 11 Feb 2012 14:58:47 +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 76FC18FC0C; Sat, 11 Feb 2012 14:58: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 q1BEwlfq035787; Sat, 11 Feb 2012 14:58:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEwlxG035785; Sat, 11 Feb 2012 14:58:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202111458.q1BEwlxG035785@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Feb 2012 14:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231523 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:58:47 -0000 Author: avg Date: Sat Feb 11 14:58:46 2012 New Revision: 231523 URL: http://svn.freebsd.org/changeset/base/231523 Log: MFC r230157: dadump: don't leak the periph lock on i/o error Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sat Feb 11 14:55:05 2012 (r231522) +++ stable/8/sys/cam/scsi/scsi_da.c Sat Feb 11 14:58:46 2012 (r231523) @@ -1097,6 +1097,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"); @@ -1108,7 +1109,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-8@FreeBSD.ORG Sat Feb 11 20:37:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04F12106566C; Sat, 11 Feb 2012 20:37:09 +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 E298D8FC13; Sat, 11 Feb 2012 20:37: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 q1BKb8mK046967; Sat, 11 Feb 2012 20:37:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKb8l8046965; Sat, 11 Feb 2012 20:37:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112037.q1BKb8l8046965@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231531 - stable/8/bin/sh X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:37:09 -0000 Author: jilles Date: Sat Feb 11 20:37:08 2012 New Revision: 231531 URL: http://svn.freebsd.org/changeset/base/231531 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/8/bin/sh/var.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/var.c ============================================================================== --- stable/8/bin/sh/var.c Sat Feb 11 20:28:42 2012 (r231530) +++ stable/8/bin/sh/var.c Sat Feb 11 20:37:08 2012 (r231531) @@ -547,7 +547,7 @@ showvarscmd(int argc __unused, char **ar } } - INTON; + INTOFF; vars = ckmalloc(n * sizeof(*vars)); i = 0; for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) { @@ -566,7 +566,7 @@ showvarscmd(int argc __unused, char **ar out1c('\n'); } ckfree(vars); - INTOFF; + INTON; return 0; } From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 11 23:15:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B4A6106566B; Sat, 11 Feb 2012 23:15:15 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF3158FC18; Sat, 11 Feb 2012 23:15:14 +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 q1BNFEu7054481; Sat, 11 Feb 2012 23:15:14 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BNFEkv054476; Sat, 11 Feb 2012 23:15:14 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201202112315.q1BNFEkv054476@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 11 Feb 2012 23:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231538 - stable/8/usr.bin/tftp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:15:15 -0000 Author: rodrigc Date: Sat Feb 11 23:15:14 2012 New Revision: 231538 URL: http://svn.freebsd.org/changeset/base/231538 Log: MFC 196045 through 231537 - this records svn:mergeinfo for previously merged changesets This pulls in changes such as: MFC 216370 - Remove adertising clause from UCB copyrighted files in usr.bin MFC 222534 - Fix a couple of spelling errors. MFC 223493 - Remove duplicated header files MFC 223135 - 223491 - man page updates MFC 229403 - Replace index() and rindex() calls with strchr() and strrchr(). MFC 230044 - fgets(3) returns a pointer, so compare against NULL, not integer 0. Modified: stable/8/usr.bin/tftp/main.c stable/8/usr.bin/tftp/tftp.1 stable/8/usr.bin/tftp/tftp.c stable/8/usr.bin/tftp/tftp.h Directory Properties: stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/usr.bin/tftp/main.c ============================================================================== --- stable/8/usr.bin/tftp/main.c Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/main.c Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -56,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -159,7 +154,7 @@ static struct cmd cmdtab[] = { { "options", setoptions, "enable or disable RFC2347 style options" }, { "help", help, "print help information" }, - { "packetdrop", setpacketdrop, "artifical packetloss feature" }, + { "packetdrop", setpacketdrop, "artificial packetloss feature" }, { "?", help, "print help information" }, { NULL, NULL, NULL } }; @@ -442,16 +437,16 @@ put(int argc, char *argv[]) return; } targ = argv[argc - 1]; - if (rindex(argv[argc - 1], ':')) { + if (strrchr(argv[argc - 1], ':')) { char *lcp; for (n = 1; n < argc - 1; n++) - if (index(argv[n], ':')) { + if (strchr(argv[n], ':')) { putusage(argv[0]); return; } lcp = argv[argc - 1]; - targ = rindex(lcp, ':'); + targ = strrchr(lcp, ':'); *targ++ = 0; if (lcp[0] == '[' && lcp[strlen(lcp) - 1] == ']') { lcp[strlen(lcp) - 1] = '\0'; @@ -482,7 +477,7 @@ put(int argc, char *argv[]) } /* this assumes the target is a directory */ /* on a remote unix system. hmmmm. */ - cp = index(targ, '\0'); + cp = strchr(targ, '\0'); *cp++ = '/'; for (n = 1; n < argc - 1; n++) { strcpy(cp, tail(argv[n])); @@ -537,7 +532,7 @@ get(int argc, char *argv[]) } if (!connected) { for (n = 1; n < argc ; n++) - if (rindex(argv[n], ':') == 0) { + if (strrchr(argv[n], ':') == 0) { printf("No remote host specified and " "no host given for file '%s'\n", argv[n]); getusage(argv[0]); @@ -545,7 +540,7 @@ get(int argc, char *argv[]) } } for (n = 1; n < argc ; n++) { - src = rindex(argv[n], ':'); + src = strrchr(argv[n], ':'); if (src == NULL) src = argv[n]; else { @@ -686,7 +681,7 @@ tail(char *filename) char *s; while (*filename) { - s = rindex(filename, '/'); + s = strrchr(filename, '/'); if (s == NULL) break; if (s[1]) @@ -739,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { @@ -844,8 +839,8 @@ help(int argc, char *argv[]) printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help); printf("\n[-] : You shouldn't use these ones anymore.\n"); - printf("[*] : RFC2834 options support required.\n"); - printf("[**] : Non-standard RFC2834 option.\n"); + printf("[*] : RFC2347 options support required.\n"); + printf("[**] : Non-standard RFC2347 option.\n"); return; } while (--argc > 0) { @@ -959,7 +954,7 @@ setblocksize(int argc, char *argv[]) if (!options_rfc_enabled) printf("RFC2347 style options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); @@ -997,7 +992,7 @@ setblocksize2(int argc, char *argv[]) if (!options_rfc_enabled || !options_extra_enabled) printf( "RFC2347 style or non-RFC defined options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); Modified: stable/8/usr.bin/tftp/tftp.1 ============================================================================== --- stable/8/usr.bin/tftp/tftp.1 Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.1 Sat Feb 11 23:15:14 2012 (r231538) @@ -9,10 +9,6 @@ .\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -32,7 +28,7 @@ .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2003 +.Dd June 22, 2011 .Dt TFTP 1 .Os .Sh NAME @@ -74,6 +70,21 @@ Shorthand for "mode ascii" .It Cm binary Shorthand for "mode binary" .Pp +.It Cm blocksize Ar [size] +Sets the TFTP blksize option in TFTP Read Request or Write Request packets +to +.Ar [size] +as specified in RFC 2348. Valid values are between 8 and 65464. +If no blocksize is specified, then by default a blocksize of 512 bytes +will be used. +.Pp +.It Cm blocksize2 Ar [size] +Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets +to +.Ar [size] . +Values are restricted to powers of 2 between 8 and 32768. This is a +non-standard TFTP option. +.Pp .It Cm connect Ar host Op Ar port Set the .Ar host @@ -97,6 +108,14 @@ or .Cm put commands. .Pp +.It Cm debug Ar level +Enable or disable debugging levels during verbose output. The value of +.Ar level +can be one of +.Cm packet, simple, options, +or +.Cm access. +.Pp .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname .It Cm get Xo .Oo Ar host1 : Oc Ns Ar file1 @@ -134,6 +153,11 @@ or The default is .Em ascii . .Pp +.It Cm packetdrop [arg] +Randomly drop +.Ar arg +out of 100 packets during a transfer. This is a debugging feature. +.Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory Put a file or set of files to the remote host. @@ -153,6 +177,17 @@ see the example under the .Cm get command. .Pp +.It Cm options Ar [arg] +Enable or disable support for TFTP options. The valid values of +.Ar arg +are +.Cm on +(enable RFC 2347 options), +.Cm off +(disable RFC 2347 options), and +.Cm extra +(toggle support for non-RFC defined options). +.Pp .It Cm quit Exit .Nm . @@ -161,6 +196,15 @@ An end of file also exits. .It Cm rexmt Ar retransmission-timeout Set the per-packet retransmission timeout, in seconds. .Pp +.It Cm rollover [arg] +Specify the rollover option in TFTP Read Request or Write +Request packets. After 65535 packets have been transmitted, set the block +counter to +.Ar arg . +Valid values of +.Ar arg +are 0 and 1. This is a non-standard TFTP option. +.Pp .It Cm status Show current status. .Pp @@ -173,12 +217,52 @@ Toggle packet tracing. .It Cm verbose Toggle verbose mode. .El +.Sh SEE ALSO +.Xr tftpd 8 +.Pp +The following RFC's are supported: +.Rs +RFC 1350 +.%T The TFTP Protocol (Revision 2) +.Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Rs +RFC 3617 +.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm command appeared in .Bx 4.3 . -.Sh BUGS +.Pp +Edwin Groothuis performed a major rewrite of the +.Xr tftpd 8 +and +.Nm +code to support RFC2348. +.Sh NOTES Because there is no user-login or validation within the .Tn TFTP @@ -189,4 +273,5 @@ exact methods are specific to each site difficult to document here. .Pp Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC1783). +without client and server supporting the TFTP blocksize option (RFC2348), +or the non-standard TFTP rollover option. Modified: stable/8/usr.bin/tftp/tftp.c ============================================================================== --- stable/8/usr.bin/tftp/tftp.c Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.c Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: stable/8/usr.bin/tftp/tftp.h ============================================================================== --- stable/8/usr.bin/tftp/tftp.h Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.h Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 11 23:39:53 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39FE106564A; Sat, 11 Feb 2012 23:39:53 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCE3C8FC13; Sat, 11 Feb 2012 23:39: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 q1BNdrbU055424; Sat, 11 Feb 2012 23:39:53 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BNdr6G055419; Sat, 11 Feb 2012 23:39:53 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201202112339.q1BNdr6G055419@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 11 Feb 2012 23:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231539 - stable/8/libexec/tftpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:39:53 -0000 Author: rodrigc Date: Sat Feb 11 23:39:53 2012 New Revision: 231539 URL: http://svn.freebsd.org/changeset/base/231539 Log: MFC 203377-231538. This records mergeinfo for already merged changesets, but brings in the following changes: MFC 222326 - Fix tftp_log() usage MFC 223137 - Man page updates MFC 223487 - Bring back syncnet() implementation from older tftp implementation. MFC 229780 - Spelling fixes for libexec/ MFC 229904 - Fix warning when compiling with gcc46: error: variable 'bp' set but not used Modified: stable/8/libexec/tftpd/tftp-file.c stable/8/libexec/tftpd/tftp-io.c stable/8/libexec/tftpd/tftp-utils.h stable/8/libexec/tftpd/tftpd.8 Directory Properties: stable/8/libexec/tftpd/ (props changed) Modified: stable/8/libexec/tftpd/tftp-file.c ============================================================================== --- stable/8/libexec/tftpd/tftp-file.c Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-file.c Sat Feb 11 23:39:53 2012 (r231539) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -249,9 +251,34 @@ read_close(void) } +/* When an error has occurred, it is possible that the two sides + * are out of synch. Ie: that what I think is the other side's + * response to packet N is really their response to packet N-1. + * + * So, to try to prevent that, we flush all the input queued up + * for us on the network connection on our host. + * + * We return the number of packets we flushed (mostly for reporting + * when trace is active). + */ + int -synchnet(int peer __unused) +synchnet(int peer) /* socket to flush */ { - - return 0; + int i, j = 0; + char rbuf[MAXPKTSIZE]; + struct sockaddr_storage from; + socklen_t fromlen; + + while (1) { + (void) ioctl(peer, FIONREAD, &i); + if (i) { + j++; + fromlen = sizeof from; + (void) recvfrom(peer, rbuf, sizeof (rbuf), 0, + (struct sockaddr *)&from, &fromlen); + } else { + return(j); + } + } } Modified: stable/8/libexec/tftpd/tftp-io.c ============================================================================== --- stable/8/libexec/tftpd/tftp-io.c Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-io.c Sat Feb 11 23:39:53 2012 (r231539) @@ -72,13 +72,13 @@ struct errmsg { #define DROPPACKET(s) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return; \ } #define DROPPACKETn(s,n) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return (n); \ } @@ -262,7 +262,7 @@ send_rrq(int peer, char *filename, char n = sendto(peer, buf, size, 0, (struct sockaddr *)&peer_sock, peer_sock.ss_len); if (n != size) { - tftp_log(LOG_ERR, "send_rrq: %s", n, strerror(errno)); + tftp_log(LOG_ERR, "send_rrq: %d %s", n, strerror(errno)); return (1); } return (0); @@ -323,7 +323,6 @@ send_ack(int fp, uint16_t block) { struct tftphdr *tp; int size; - char *bp; char buf[MAXPKTSIZE]; if (debug&DEBUG_PACKETS) @@ -332,7 +331,6 @@ send_ack(int fp, uint16_t block) DROPPACKETn("send_ack", 0); tp = (struct tftphdr *)buf; - bp = buf + 2; size = sizeof(buf) - 2; tp->th_opcode = htons((u_short)ACK); tp->th_block = htons((u_short)block); Modified: stable/8/libexec/tftpd/tftp-utils.h ============================================================================== --- stable/8/libexec/tftpd/tftp-utils.h Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-utils.h Sat Feb 11 23:39:53 2012 (r231539) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); #define MAXPKTSIZE (MAXSEGSIZE + 4) /* Maximum size of the packet */ /* For the blksize option */ -#define BLKSIZE_MIN 8 /* Minumum size of the data segment */ +#define BLKSIZE_MIN 8 /* Minimum size of the data segment */ #define BLKSIZE_MAX MAXSEGSIZE /* Maximum size of the data segment */ /* For the timeout option */ -#define TIMEOUT_MIN 0 /* Minumum timeout value */ +#define TIMEOUT_MIN 0 /* Minimum timeout value */ #define TIMEOUT_MAX 255 /* Maximum timeout value */ #define MIN_TIMEOUTS 3 Modified: stable/8/libexec/tftpd/tftpd.8 ============================================================================== --- stable/8/libexec/tftpd/tftpd.8 Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftpd.8 Sat Feb 11 23:39:53 2012 (r231539) @@ -32,7 +32,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 14, 2000 +.Dd June 22, 2011 .Dt TFTPD 8 .Os .Sh NAME @@ -150,9 +150,27 @@ compatible format string for the creatio .Fl W is specified. By default the string "%Y%m%d" is used. -.It Fl d +.It Fl d, d Ar [value] Enables debug output. -If specified twice, it will log DATA and ACK packets too. +If +.Ar value +is not specified, then the debug level is increased by one +for each instance of +.Fl d +which is specified. +.Pp +If +.Ar value +is specified, then the debug level is set to +.Ar value . +The debug level is a bitmask implemented in +.Pa src/libexec/tftpd/tftp-utils.h . +Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE), +4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS). Multiple debug values can be combined +in the bitmask by logically OR'ing the values. For example, specifying +.Fl d +.Ar 15 +will enable all the debug values. .It Fl l Log all requests using .Xr syslog 3 @@ -217,12 +235,34 @@ option. .Xr services 5 , .Xr syslog.conf 5 , .Xr inetd 8 +.Pp +The following RFC's are supported: .Rs -.%A K. R. Sollins +RFC 1350 .%T The TFTP Protocol (Revision 2) -.%D July 1992 -.%O RFC 1350, STD 33 .Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm @@ -253,8 +293,22 @@ was introduced in support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in .Fx 7.4 . -.Sh BUGS -Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC2348). .Pp -Many tftp clients will not transfer files over 16744448 octets (32767 blocks). +Edwin Groothuis performed a major rewrite of the +.Nm +and +.Xr tftp 1 +code to support RFC2348. +.Sh NOTES +Files larger than 33,553,919 octets (65535 blocks, last one <512 +octets) cannot be correctly transferred without client and server +supporting blocksize negotiation (RFCs 2347 and 2348), +or the non-standard TFTP rollover option. +As a kludge, +.Nm +accepts a sequence of block number which wrap to zero after 65535, +even if the rollover option is not specified. +.Pp +Many tftp clients will not transfer files over 16,776,703 octets +(32767 blocks), as they incorrectly count the block number using +a signed rather than unsigned 16-bit integer.