From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:49:58 2012 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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;