Mercurial > illumos > illumos-gate
changeset 13021:29fc56bd19a6
6912476 SCTP Observability issues with sctp_faddr_s & sctp_reass_s
6912478 SCTP_COMM_LOST notification is generated even if sctp association is not established
line wrap: on
line diff
--- a/usr/src/cmd/mdb/common/modules/genunix/vfs.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/cmd/mdb/common/modules/genunix/vfs.c Tue Aug 03 22:50:37 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <mdb/mdb_modapi.h> @@ -723,7 +722,7 @@ mdb_warn("failed to read sctp primary faddr"); return (-1); } - faddr = sctp_primary.faddr; + faddr = sctp_primary.sf_faddr; switch (connp->conn_family) { case AF_INET:
--- a/usr/src/cmd/mdb/common/modules/sctp/sctp.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/cmd/mdb/common/modules/sctp/sctp.c Tue Aug 03 22:50:37 2010 -0700 @@ -144,30 +144,31 @@ return (DCMD_ERR); } - statestr = sctp_faddr_state(fa->state); - mdb_printf("%<u>%p\t%<b>%N%</b>\t%s%</u>\n", addr, &fa->faddr, + statestr = sctp_faddr_state(fa->sf_state); + mdb_printf("%<u>%p\t%<b>%N%</b>\t%s%</u>\n", addr, &fa->sf_faddr, statestr); - mdb_printf("next\t\t%?p\tsaddr\t%N\n", fa->next, &fa->saddr); - mdb_printf("rto\t\t%?d\tsrtt\t\t%?d\n", fa->rto, fa->srtt); - mdb_printf("rttvar\t\t%?d\trtt_updates\t%?u\n", fa->rttvar, - fa->rtt_updates); - mdb_printf("strikes\t\t%?d\tmax_retr\t%?d\n", fa->strikes, - fa->max_retr); - mdb_printf("hb_expiry\t%?ld\thb_interval\t%?u\n", fa->hb_expiry, - fa->hb_interval); - mdb_printf("pmss\t\t%?u\tcwnd\t\t%?u\n", fa->sfa_pmss, fa->cwnd); - mdb_printf("ssthresh\t%?u\tsuna\t\t%?u\n", fa->ssthresh, fa->suna); - mdb_printf("pba\t\t%?u\tacked\t\t%?u\n", fa->pba, fa->acked); - mdb_printf("lastactive\t%?ld\thb_secret\t%?#lx\n", fa->lastactive, - fa->hb_secret); - mdb_printf("rxt_unacked\t%?u\n", fa->rxt_unacked); - mdb_printf("timer_mp\t%?p\tixa\t\t%?p\n", fa->timer_mp, fa->ixa); + mdb_printf("next\t\t%?p\tsaddr\t%N\n", fa->sf_next, &fa->sf_saddr); + mdb_printf("rto\t\t%?d\tsrtt\t\t%?d\n", fa->sf_rto, fa->sf_srtt); + mdb_printf("rttvar\t\t%?d\trtt_updates\t%?u\n", fa->sf_rttvar, + fa->sf_rtt_updates); + mdb_printf("strikes\t\t%?d\tmax_retr\t%?d\n", fa->sf_strikes, + fa->sf_max_retr); + mdb_printf("hb_expiry\t%?ld\thb_interval\t%?u\n", fa->sf_hb_expiry, + fa->sf_hb_interval); + mdb_printf("pmss\t\t%?u\tcwnd\t\t%?u\n", fa->sf_pmss, fa->sf_cwnd); + mdb_printf("ssthresh\t%?u\tsuna\t\t%?u\n", fa->sf_ssthresh, + fa->sf_suna); + mdb_printf("pba\t\t%?u\tacked\t\t%?u\n", fa->sf_pba, fa->sf_acked); + mdb_printf("lastactive\t%?ld\thb_secret\t%?#lx\n", fa->sf_lastactive, + fa->sf_hb_secret); + mdb_printf("rxt_unacked\t%?u\n", fa->sf_rxt_unacked); + mdb_printf("timer_mp\t%?p\tixa\t\t%?p\n", fa->sf_timer_mp, fa->sf_ixa); mdb_printf("hb_enabled\t%?d\thb_pending\t%?d\n" "timer_running\t%?d\tdf\t\t%?d\n" "pmtu_discovered\t%?d\tisv4\t\t%?d\n" "retransmissions\t%?u\n", - fa->hb_enabled, fa->hb_pending, fa->timer_running, fa->df, - fa->pmtu_discovered, fa->isv4, fa->T3expire); + fa->sf_hb_enabled, fa->sf_hb_pending, fa->sf_timer_running, + fa->sf_df, fa->sf_pmtu_discovered, fa->sf_isv4, fa->sf_T3expire); return (DCMD_OK); } @@ -453,8 +454,8 @@ "\t\tprev: %?p\tcont: %?p\n", addr, srpmp.b_next, srpmp.b_prev, srpmp.b_cont); mdb_printf("\t\tssn: %hu\tneeded: %hu\tgot: %hu\ttail: %?p\n" - "\t\tpartial_delivered: %s\n", srp.ssn, srp.needed, - srp.got, srp.tail, srp.partial_delivered ? "TRUE" : + "\t\tpartial_delivered: %s\n", srp.sr_ssn, srp.sr_needed, + srp.sr_got, srp.sr_tail, srp.sr_partial_delivered ? "TRUE" : "FALSE"); /* display the contents of this ssn's reassemby list */ @@ -671,9 +672,9 @@ sctp_faddr_t *faddr = (sctp_faddr_t *)addr; int *i = cbdata; - statestr = sctp_faddr_state(faddr->state); + statestr = sctp_faddr_state(faddr->sf_state); - mdb_printf("\t%d:\t%N\t%?p (%s)\n", (*i)++, &faddr->faddr, ptr, + mdb_printf("\t%d:\t%N\t%?p (%s)\n", (*i)++, &faddr->sf_faddr, ptr, statestr); return (WALK_NEXT); } @@ -732,7 +733,7 @@ /* non-verbose faddrs, suitable for pipelines to sctp_faddr */ if (paddr != 0) { sctp_faddr_t faddr, *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = faddr.next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = faddr.sf_next) { if (mdb_vread(&faddr, sizeof (faddr), (uintptr_t)fp) == -1) { mdb_warn("failed to read faddr at %p", @@ -754,7 +755,7 @@ sctp_faddr_t faddr; if (mdb_vread(&faddr, sizeof (faddr), (uintptr_t)sctp->sctp_faddrs) != -1) - mdb_printf("%<u> %N%</u>", &faddr.faddr); + mdb_printf("%<u> %N%</u>", &faddr.sf_faddr); } mdb_printf("\n"); @@ -1229,7 +1230,7 @@ status = wsp->walk_callback(faddr_ptr, &sctp_faddr, wsp->walk_cbdata); if (status != WALK_NEXT) return (status); - if ((faddr_ptr = (uintptr_t)sctp_faddr.next) == NULL) { + if ((faddr_ptr = (uintptr_t)sctp_faddr.sf_next) == NULL) { return (WALK_DONE); } else { wsp->walk_addr = faddr_ptr;
--- a/usr/src/uts/common/inet/ip/ip_attr.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/ip/ip_attr.c Tue Aug 03 22:50:37 2010 -0700 @@ -1253,8 +1253,8 @@ sctp = CONN2SCTP(connp); RUN_SCTP(sctp); ixa_cleanup_stale(connp->conn_ixa); - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) - ixa_cleanup_stale(fp->ixa); + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) + ixa_cleanup_stale(fp->sf_ixa); WAKE_SCTP(sctp); } else { ip_xmit_attr_t *ixa;
--- a/usr/src/uts/common/inet/sctp/sctp.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp.c Tue Aug 03 22:50:37 2010 -0700 @@ -965,7 +965,7 @@ { uint32_t pmtu; int32_t mss; - ip_xmit_attr_t *ixa = fp->ixa; + ip_xmit_attr_t *ixa = fp->sf_ixa; if (sctp->sctp_state < SCTPS_ESTABLISHED) return; @@ -990,20 +990,20 @@ /* * Nothing to change, so just return. */ - if (mss == fp->sfa_pmss) + if (mss == fp->sf_pmss) return; /* * Currently, for ICMP errors, only PMTU decrease is handled. */ - if (mss > fp->sfa_pmss && decrease_only) + if (mss > fp->sf_pmss && decrease_only) return; #ifdef DEBUG (void) printf("sctp_update_pmtu mss from %d to %d\n", - fp->sfa_pmss, mss); + fp->sf_pmss, mss); #endif - DTRACE_PROBE2(sctp_update_pmtu, int32_t, fp->sfa_pmss, uint32_t, mss); + DTRACE_PROBE2(sctp_update_pmtu, int32_t, fp->sf_pmss, uint32_t, mss); /* * Update ixa_fragsize and ixa_pmtu. @@ -1014,8 +1014,8 @@ * Make sure that sfa_pmss is a multiple of * SCTP_ALIGN. */ - fp->sfa_pmss = mss & ~(SCTP_ALIGN - 1); - fp->pmtu_discovered = 1; + fp->sf_pmss = mss & ~(SCTP_ALIGN - 1); + fp->sf_pmtu_discovered = 1; #ifdef notyet if (mss < sctp->sctp_sctps->sctps_mss_min) @@ -1031,7 +1031,7 @@ */ if (ixa->ixa_flags & IXAF_IS_IPV4) { if (!(ixa->ixa_flags & IXAF_PMTU_IPV4_DF)) { - fp->df = B_FALSE; + fp->sf_df = B_FALSE; if (fp == sctp->sctp_current) { sctp->sctp_ipha-> ipha_fragment_offset_and_flags = 0; @@ -1056,8 +1056,8 @@ switch (ntype) { case IXAN_PMTU: /* Find the faddr based on the ip_xmit_attr_t pointer */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (fp->ixa == ixa) + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (fp->sf_ixa == ixa) break; } if (fp != NULL)
--- a/usr/src/uts/common/inet/sctp/sctp_addr.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_addr.c Tue Aug 03 22:50:37 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/types.h> @@ -514,10 +513,10 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (!IN6_ARE_ADDR_EQUAL(&fp->saddr, saddr)) + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (!IN6_ARE_ADDR_EQUAL(&fp->sf_saddr, saddr)) continue; - V6_SET_ZERO(fp->saddr); + V6_SET_ZERO(fp->sf_saddr); } } @@ -1975,12 +1974,12 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (psize < sizeof (fp->faddr)) + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (psize < sizeof (fp->sf_faddr)) return; - bcopy(&fp->faddr, p, sizeof (fp->faddr)); - p += sizeof (fp->faddr); - psize -= sizeof (fp->faddr); + bcopy(&fp->sf_faddr, p, sizeof (fp->sf_faddr)); + p += sizeof (fp->sf_faddr); + psize -= sizeof (fp->sf_faddr); } }
--- a/usr/src/uts/common/inet/sctp/sctp_asconf.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_asconf.c Tue Aug 03 22:50:37 2010 -0700 @@ -277,7 +277,7 @@ ASSERT(asc != NULL && asc->head != NULL); - isv4 = (fp != NULL) ? fp->isv4 : sctp->sctp_current->isv4; + isv4 = (fp != NULL) ? fp->sf_isv4 : sctp->sctp_current->sf_isv4; /* SCTP chunk header + Serial Number + Address Param TLV */ msgsize = sizeof (*ch) + sizeof (uint32_t) + @@ -582,13 +582,13 @@ } BUMP_LOCAL(sctp->sctp_obchunks); - if (fp->isv4) + if (fp->sf_isv4) ach->sch_len = htons(msgdsize(hmp) - sctp->sctp_hdr_len); else ach->sch_len = htons(msgdsize(hmp) - sctp->sctp_hdr6_len); - sctp_set_iplen(sctp, hmp, fp->ixa); - (void) conn_ip_output(hmp, fp->ixa); + sctp_set_iplen(sctp, hmp, fp->sf_ixa); + (void) conn_ip_output(hmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); sctp_validate_peer(sctp); } @@ -796,8 +796,8 @@ mp->b_cont = NULL; fp = SCTP_CHUNK_DEST(mp); - ASSERT(fp != NULL && fp->suna >= MBLKL(mp)); - fp->suna -= MBLKL(mp); + ASSERT(fp != NULL && fp->sf_suna >= MBLKL(mp)); + fp->sf_suna -= MBLKL(mp); /* * Update clustering's state for this assoc. Note acount/dcount @@ -849,7 +849,7 @@ ASSERT(fp != NULL); - fp->rc_timer_running = 0; + fp->sf_rc_timer_running = 0; if (sctp->sctp_state != SCTPS_ESTABLISHED || sctp->sctp_cxmit_list == NULL) { @@ -875,12 +875,12 @@ sctp_clean_death(sctp, ETIMEDOUT); return; } - if (fp->strikes >= fp->max_retr) { + if (fp->sf_strikes >= fp->sf_max_retr) { if (sctp_faddr_dead(sctp, fp, SCTP_FADDRS_DOWN) == -1) return; } - fp->strikes++; + fp->sf_strikes++; sctp->sctp_strikes++; SCTP_CALC_RXT(sctp, fp, sctp->sctp_rto_max); @@ -889,17 +889,17 @@ ofp = SCTP_CHUNK_DEST(sctp->sctp_cxmit_list); SCTP_SET_CHUNK_DEST(sctp->sctp_cxmit_list, NULL); ASSERT(ofp != NULL && ofp == fp); - ASSERT(ofp->suna >= MBLKL(sctp->sctp_cxmit_list)); + ASSERT(ofp->sf_suna >= MBLKL(sctp->sctp_cxmit_list)); /* * Enter slow start for this destination. * XXX anything in the data path that needs to be considered? */ - ofp->ssthresh = ofp->cwnd / 2; - if (ofp->ssthresh < 2 * ofp->sfa_pmss) - ofp->ssthresh = 2 * ofp->sfa_pmss; - ofp->cwnd = ofp->sfa_pmss; - ofp->pba = 0; - ofp->suna -= MBLKL(sctp->sctp_cxmit_list); + ofp->sf_ssthresh = ofp->sf_cwnd / 2; + if (ofp->sf_ssthresh < 2 * ofp->sf_pmss) + ofp->sf_ssthresh = 2 * ofp->sf_pmss; + ofp->sf_cwnd = ofp->sf_pmss; + ofp->sf_pba = 0; + ofp->sf_suna -= MBLKL(sctp->sctp_cxmit_list); /* * The rexmit flags is used to determine if a serial number needs to * be assigned or not, so once set we leave it there. @@ -939,13 +939,13 @@ /* OK to send */ ipmp = sctp_make_mp(sctp, fp, 0); if (ipmp == NULL) { - SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->sf_rto); SCTP_KSTAT(sctps, sctp_send_asconf_failed); return; } mp = sctp->sctp_cxmit_list; /* Fill in the mandatory Address Parameter TLV */ - isv4 = (fp != NULL) ? fp->isv4 : sctp->sctp_current->isv4; + isv4 = (fp != NULL) ? fp->sf_isv4 : sctp->sctp_current->sf_isv4; ph = (sctp_parm_hdr_t *)(mp->b_rptr + sizeof (sctp_chunk_hdr_t) + sizeof (uint32_t)); if (isv4) { @@ -964,7 +964,8 @@ * Maybe we might have better luck next time. */ if (!saddr_set) { - SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, + fp->sf_rto); freeb(ipmp); return; } @@ -986,7 +987,8 @@ * Maybe we might have better luck next time. */ if (!saddr_set) { - SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, + fp->sf_rto); freeb(ipmp); return; } @@ -995,9 +997,9 @@ } /* Don't exceed CWND */ - if ((MBLKL(mp) > (fp->cwnd - fp->suna)) || + if ((MBLKL(mp) > (fp->sf_cwnd - fp->sf_suna)) || ((mp = dupb(sctp->sctp_cxmit_list)) == NULL)) { - SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->sf_rto); freeb(ipmp); return; } @@ -1008,17 +1010,17 @@ *snp = htonl(sctp->sctp_lcsn++); } SCTP_CHUNK_CLEAR_FLAGS(mp); - fp->suna += MBLKL(mp); + fp->sf_suna += MBLKL(mp); /* Attach the header and send the chunk */ ipmp->b_cont = mp; sctp->sctp_cchunk_pend = 1; SCTP_SET_SENT_FLAG(sctp->sctp_cxmit_list); SCTP_SET_CHUNK_DEST(sctp->sctp_cxmit_list, fp); - sctp_set_iplen(sctp, ipmp, fp->ixa); - (void) conn_ip_output(ipmp, fp->ixa); + sctp_set_iplen(sctp, ipmp, fp->sf_ixa); + (void) conn_ip_output(ipmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); - SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, fp->sf_rto); #undef SCTP_SET_SENT_FLAG } @@ -1215,7 +1217,7 @@ err = SCTP_ERR_BAD_MANDPARM; goto error_handler; } - if (sctp->sctp_faddrs == nfp && nfp->next == NULL) { + if (sctp->sctp_faddrs == nfp && nfp->sf_next == NULL) { /* Peer is trying to delete last address */ dprint(1, ("delip: del last addr: %x:%x:%x:%x\n", SCTP_PRINTADDR(addr))); @@ -1248,7 +1250,8 @@ sctp->sctp_shutdown_faddr = nfp; } if (sctp->sctp_lastfaddr == nfp) { - for (fp = sctp->sctp_faddrs; fp->next; fp = fp->next) + for (fp = sctp->sctp_faddrs; fp->sf_next; + fp = fp->sf_next) ; sctp->sctp_lastfaddr = fp; } @@ -1392,7 +1395,7 @@ sctp_intf_event(sctp, addr, SCTP_ADDR_MADE_PRIM, 0); sctp->sctp_primary = nfp; - if (nfp->state != SCTP_FADDRS_ALIVE || nfp == sctp->sctp_current) { + if (nfp->sf_state != SCTP_FADDRS_ALIVE || nfp == sctp->sctp_current) { return (NULL); } sctp_set_faddr_current(sctp, nfp);
--- a/usr/src/uts/common/inet/sctp/sctp_asconf.h Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_asconf.h Tue Aug 03 22:50:37 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _INET_SCTP_SCTP_ASCONF_H @@ -31,23 +30,23 @@ #endif #define SCTP_FADDR_RC_TIMER_RESTART(sctp, fp, intvl) \ - if ((fp)->rc_timer_mp == NULL) { \ - (fp)->rc_timer_mp = sctp_timer_alloc((sctp), \ + if ((fp)->sf_rc_timer_mp == NULL) { \ + (fp)->sf_rc_timer_mp = sctp_timer_alloc((sctp), \ sctp_rc_timer, KM_NOSLEEP); \ } \ - if ((fp)->rc_timer_mp != NULL) { \ - ((sctpt_t *)((fp)->rc_timer_mp->b_rptr))->sctpt_faddr = fp; \ + if ((fp)->sf_rc_timer_mp != NULL) { \ + ((sctpt_t *)((fp)->sf_rc_timer_mp->b_rptr))->sctpt_faddr = fp;\ dprint(3, ("faddr_rc_timer_restart: fp=%p %x:%x:%x:%x %d\n", \ - (void *)(fp), SCTP_PRINTADDR((fp)->faddr), \ + (void *)(fp), SCTP_PRINTADDR((fp)->sf_faddr), \ (int)(intvl))); \ - sctp_timer((sctp), (fp)->rc_timer_mp, (intvl)); \ - (fp)->rc_timer_running = 1; \ + sctp_timer((sctp), (fp)->sf_rc_timer_mp, (intvl)); \ + (fp)->sf_rc_timer_running = 1; \ } #define SCTP_FADDR_RC_TIMER_STOP(fp) \ - if ((fp)->rc_timer_running && (fp)->rc_timer_mp != NULL) { \ - sctp_timer_stop((fp)->rc_timer_mp); \ - (fp)->rc_timer_running = 0; \ + if ((fp)->sf_rc_timer_running && (fp)->sf_rc_timer_mp != NULL) { \ + sctp_timer_stop((fp)->sf_rc_timer_mp); \ + (fp)->sf_rc_timer_running = 0; \ } extern int sctp_add_ip(sctp_t *, const void *, uint32_t);
--- a/usr/src/uts/common/inet/sctp/sctp_common.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_common.c Tue Aug 03 22:50:37 2010 -0700 @@ -62,10 +62,10 @@ void sctp_set_saddr(sctp_t *sctp, sctp_faddr_t *fp) { - boolean_t v6 = !fp->isv4; + boolean_t v6 = !fp->sf_isv4; boolean_t addr_set; - fp->saddr = sctp_get_valid_addr(sctp, v6, &addr_set); + fp->sf_saddr = sctp_get_valid_addr(sctp, v6, &addr_set); /* * If there is no source address avaialble, mark this peer address * as unreachable for now. When the heartbeat timer fires, it will @@ -73,7 +73,7 @@ * available. */ if (!addr_set) - fp->state = SCTP_FADDRS_UNREACH; + fp->sf_state = SCTP_FADDRS_UNREACH; } /* @@ -101,33 +101,33 @@ * Tell sctp_make_mp it needs to call us again should we not * complete and set the saddr. */ - fp->saddr = ipv6_all_zeros; + fp->sf_saddr = ipv6_all_zeros; /* * If this addr is not reachable, mark it as unconfirmed for now, the * state will be changed back to unreachable later in this function * if it is still the case. */ - if (fp->state == SCTP_FADDRS_UNREACH) { - fp->state = SCTP_FADDRS_UNCONFIRMED; + if (fp->sf_state == SCTP_FADDRS_UNREACH) { + fp->sf_state = SCTP_FADDRS_UNCONFIRMED; } /* * Socket is connected - enable PMTU discovery. */ if (!sctps->sctps_ignore_path_mtu) - fp->ixa->ixa_flags |= IXAF_PMTU_DISCOVERY; + fp->sf_ixa->ixa_flags |= IXAF_PMTU_DISCOVERY; - ip_attr_nexthop(&connp->conn_xmit_ipp, fp->ixa, &fp->faddr, + ip_attr_nexthop(&connp->conn_xmit_ipp, fp->sf_ixa, &fp->sf_faddr, &nexthop); - laddr = fp->saddr; - error = ip_attr_connect(connp, fp->ixa, &laddr, &fp->faddr, &nexthop, - connp->conn_fport, &laddr, &uinfo, flags); + laddr = fp->sf_saddr; + error = ip_attr_connect(connp, fp->sf_ixa, &laddr, &fp->sf_faddr, + &nexthop, connp->conn_fport, &laddr, &uinfo, flags); if (error != 0) { dprint(3, ("sctp_get_dest: no ire for %x:%x:%x:%x\n", - SCTP_PRINTADDR(fp->faddr))); + SCTP_PRINTADDR(fp->sf_faddr))); /* * It is tempting to just leave the src addr * unspecified and let IP figure it out, but we @@ -146,12 +146,12 @@ * it won't be used to send data. */ sctp_set_saddr(sctp, fp); - if (fp->state == SCTP_FADDRS_UNREACH) + if (fp->sf_state == SCTP_FADDRS_UNREACH) return; goto check_current; } - ASSERT(fp->ixa->ixa_ire != NULL); - ASSERT(!(fp->ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))); + ASSERT(fp->sf_ixa->ixa_ire != NULL); + ASSERT(!(fp->sf_ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))); if (!sctp->sctp_loopback) sctp->sctp_loopback = uinfo.iulp_loopback; @@ -162,7 +162,7 @@ if (sp->saddr_ipif_unconfirmed == 1) sp->saddr_ipif_unconfirmed = 0; /* We did IPsec policy lookup for laddr already */ - fp->saddr = laddr; + fp->sf_saddr = laddr; } else { dprint(2, ("sctp_get_dest: src addr is not part of assoc " "%x:%x:%x:%x\n", SCTP_PRINTADDR(laddr))); @@ -175,7 +175,7 @@ * not the preferred source address to send to the peer. */ sctp_set_saddr(sctp, fp); - if (fp->state == SCTP_FADDRS_UNREACH) { + if (fp->sf_state == SCTP_FADDRS_UNREACH) { return; } } @@ -184,18 +184,18 @@ * Pull out RTO information for this faddr and use it if we don't * have any yet. */ - if (fp->srtt == -1 && uinfo.iulp_rtt != 0) { + if (fp->sf_srtt == -1 && uinfo.iulp_rtt != 0) { /* The cached value is in ms. */ - fp->srtt = MSEC_TO_TICK(uinfo.iulp_rtt); - fp->rttvar = MSEC_TO_TICK(uinfo.iulp_rtt_sd); - fp->rto = 3 * fp->srtt; + fp->sf_srtt = MSEC_TO_TICK(uinfo.iulp_rtt); + fp->sf_rttvar = MSEC_TO_TICK(uinfo.iulp_rtt_sd); + fp->sf_rto = 3 * fp->sf_srtt; /* Bound the RTO by configured min and max values */ - if (fp->rto < sctp->sctp_rto_min) { - fp->rto = sctp->sctp_rto_min; + if (fp->sf_rto < sctp->sctp_rto_min) { + fp->sf_rto = sctp->sctp_rto_min; } - if (fp->rto > sctp->sctp_rto_max) { - fp->rto = sctp->sctp_rto_max; + if (fp->sf_rto > sctp->sctp_rto_max) { + fp->sf_rto = sctp->sctp_rto_max; } SCTP_MAX_RTO(sctp, fp); } @@ -205,16 +205,16 @@ * Record the MTU for this faddr. If the MTU for this faddr has * changed, check if the assc MTU will also change. */ - if (fp->isv4) { + if (fp->sf_isv4) { hdrlen = sctp->sctp_hdr_len; } else { hdrlen = sctp->sctp_hdr6_len; } - if ((fp->sfa_pmss + hdrlen) != pmtu) { - /* Make sure that sfa_pmss is a multiple of SCTP_ALIGN. */ - fp->sfa_pmss = (pmtu - hdrlen) & ~(SCTP_ALIGN - 1); - if (fp->cwnd < (fp->sfa_pmss * 2)) { - SET_CWND(fp, fp->sfa_pmss, + if ((fp->sf_pmss + hdrlen) != pmtu) { + /* Make sure that sf_pmss is a multiple of SCTP_ALIGN. */ + fp->sf_pmss = (pmtu - hdrlen) & ~(SCTP_ALIGN - 1); + if (fp->sf_cwnd < (fp->sf_pmss * 2)) { + SET_CWND(fp, fp->sf_pmss, sctps->sctps_slow_start_initial); } } @@ -233,47 +233,47 @@ ip_stack_t *ipst = sctps->sctps_netstack->netstack_ip; uint_t ifindex; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { bzero(&uinfo, sizeof (uinfo)); /* * Only record the PMTU for this faddr if we actually have * done discovery. This prevents initialized default from * clobbering any real info that IP may have. */ - if (fp->pmtu_discovered) { - if (fp->isv4) { - uinfo.iulp_mtu = fp->sfa_pmss + + if (fp->sf_pmtu_discovered) { + if (fp->sf_isv4) { + uinfo.iulp_mtu = fp->sf_pmss + sctp->sctp_hdr_len; } else { - uinfo.iulp_mtu = fp->sfa_pmss + + uinfo.iulp_mtu = fp->sf_pmss + sctp->sctp_hdr6_len; } } if (sctps->sctps_rtt_updates != 0 && - fp->rtt_updates >= sctps->sctps_rtt_updates) { + fp->sf_rtt_updates >= sctps->sctps_rtt_updates) { /* * dce_update_uinfo() merges these values with the * old values. */ - uinfo.iulp_rtt = TICK_TO_MSEC(fp->srtt); - uinfo.iulp_rtt_sd = TICK_TO_MSEC(fp->rttvar); - fp->rtt_updates = 0; + uinfo.iulp_rtt = TICK_TO_MSEC(fp->sf_srtt); + uinfo.iulp_rtt_sd = TICK_TO_MSEC(fp->sf_rttvar); + fp->sf_rtt_updates = 0; } ifindex = 0; - if (IN6_IS_ADDR_LINKSCOPE(&fp->faddr)) { + if (IN6_IS_ADDR_LINKSCOPE(&fp->sf_faddr)) { /* * If we are going to create a DCE we'd better have * an ifindex */ - if (fp->ixa->ixa_nce != NULL) { - ifindex = fp->ixa->ixa_nce->nce_common-> + if (fp->sf_ixa->ixa_nce != NULL) { + ifindex = fp->sf_ixa->ixa_nce->nce_common-> ncec_ill->ill_phyint->phyint_ifindex; } else { continue; } } - (void) dce_update_uinfo(&fp->faddr, ifindex, &uinfo, ipst); + (void) dce_update_uinfo(&fp->sf_faddr, ifindex, &uinfo, ipst); } } @@ -290,10 +290,10 @@ boolean_t src_changed = B_FALSE; ASSERT(fp != NULL); - isv4 = fp->isv4; + isv4 = fp->sf_isv4; - if (SCTP_IS_ADDR_UNSPEC(isv4, fp->saddr) || - (fp->ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))) { + if (SCTP_IS_ADDR_UNSPEC(isv4, fp->sf_saddr) || + (fp->sf_ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))) { /* Need to pick a source */ sctp_get_dest(sctp, fp); /* @@ -305,11 +305,11 @@ } /* There is no suitable source address to use, return. */ - if (fp->state == SCTP_FADDRS_UNREACH) + if (fp->sf_state == SCTP_FADDRS_UNREACH) return (NULL); - ASSERT(fp->ixa->ixa_ire != NULL); - ASSERT(!SCTP_IS_ADDR_UNSPEC(isv4, fp->saddr)); + ASSERT(fp->sf_ixa->ixa_ire != NULL); + ASSERT(!SCTP_IS_ADDR_UNSPEC(isv4, fp->sf_saddr)); if (isv4) { ipsctplen = sctp->sctp_hdr_len; @@ -333,11 +333,11 @@ bcopy(sctp->sctp_iphc, mp->b_rptr, ipsctplen); if (fp != sctp->sctp_current || src_changed) { /* Fix the source and destination addresses. */ - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, iph->ipha_dst); - IN6_V4MAPPED_TO_IPADDR(&fp->saddr, iph->ipha_src); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, iph->ipha_dst); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_saddr, iph->ipha_src); } /* set or clear the don't fragment bit */ - if (fp->df) { + if (fp->sf_df) { iph->ipha_fragment_offset_and_flags = htons(IPH_DF); } else { iph->ipha_fragment_offset_and_flags = 0; @@ -346,8 +346,8 @@ bcopy(sctp->sctp_iphc6, mp->b_rptr, ipsctplen); if (fp != sctp->sctp_current || src_changed) { /* Fix the source and destination addresses. */ - ((ip6_t *)(mp->b_rptr))->ip6_dst = fp->faddr; - ((ip6_t *)(mp->b_rptr))->ip6_src = fp->saddr; + ((ip6_t *)(mp->b_rptr))->ip6_dst = fp->sf_faddr; + ((ip6_t *)(mp->b_rptr))->ip6_src = fp->sf_saddr; } } ASSERT(sctp->sctp_connp != NULL); @@ -365,7 +365,7 @@ sctp_stack_t *sctps = sctp->sctp_sctps; - if (sctp->sctp_current->isv4) { + if (sctp->sctp_current->sf_isv4) { hdrlen = sctp->sctp_hdr_len; } else { hdrlen = sctp->sctp_hdr6_len; @@ -375,7 +375,7 @@ sctp->sctp_connp->conn_wroff = sctps->sctps_wroff_xtra + hdrlen + sizeof (sctp_data_hdr_t); - ASSERT(sctp->sctp_current->sfa_pmss == sctp->sctp_mss); + ASSERT(sctp->sctp_current->sf_pmss == sctp->sctp_mss); bzero(&sopp, sizeof (sopp)); sopp.sopp_flags = SOCKOPT_MAXBLK|SOCKOPT_WROFF; sopp.sopp_wroff = sctp->sctp_connp->conn_wroff; @@ -420,10 +420,11 @@ int onematch; sctp_faddr_t *fp1, *fp2; - for (fp1 = a1; fp1; fp1 = fp1->next) { + for (fp1 = a1; fp1; fp1 = fp1->sf_next) { onematch = 0; - for (fp2 = a2; fp2; fp2 = fp2->next) { - if (IN6_ARE_ADDR_EQUAL(&fp1->faddr, &fp2->faddr)) { + for (fp2 = a2; fp2; fp2 = fp2->sf_next) { + if (IN6_ARE_ADDR_EQUAL(&fp1->sf_faddr, + &fp2->sf_faddr)) { overlap++; onematch = 1; break; @@ -518,19 +519,19 @@ ((sctpt_t *)(timer_mp->b_rptr))->sctpt_faddr = faddr; /* Start with any options set on the conn */ - faddr->ixa = conn_get_ixa_exclusive(connp); - if (faddr->ixa == NULL) { + faddr->sf_ixa = conn_get_ixa_exclusive(connp); + if (faddr->sf_ixa == NULL) { freemsg(timer_mp); kmem_cache_free(sctp_kmem_faddr_cache, faddr); return (ENOMEM); } - faddr->ixa->ixa_notify_cookie = connp->conn_sctp; + faddr->sf_ixa->ixa_notify_cookie = connp->conn_sctp; sctp_init_faddr(sctp, faddr, addr, timer_mp); - ASSERT(faddr->ixa->ixa_cred != NULL); + ASSERT(faddr->sf_ixa->ixa_cred != NULL); /* ip_attr_connect didn't allow broadcats/multicast dest */ - ASSERT(faddr->next == NULL); + ASSERT(faddr->sf_next == NULL); if (sctp->sctp_faddrs == NULL) { ASSERT(sctp->sctp_lastfaddr == NULL); @@ -538,10 +539,10 @@ sctp->sctp_faddrs = sctp->sctp_lastfaddr = faddr; } else if (first) { ASSERT(sctp->sctp_lastfaddr != NULL); - faddr->next = sctp->sctp_faddrs; + faddr->sf_next = sctp->sctp_faddrs; sctp->sctp_faddrs = faddr; } else { - sctp->sctp_lastfaddr->next = faddr; + sctp->sctp_lastfaddr->sf_next = faddr; sctp->sctp_lastfaddr = faddr; } sctp->sctp_nfaddrs++; @@ -554,8 +555,8 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (IN6_ARE_ADDR_EQUAL(&fp->faddr, addr)) + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (IN6_ARE_ADDR_EQUAL(&fp->sf_faddr, addr)) break; } @@ -565,8 +566,8 @@ sctp_faddr_t * sctp_lookup_faddr_nosctp(sctp_faddr_t *fp, in6_addr_t *addr) { - for (; fp; fp = fp->next) { - if (IN6_ARE_ADDR_EQUAL(&fp->faddr, addr)) { + for (; fp; fp = fp->sf_next) { + if (IN6_ARE_ADDR_EQUAL(&fp->sf_faddr, addr)) { break; } } @@ -581,24 +582,25 @@ sctp_set_faddr_current(sctp_t *sctp, sctp_faddr_t *fp) { /* Now setup the composite header. */ - if (fp->isv4) { - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, + if (fp->sf_isv4) { + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, sctp->sctp_ipha->ipha_dst); - IN6_V4MAPPED_TO_IPADDR(&fp->saddr, sctp->sctp_ipha->ipha_src); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_saddr, + sctp->sctp_ipha->ipha_src); /* update don't fragment bit */ - if (fp->df) { + if (fp->sf_df) { sctp->sctp_ipha->ipha_fragment_offset_and_flags = htons(IPH_DF); } else { sctp->sctp_ipha->ipha_fragment_offset_and_flags = 0; } } else { - sctp->sctp_ip6h->ip6_dst = fp->faddr; - sctp->sctp_ip6h->ip6_src = fp->saddr; + sctp->sctp_ip6h->ip6_dst = fp->sf_faddr; + sctp->sctp_ip6h->ip6_src = fp->sf_saddr; } sctp->sctp_current = fp; - sctp->sctp_mss = fp->sfa_pmss; + sctp->sctp_mss = fp->sf_pmss; /* Update the uppper layer for the change. */ if (!SCTP_IS_DETACHED(sctp)) @@ -610,7 +612,7 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { sctp_get_dest(sctp, fp); } } @@ -630,13 +632,13 @@ if (!sctp->sctp_zero_win_probe || !sctp->sctp_sctps->sctps_reclaim) { sctp->sctp_strikes = 0; } - fp->strikes = 0; - fp->lastactive = now; - fp->hb_expiry = now + SET_HB_INTVL(fp); - fp->hb_pending = B_FALSE; - if (fp->state != SCTP_FADDRS_ALIVE) { - fp->state = SCTP_FADDRS_ALIVE; - sctp_intf_event(sctp, fp->faddr, SCTP_ADDR_AVAILABLE, 0); + fp->sf_strikes = 0; + fp->sf_lastactive = now; + fp->sf_hb_expiry = now + SET_HB_INTVL(fp); + fp->sf_hb_pending = B_FALSE; + if (fp->sf_state != SCTP_FADDRS_ALIVE) { + fp->sf_state = SCTP_FADDRS_ALIVE; + sctp_intf_event(sctp, fp->sf_faddr, SCTP_ADDR_AVAILABLE, 0); /* Should have a full IRE now */ sctp_get_dest(sctp, fp); @@ -648,7 +650,7 @@ * then we'd be unreachable at this point in time. */ if (fp == sctp->sctp_primary && - fp->state != SCTP_FADDRS_UNREACH) { + fp->sf_state != SCTP_FADDRS_UNREACH) { sctp_set_faddr_current(sctp, fp); return; } @@ -664,8 +666,8 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp; fp = fp->next) { - if (fp->state == SCTP_FADDRS_ALIVE && fp->strikes == 0) { + for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) { + if (fp->sf_state == SCTP_FADDRS_ALIVE && fp->sf_strikes == 0) { return (B_TRUE); } } @@ -686,13 +688,13 @@ sctp_faddr_t *ofp; sctp_stack_t *sctps = sctp->sctp_sctps; - if (fp->state == SCTP_FADDRS_ALIVE) { - sctp_intf_event(sctp, fp->faddr, SCTP_ADDR_UNREACHABLE, 0); + if (fp->sf_state == SCTP_FADDRS_ALIVE) { + sctp_intf_event(sctp, fp->sf_faddr, SCTP_ADDR_UNREACHABLE, 0); } - fp->state = newstate; + fp->sf_state = newstate; dprint(1, ("sctp_faddr_dead: %x:%x:%x:%x down (state=%d)\n", - SCTP_PRINTADDR(fp->faddr), newstate)); + SCTP_PRINTADDR(fp->sf_faddr), newstate)); if (fp == sctp->sctp_current) { /* Current faddr down; need to switch it */ @@ -701,16 +703,16 @@ /* Find next alive faddr */ ofp = fp; - for (fp = fp->next; fp != NULL; fp = fp->next) { - if (fp->state == SCTP_FADDRS_ALIVE) { + for (fp = fp->sf_next; fp != NULL; fp = fp->sf_next) { + if (fp->sf_state == SCTP_FADDRS_ALIVE) { break; } } if (fp == NULL) { /* Continue from beginning of list */ - for (fp = sctp->sctp_faddrs; fp != ofp; fp = fp->next) { - if (fp->state == SCTP_FADDRS_ALIVE) { + for (fp = sctp->sctp_faddrs; fp != ofp; fp = fp->sf_next) { + if (fp->sf_state == SCTP_FADDRS_ALIVE) { break; } } @@ -723,7 +725,7 @@ if (fp != ofp) { if (sctp->sctp_current == NULL) { dprint(1, ("sctp_faddr_dead: failover->%x:%x:%x:%x\n", - SCTP_PRINTADDR(fp->faddr))); + SCTP_PRINTADDR(fp->sf_faddr))); /* * Note that we don't need to reset the source addr * of the new fp. @@ -763,23 +765,23 @@ * Find the next live peer address with zero strikes. In case * there is none, find the one with the lowest number of strikes. */ - min_strikes = ofp->strikes; - nfp = ofp->next; + min_strikes = ofp->sf_strikes; + nfp = ofp->sf_next; while (nfp != ofp) { /* If reached end of list, continue scan from the head */ if (nfp == NULL) { nfp = sctp->sctp_faddrs; continue; } - if (nfp->state == SCTP_FADDRS_ALIVE) { - if (nfp->strikes == 0) + if (nfp->sf_state == SCTP_FADDRS_ALIVE) { + if (nfp->sf_strikes == 0) break; - if (nfp->strikes < min_strikes) { - min_strikes = nfp->strikes; + if (nfp->sf_strikes < min_strikes) { + min_strikes = nfp->sf_strikes; saved_fp = nfp; } } - nfp = nfp->next; + nfp = nfp->sf_next; } /* If reached the old address, there is no zero strike path */ if (nfp == ofp) @@ -806,35 +808,35 @@ return; } - if (fp->timer_mp != NULL) { - sctp_timer_free(fp->timer_mp); - fp->timer_mp = NULL; - fp->timer_running = 0; + if (fp->sf_timer_mp != NULL) { + sctp_timer_free(fp->sf_timer_mp); + fp->sf_timer_mp = NULL; + fp->sf_timer_running = 0; } - if (fp->rc_timer_mp != NULL) { - sctp_timer_free(fp->rc_timer_mp); - fp->rc_timer_mp = NULL; - fp->rc_timer_running = 0; + if (fp->sf_rc_timer_mp != NULL) { + sctp_timer_free(fp->sf_rc_timer_mp); + fp->sf_rc_timer_mp = NULL; + fp->sf_rc_timer_running = 0; } - if (fp->ixa != NULL) { - ixa_refrele(fp->ixa); - fp->ixa = NULL; + if (fp->sf_ixa != NULL) { + ixa_refrele(fp->sf_ixa); + fp->sf_ixa = NULL; } if (fp == sctp->sctp_faddrs) { goto gotit; } - for (fpp = sctp->sctp_faddrs; fpp->next != fp; fpp = fpp->next) + for (fpp = sctp->sctp_faddrs; fpp->sf_next != fp; fpp = fpp->sf_next) ; gotit: ASSERT(sctp->sctp_conn_tfp != NULL); mutex_enter(&sctp->sctp_conn_tfp->tf_lock); if (fp == sctp->sctp_faddrs) { - sctp->sctp_faddrs = fp->next; + sctp->sctp_faddrs = fp->sf_next; } else { - fpp->next = fp->next; + fpp->sf_next = fp->sf_next; } mutex_exit(&sctp->sctp_conn_tfp->tf_lock); kmem_cache_free(sctp_kmem_faddr_cache, fp); @@ -864,10 +866,10 @@ } for (fp = sctp->sctp_faddrs; fp; fp = fpn) { - fpn = fp->next; - if (fp->ixa != NULL) { - ixa_refrele(fp->ixa); - fp->ixa = NULL; + fpn = fp->sf_next; + if (fp->sf_ixa != NULL) { + ixa_refrele(fp->sf_ixa); + fp->sf_ixa = NULL; } kmem_cache_free(sctp_kmem_faddr_cache, fp); sctp->sctp_nfaddrs--; @@ -1038,8 +1040,8 @@ { conn_t *connp = sctp->sctp_connp; - ASSERT(fp->ixa->ixa_flags & IXAF_IS_IPV4); - return (conn_update_label(connp, fp->ixa, &fp->faddr, + ASSERT(fp->sf_ixa->ixa_flags & IXAF_IS_IPV4); + return (conn_update_label(connp, fp->sf_ixa, &fp->sf_faddr, &connp->conn_xmit_ipp)); } @@ -1048,8 +1050,8 @@ { conn_t *connp = sctp->sctp_connp; - ASSERT(!(fp->ixa->ixa_flags & IXAF_IS_IPV4)); - return (conn_update_label(connp, fp->ixa, &fp->faddr, + ASSERT(!(fp->sf_ixa->ixa_flags & IXAF_IS_IPV4)); + return (conn_update_label(connp, fp->sf_ixa, &fp->sf_faddr, &connp->conn_xmit_ipp)); } @@ -1073,11 +1075,11 @@ ASSERT(sctp->sctp_nsaddrs > 0); /* Set up using the primary first */ - connp->conn_faddr_v6 = sctp->sctp_primary->faddr; + connp->conn_faddr_v6 = sctp->sctp_primary->sf_faddr; /* saddr may be unspec; make_mp() will handle this */ - connp->conn_saddr_v6 = sctp->sctp_primary->saddr; + connp->conn_saddr_v6 = sctp->sctp_primary->sf_saddr; connp->conn_laddr_v6 = connp->conn_saddr_v6; - if (IN6_IS_ADDR_V4MAPPED(&sctp->sctp_primary->faddr)) { + if (IN6_IS_ADDR_V4MAPPED(&sctp->sctp_primary->sf_faddr)) { if (!is_system_labeled() || sctp_v4_label(sctp, sctp->sctp_primary) == 0) { gotv4 = 1; @@ -1092,8 +1094,8 @@ } } - for (fp = sctp->sctp_faddrs; fp; fp = fp->next) { - if (!gotv4 && IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) { + if (!gotv4 && IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { if (!is_system_labeled() || sctp_v4_label(sctp, fp) == 0) { gotv4 = 1; @@ -1101,7 +1103,7 @@ break; } } - } else if (!gotv6 && !IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + } else if (!gotv6 && !IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { if (!is_system_labeled() || sctp_v6_label(sctp, fp) == 0) { gotv6 = 1; @@ -1320,11 +1322,11 @@ /* make the header addr the primary */ if (cl_sctp_assoc_change != NULL && psctp == NULL) - curaddr = sctp->sctp_current->faddr; + curaddr = sctp->sctp_current->sf_faddr; sctp->sctp_primary = fp; sctp->sctp_current = fp; - sctp->sctp_mss = fp->sfa_pmss; + sctp->sctp_mss = fp->sf_pmss; /* For loopback connections & linklocal get address from the header */ if (sctp->sctp_loopback || sctp->sctp_linklocal) { @@ -1555,8 +1557,8 @@ goto done; } bzero(fpa, sizeof (*fpa)); - fpa->faddr = addr; - fpa->next = NULL; + fpa->sf_faddr = addr; + fpa->sf_next = NULL; } } else if (ph->sph_type == htons(PARM_ADDR6)) { if (remaining >= PARM_ADDR6_LEN) { @@ -1566,9 +1568,9 @@ goto done; } bzero(fpa, sizeof (*fpa)); - bcopy(ph + 1, &fpa->faddr, - sizeof (fpa->faddr)); - fpa->next = NULL; + bcopy(ph + 1, &fpa->sf_faddr, + sizeof (fpa->sf_faddr)); + fpa->sf_next = NULL; } } /* link in the new addr, if it was an addr param */ @@ -1576,7 +1578,7 @@ if (fphead == NULL) { fphead = fpa; } else { - fpa->next = fphead; + fpa->sf_next = fphead; fphead = fpa; } } @@ -1601,8 +1603,8 @@ goto done; } bzero(fp, sizeof (*fp)); - fp->faddr = *hdraddr; - fp->next = fphead; + fp->sf_faddr = *hdraddr; + fp->sf_next = fphead; fphead = fp; } @@ -1641,11 +1643,11 @@ * here, setting it to 0 if the address was * not added, 1 if it was added. */ - for (fp = fphead; fp; fp = fp->next) { - if (sctp_lookup_faddr(sctp, &fp->faddr)) { - fp->rto = 0; + for (fp = fphead; fp; fp = fp->sf_next) { + if (sctp_lookup_faddr(sctp, &fp->sf_faddr)) { + fp->sf_rto = 0; } else { - fp->rto = 1; + fp->sf_rto = 1; nadded++; } } @@ -1671,16 +1673,16 @@ ph = dtail; dlen = 0; - for (fp = fphead; fp; fp = fp->next) { - if (fp->rto == 0) { + for (fp = fphead; fp; fp = fp->sf_next) { + if (fp->sf_rto == 0) { continue; } - if (IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + if (IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { ipaddr_t addr4; ph->sph_type = htons(PARM_ADDR4); ph->sph_len = htons(PARM_ADDR4_LEN); - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, addr4); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, addr4); ph++; bcopy(&addr4, ph, sizeof (addr4)); ph = (sctp_parm_hdr_t *) @@ -1690,9 +1692,9 @@ ph->sph_type = htons(PARM_ADDR6); ph->sph_len = htons(PARM_ADDR6_LEN); ph++; - bcopy(&fp->faddr, ph, sizeof (fp->faddr)); + bcopy(&fp->sf_faddr, ph, sizeof (fp->sf_faddr)); ph = (sctp_parm_hdr_t *) - ((char *)ph + sizeof (fp->faddr)); + ((char *)ph + sizeof (fp->sf_faddr)); dlen += PARM_ADDR6_LEN; } } @@ -1710,10 +1712,10 @@ if (fphead) { sctp_faddr_t *fpn; for (fp = fphead; fp; fp = fpn) { - fpn = fp->next; - if (fp->ixa != NULL) { - ixa_refrele(fp->ixa); - fp->ixa = NULL; + fpn = fp->sf_next; + if (fp->sf_ixa != NULL) { + ixa_refrele(fp->sf_ixa); + fp->sf_ixa = NULL; } kmem_cache_free(sctp_kmem_faddr_cache, fp); } @@ -1732,11 +1734,11 @@ sctp_stack_t *sctps = sctp->sctp_sctps; mblk_t *mp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - fp->ssthresh = sctps->sctps_initial_mtu; - SET_CWND(fp, fp->sfa_pmss, sctps->sctps_slow_start_initial); - fp->suna = 0; - fp->pba = 0; + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + fp->sf_ssthresh = sctps->sctps_initial_mtu; + SET_CWND(fp, fp->sf_pmss, sctps->sctps_slow_start_initial); + fp->sf_suna = 0; + fp->sf_pba = 0; } /* * Clean up the transmit list as well since we have reset accounting @@ -1778,48 +1780,48 @@ { sctp_stack_t *sctps = sctp->sctp_sctps; - ASSERT(fp->ixa != NULL); + ASSERT(fp->sf_ixa != NULL); - bcopy(addr, &fp->faddr, sizeof (*addr)); + bcopy(addr, &fp->sf_faddr, sizeof (*addr)); if (IN6_IS_ADDR_V4MAPPED(addr)) { - fp->isv4 = 1; - /* Make sure that sfa_pmss is a multiple of SCTP_ALIGN. */ - fp->sfa_pmss = + fp->sf_isv4 = 1; + /* Make sure that sf_pmss is a multiple of SCTP_ALIGN. */ + fp->sf_pmss = (sctps->sctps_initial_mtu - sctp->sctp_hdr_len) & ~(SCTP_ALIGN - 1); - fp->ixa->ixa_flags |= IXAF_IS_IPV4; + fp->sf_ixa->ixa_flags |= IXAF_IS_IPV4; } else { - fp->isv4 = 0; - fp->sfa_pmss = + fp->sf_isv4 = 0; + fp->sf_pmss = (sctps->sctps_initial_mtu - sctp->sctp_hdr6_len) & ~(SCTP_ALIGN - 1); - fp->ixa->ixa_flags &= ~IXAF_IS_IPV4; + fp->sf_ixa->ixa_flags &= ~IXAF_IS_IPV4; } - fp->cwnd = sctps->sctps_slow_start_initial * fp->sfa_pmss; - fp->rto = MIN(sctp->sctp_rto_initial, sctp->sctp_rto_max_init); + fp->sf_cwnd = sctps->sctps_slow_start_initial * fp->sf_pmss; + fp->sf_rto = MIN(sctp->sctp_rto_initial, sctp->sctp_rto_max_init); SCTP_MAX_RTO(sctp, fp); - fp->srtt = -1; - fp->rtt_updates = 0; - fp->strikes = 0; - fp->max_retr = sctp->sctp_pp_max_rxt; + fp->sf_srtt = -1; + fp->sf_rtt_updates = 0; + fp->sf_strikes = 0; + fp->sf_max_retr = sctp->sctp_pp_max_rxt; /* Mark it as not confirmed. */ - fp->state = SCTP_FADDRS_UNCONFIRMED; - fp->hb_interval = sctp->sctp_hb_interval; - fp->ssthresh = sctps->sctps_initial_ssthresh; - fp->suna = 0; - fp->pba = 0; - fp->acked = 0; - fp->lastactive = fp->hb_expiry = ddi_get_lbolt64(); - fp->timer_mp = timer_mp; - fp->hb_pending = B_FALSE; - fp->hb_enabled = B_TRUE; - fp->df = 1; - fp->pmtu_discovered = 0; - fp->next = NULL; - fp->T3expire = 0; - (void) random_get_pseudo_bytes((uint8_t *)&fp->hb_secret, - sizeof (fp->hb_secret)); - fp->rxt_unacked = 0; + fp->sf_state = SCTP_FADDRS_UNCONFIRMED; + fp->sf_hb_interval = sctp->sctp_hb_interval; + fp->sf_ssthresh = sctps->sctps_initial_ssthresh; + fp->sf_suna = 0; + fp->sf_pba = 0; + fp->sf_acked = 0; + fp->sf_lastactive = fp->sf_hb_expiry = ddi_get_lbolt64(); + fp->sf_timer_mp = timer_mp; + fp->sf_hb_pending = B_FALSE; + fp->sf_hb_enabled = B_TRUE; + fp->sf_df = 1; + fp->sf_pmtu_discovered = 0; + fp->sf_next = NULL; + fp->sf_T3expire = 0; + (void) random_get_pseudo_bytes((uint8_t *)&fp->sf_hb_secret, + sizeof (fp->sf_hb_secret)); + fp->sf_rxt_unacked = 0; sctp_get_dest(sctp, fp); } @@ -1830,11 +1832,11 @@ { sctp_faddr_t *fp = buf; - fp->timer_mp = NULL; - fp->timer_running = 0; + fp->sf_timer_mp = NULL; + fp->sf_timer_running = 0; - fp->rc_timer_mp = NULL; - fp->rc_timer_running = 0; + fp->sf_rc_timer_mp = NULL; + fp->sf_rc_timer_running = 0; return (0); } @@ -1845,11 +1847,11 @@ { sctp_faddr_t *fp = buf; - ASSERT(fp->timer_mp == NULL); - ASSERT(fp->timer_running == 0); + ASSERT(fp->sf_timer_mp == NULL); + ASSERT(fp->sf_timer_running == 0); - ASSERT(fp->rc_timer_mp == NULL); - ASSERT(fp->rc_timer_running == 0); + ASSERT(fp->sf_rc_timer_mp == NULL); + ASSERT(fp->sf_rc_timer_running == 0); } void
--- a/usr/src/uts/common/inet/sctp/sctp_conn.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_conn.c Tue Aug 03 22:50:37 2010 -0700 @@ -289,9 +289,9 @@ return (NULL); } - ASSERT(eager->sctp_current->ixa != NULL); + ASSERT(eager->sctp_current->sf_ixa != NULL); - ixa = eager->sctp_current->ixa; + ixa = eager->sctp_current->sf_ixa; if (!(ira->ira_flags & IXAF_IS_IPV4)) { ASSERT(!(ixa->ixa_flags & IXAF_IS_IPV4)); @@ -556,10 +556,10 @@ return (err); } cur_fp = sctp->sctp_faddrs; - ASSERT(cur_fp->ixa != NULL); + ASSERT(cur_fp->sf_ixa != NULL); /* No valid src addr, return. */ - if (cur_fp->state == SCTP_FADDRS_UNREACH) { + if (cur_fp->sf_state == SCTP_FADDRS_UNREACH) { mutex_exit(&tbf->tf_lock); WAKE_SCTP(sctp); return (EADDRNOTAVAIL); @@ -567,11 +567,11 @@ sctp->sctp_primary = cur_fp; sctp->sctp_current = cur_fp; - sctp->sctp_mss = cur_fp->sfa_pmss; + sctp->sctp_mss = cur_fp->sf_pmss; sctp_conn_hash_insert(tbf, sctp, 1); mutex_exit(&tbf->tf_lock); - ixa = cur_fp->ixa; + ixa = cur_fp->sf_ixa; ASSERT(ixa->ixa_cred != NULL); if (scope_id != 0) { @@ -604,13 +604,13 @@ * (but the cookie echo will still be sent with the df bit * off). */ - cur_fp->df = B_FALSE; + cur_fp->sf_df = B_FALSE; /* Mark this address as alive */ - cur_fp->state = SCTP_FADDRS_ALIVE; + cur_fp->sf_state = SCTP_FADDRS_ALIVE; /* Send the INIT to the peer */ - SCTP_FADDR_TIMER_RESTART(sctp, cur_fp, cur_fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, cur_fp, cur_fp->sf_rto); sctp->sctp_state = SCTPS_COOKIE_WAIT; /* * sctp_init_mp() could result in modifying the source
--- a/usr/src/uts/common/inet/sctp/sctp_cookie.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_cookie.c Tue Aug 03 22:50:37 2010 -0700 @@ -898,8 +898,8 @@ BUMP_LOCAL(sctp->sctp_obchunks); - sctp_set_iplen(sctp, camp, sctp->sctp_current->ixa); - (void) conn_ip_output(camp, sctp->sctp_current->ixa); + sctp_set_iplen(sctp, camp, sctp->sctp_current->sf_ixa); + (void) conn_ip_output(camp, sctp->sctp_current->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } @@ -974,7 +974,7 @@ BPRI_MED); if (cemp == NULL) { SCTP_FADDR_TIMER_RESTART(sctp, sctp->sctp_current, - sctp->sctp_current->rto); + sctp->sctp_current->sf_rto); if (errmp != NULL) freeb(errmp); return; @@ -995,7 +995,7 @@ * Need to set the df bit in the current fp as it has been cleared * in sctp_connect(). */ - sctp->sctp_current->df = B_TRUE; + sctp->sctp_current->sf_df = B_TRUE; sctp->sctp_ipha->ipha_fragment_offset_and_flags |= IPH_DF_HTONS; /* @@ -1011,7 +1011,7 @@ mutex_exit(&tf->tf_lock); freeb(cemp); SCTP_FADDR_TIMER_RESTART(sctp, sctp->sctp_current, - sctp->sctp_current->rto); + sctp->sctp_current->sf_rto); if (errmp != NULL) freeb(errmp); return; @@ -1043,7 +1043,7 @@ } if (sctp->sctp_ostrcntrs == NULL) { freeb(cemp); - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); if (errmp != NULL) freeb(errmp); return; @@ -1073,7 +1073,7 @@ kmem_free(sctp->sctp_ostrcntrs, sizeof (uint16_t) * sctp->sctp_num_ostr); freeb(cemp); - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); if (errmp != NULL) freeb(errmp); return; @@ -1157,7 +1157,7 @@ sctp->sctp_xmit_tail = meta; sdc = (sctp_data_hdr_t *)mp->b_rptr; seglen = ntohs(sdc->sdh_len); - if ((ceclen + seglen) > fp->sfa_pmss || + if ((ceclen + seglen) > fp->sf_pmss || (seglen - sizeof (*sdc)) > cansend) { goto sendcookie; } @@ -1167,7 +1167,7 @@ head = sctp_add_proto_hdr(sctp, fp, cemp, 0, NULL); if (head == NULL) { freemsg(cemp); - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); if (errmp != NULL) freeb(errmp); SCTP_KSTAT(sctps, sctp_send_cookie_failed); @@ -1177,7 +1177,7 @@ * Even if cookie-echo exceeds MTU for one of the hops, it'll * have a chance of getting there. */ - if (fp->isv4) { + if (fp->sf_isv4) { ipha_t *iph = (ipha_t *)head->b_rptr; iph->ipha_fragment_offset_and_flags = 0; } @@ -1203,10 +1203,10 @@ linkb(head, errmp); } sctp->sctp_state = SCTPS_COOKIE_ECHOED; - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); - sctp_set_iplen(sctp, head, fp->ixa); - (void) conn_ip_output(head, fp->ixa); + sctp_set_iplen(sctp, head, fp->sf_ixa); + (void) conn_ip_output(head, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } @@ -1331,7 +1331,7 @@ *fttag == 0 && *lttag == 0) { dprint(1, ("duplicate cookie from %x:%x:%x:%x (%d)\n", - SCTP_PRINTADDR(sctp->sctp_current->faddr), + SCTP_PRINTADDR(sctp->sctp_current->sf_faddr), (int)(connp->conn_fport))); return (-1); } @@ -1358,7 +1358,7 @@ SCTP_ASSOC_EST(sctps, sctp); dprint(1, ("sctp peer %x:%x:%x:%x (%d) restarted\n", - SCTP_PRINTADDR(sctp->sctp_current->faddr), + SCTP_PRINTADDR(sctp->sctp_current->sf_faddr), (int)(connp->conn_fport))); /* reset parameters */ sctp_congest_reset(sctp); @@ -1385,7 +1385,7 @@ } dprint(1, ("init collision with %x:%x:%x:%x (%d)\n", - SCTP_PRINTADDR(sctp->sctp_current->faddr), + SCTP_PRINTADDR(sctp->sctp_current->sf_faddr), (int)(connp->conn_fport))); return (0); @@ -1395,7 +1395,7 @@ /* Section 5.2.4 case C: late COOKIE */ dprint(1, ("late cookie from %x:%x:%x:%x (%d)\n", - SCTP_PRINTADDR(sctp->sctp_current->faddr), + SCTP_PRINTADDR(sctp->sctp_current->sf_faddr), (int)(connp->conn_fport))); return (-1); } else if (init->sic_inittag == sctp->sctp_fvtag && @@ -1406,7 +1406,7 @@ * Don't check cookie lifetime */ dprint(1, ("cookie tags match from %x:%x:%x:%x (%d)\n", - SCTP_PRINTADDR(sctp->sctp_current->faddr), + SCTP_PRINTADDR(sctp->sctp_current->sf_faddr), (int)(connp->conn_fport))); if (sctp->sctp_state < SCTPS_ESTABLISHED) { if (!sctp_initialize_params(sctp, init, iack))
--- a/usr/src/uts/common/inet/sctp/sctp_error.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_error.c Tue Aug 03 22:50:37 2010 -0700 @@ -100,7 +100,7 @@ int len, hdrlen; char *cause; sctp_faddr_t *fp = sctp->sctp_current; - ip_xmit_attr_t *ixa = fp->ixa; + ip_xmit_attr_t *ixa = fp->sf_ixa; sctp_stack_t *sctps = sctp->sctp_sctps; /* @@ -123,7 +123,7 @@ * Create abort chunk. */ if (data) { - if (fp->isv4) { + if (fp->sf_isv4) { hdrlen = sctp->sctp_hdr_len; } else { hdrlen = sctp->sctp_hdr6_len; @@ -132,8 +132,8 @@ cause = (char *)data->b_rptr; len = data->b_wptr - data->b_rptr; - if (len + hdrlen > fp->sfa_pmss) { - len = fp->sfa_pmss - hdrlen; + if (len + hdrlen > fp->sf_pmss) { + len = fp->sf_pmss - hdrlen; } } else { cause = NULL; @@ -534,7 +534,7 @@ fp = dest; SCTP_SET_CHUNK_DEST(emp, dest); } - mss = fp->sfa_pmss; + mss = fp->sf_pmss; /* * If the current output packet cannot include the new error chunk, @@ -549,8 +549,8 @@ return; } sendmp->b_cont = sctp->sctp_err_chunks; - sctp_set_iplen(sctp, sendmp, fp->ixa); - (void) conn_ip_output(sendmp, fp->ixa); + sctp_set_iplen(sctp, sendmp, fp->sf_ixa); + (void) conn_ip_output(sendmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); sctp->sctp_err_chunks = emp; @@ -588,8 +588,8 @@ goto done; } sendmp->b_cont = errmp; - sctp_set_iplen(sctp, sendmp, fp->ixa); - (void) conn_ip_output(sendmp, fp->ixa); + sctp_set_iplen(sctp, sendmp, fp->sf_ixa); + (void) conn_ip_output(sendmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); done: sctp->sctp_err_chunks = NULL;
--- a/usr/src/uts/common/inet/sctp/sctp_hash.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_hash.c Tue Aug 03 22:50:37 2010 -0700 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/socket.h> @@ -255,9 +255,10 @@ continue; /* check for faddr match */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { for (faddrs = faddrpp; faddrs < endaddrs; faddrs++) { - if (IN6_ARE_ADDR_EQUAL(*faddrs, &fp->faddr)) { + if (IN6_ARE_ADDR_EQUAL(*faddrs, + &fp->sf_faddr)) { /* check for laddr match */ if (sctp_saddr_lookup(sctp, laddr, 0) != NULL) { @@ -866,8 +867,8 @@ } /* check for faddr match */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (IN6_ARE_ADDR_EQUAL(faddr, &fp->faddr)) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (IN6_ARE_ADDR_EQUAL(faddr, &fp->sf_faddr)) { break; } }
--- a/usr/src/uts/common/inet/sctp/sctp_heartbeat.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_heartbeat.c Tue Aug 03 22:50:37 2010 -0700 @@ -103,8 +103,8 @@ BUMP_LOCAL(sctp->sctp_obchunks); - sctp_set_iplen(sctp, smp, fp->ixa); - (void) conn_ip_output(smp, fp->ixa); + sctp_set_iplen(sctp, smp, fp->sf_ixa); + (void) conn_ip_output(smp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } @@ -127,13 +127,13 @@ sctp_stack_t *sctps = sctp->sctp_sctps; dprint(3, ("sctp_send_heartbeat: to %x:%x:%x:%x from %x:%x:%x:%x\n", - SCTP_PRINTADDR(fp->faddr), SCTP_PRINTADDR(fp->saddr))); + SCTP_PRINTADDR(fp->sf_faddr), SCTP_PRINTADDR(fp->sf_saddr))); hblen = sizeof (*cp) + sizeof (*hpp) + sizeof (*t) + - sizeof (fp->hb_secret) + - sizeof (fp->faddr); + sizeof (fp->sf_hb_secret) + + sizeof (fp->sf_faddr); hbmp = sctp_make_mp(sctp, fp, hblen); if (hbmp == NULL) { SCTP_KSTAT(sctps, sctp_send_hb_failed); @@ -169,7 +169,7 @@ * spoofing of heartbeat ack to fake the validity of an address. */ t++; - bcopy(&fp->hb_secret, t, sizeof (uint64_t)); + bcopy(&fp->sf_hb_secret, t, sizeof (uint64_t)); /* * Peer address @@ -180,19 +180,19 @@ * in response to our heartbeat. */ a = (in6_addr_t *)(t + 1); - bcopy(&fp->faddr, a, sizeof (*a)); + bcopy(&fp->sf_faddr, a, sizeof (*a)); hbmp->b_wptr += hblen; /* Update the faddr's info */ - fp->lastactive = now; - fp->hb_pending = B_TRUE; + fp->sf_lastactive = now; + fp->sf_hb_pending = B_TRUE; BUMP_LOCAL(sctp->sctp_obchunks); SCTPS_BUMP_MIB(sctps, sctpTimHeartBeatProbe); - sctp_set_iplen(sctp, hbmp, fp->ixa); - (void) conn_ip_output(hbmp, fp->ixa); + sctp_set_iplen(sctp, hbmp, fp->sf_ixa); + (void) conn_ip_output(hbmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } @@ -217,13 +217,13 @@ * send a heartbeat. But we should only send at most sctp_maxburst * heartbeats. */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { /* No need to validate unreachable address. */ - if (fp->state == SCTP_FADDRS_UNREACH) + if (fp->sf_state == SCTP_FADDRS_UNREACH) continue; - if (fp->state == SCTP_FADDRS_UNCONFIRMED) { + if (fp->sf_state == SCTP_FADDRS_UNCONFIRMED) { if (cnt-- > 0) { - fp->hb_expiry = now + fp->rto; + fp->sf_hb_expiry = now + fp->sf_rto; sctp_send_heartbeat(sctp, fp); } else { /* @@ -232,14 +232,14 @@ * all the unsent probes are set to expire at * the same time. */ - fp->hb_expiry = now + + fp->sf_hb_expiry = now + (sctp->sctp_rto_initial >> 1); } } /* Find the earliest heartbeat expiry time for ALL fps. */ - if (fp->hb_interval != 0 && (earliest_expiry == 0 || - fp->hb_expiry < earliest_expiry)) { - earliest_expiry = fp->hb_expiry; + if (fp->sf_hb_interval != 0 && (earliest_expiry == 0 || + fp->sf_hb_expiry < earliest_expiry)) { + earliest_expiry = fp->sf_hb_expiry; } } /* We use heartbeat timer for autoclose. */ @@ -319,7 +319,7 @@ (void *)sctp)); return; } - if (secret != fp->hb_secret) { + if (secret != fp->sf_hb_secret) { dprint(2, ("sctp_process_heartbeat: invalid secret in ack %p\n", (void *)sctp)); @@ -336,5 +336,5 @@ * reset it to avoid going through the whole list of peer addresses * for each heartbeat ack as we probably are in interrupt context. */ - fp->hb_expiry = now + SET_HB_INTVL(fp); + fp->sf_hb_expiry = now + SET_HB_INTVL(fp); }
--- a/usr/src/uts/common/inet/sctp/sctp_impl.h Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_impl.h Tue Aug 03 22:50:37 2010 -0700 @@ -144,16 +144,16 @@ #define SCTP_FADDR_TIMER_RESTART(sctp, fp, intvl) \ { \ dprint(3, ("faddr_timer_restart: fp=%p %x:%x:%x:%x %d\n", \ - (void *)(fp), SCTP_PRINTADDR((fp)->faddr), (int)(intvl))); \ - sctp_timer((sctp), (fp)->timer_mp, (intvl)); \ - (fp)->timer_running = 1; \ + (void *)(fp), SCTP_PRINTADDR((fp)->sf_faddr), (int)(intvl))); \ + sctp_timer((sctp), (fp)->sf_timer_mp, (intvl)); \ + (fp)->sf_timer_running = 1; \ } #define SCTP_FADDR_TIMER_STOP(fp) \ - ASSERT((fp)->timer_mp != NULL); \ - if ((fp)->timer_running) { \ - sctp_timer_stop((fp)->timer_mp); \ - (fp)->timer_running = 0; \ + ASSERT((fp)->sf_timer_mp != NULL); \ + if ((fp)->sf_timer_running) { \ + sctp_timer_stop((fp)->sf_timer_mp); \ + (fp)->sf_timer_running = 0; \ } /* For per endpoint association statistics */ @@ -164,15 +164,15 @@ * at the end of each stats request. \ */ \ (sctp)->sctp_maxrto = \ - MAX((sctp)->sctp_maxrto, (fp)->rto); \ + MAX((sctp)->sctp_maxrto, (fp)->sf_rto); \ DTRACE_PROBE2(sctp__maxrto, sctp_t *, \ sctp, struct sctp_faddr_s, fp); \ } #define SCTP_CALC_RXT(sctp, fp, max) \ { \ - if (((fp)->rto <<= 1) > (max)) \ - (fp)->rto = (max); \ + if (((fp)->sf_rto <<= 1) > (max)) \ + (fp)->sf_rto = (max); \ SCTP_MAX_RTO(sctp, fp); \ } @@ -272,9 +272,9 @@ if (SCTP_CHUNK_ISACKED(mp)) { \ (sctp)->sctp_unacked += (chunkdata); \ } else { \ - ASSERT(SCTP_CHUNK_DEST(mp)->suna >= ((chunkdata) + \ + ASSERT(SCTP_CHUNK_DEST(mp)->sf_suna >= ((chunkdata) + \ sizeof (*sdc))); \ - SCTP_CHUNK_DEST(mp)->suna -= ((chunkdata) + \ + SCTP_CHUNK_DEST(mp)->sf_suna -= ((chunkdata) + \ sizeof (*sdc)); \ } \ DTRACE_PROBE3(sctp__chunk__sent2, sctp_t *, sctp, \ @@ -284,10 +284,10 @@ SCTP_CHUNK_SET_SACKCNT(mp, 0); \ BUMP_LOCAL(sctp->sctp_rxtchunks); \ BUMP_LOCAL((sctp)->sctp_T3expire); \ - BUMP_LOCAL((fp)->T3expire); \ + BUMP_LOCAL((fp)->sf_T3expire); \ } \ SCTP_SET_CHUNK_DEST(mp, fp); \ - (fp)->suna += ((chunkdata) + sizeof (*sdc)); \ + (fp)->sf_suna += ((chunkdata) + sizeof (*sdc)); \ } #define SCTP_CHUNK_ISSENT(mp) ((mp)->b_flag & SCTP_CHUNK_FLAG_SENT) @@ -480,17 +480,17 @@ /* Reassembly data structure (per-stream) */ typedef struct sctp_reass_s { - uint16_t ssn; - uint16_t needed; - uint16_t got; - uint16_t msglen; /* len of consecutive fragments */ + uint16_t sr_ssn; + uint16_t sr_needed; + uint16_t sr_got; + uint16_t sr_msglen; /* len of consecutive fragments */ /* from the begining (B-bit) */ - mblk_t *tail; - boolean_t hasBchunk; /* If the fragment list begins with */ + mblk_t *sr_tail; + boolean_t sr_hasBchunk; /* If the fragment list begins with */ /* a B-bit set chunk */ - uint32_t nexttsn; /* TSN of the next fragment we */ + uint32_t sr_nexttsn; /* TSN of the next fragment we */ /* are expecting */ - boolean_t partial_delivered; + boolean_t sr_partial_delivered; } sctp_reass_t; /* debugging */ @@ -541,45 +541,45 @@ } faddr_state_t; typedef struct sctp_faddr_s { - struct sctp_faddr_s *next; - faddr_state_t state; + struct sctp_faddr_s *sf_next; + faddr_state_t sf_state; - in6_addr_t faddr; - in6_addr_t saddr; + in6_addr_t sf_faddr; + in6_addr_t sf_saddr; - int64_t hb_expiry; /* time to retransmit heartbeat */ - uint32_t hb_interval; /* the heartbeat interval */ + int64_t sf_hb_expiry; /* time to retransmit heartbeat */ + uint32_t sf_hb_interval; /* the heartbeat interval */ - int rto; /* RTO in tick */ - int srtt; /* Smoothed RTT in tick */ - int rttvar; /* RTT variance in tick */ - uint32_t rtt_updates; - int strikes; - int max_retr; - uint32_t sfa_pmss; - uint32_t cwnd; - uint32_t ssthresh; - uint32_t suna; /* sent - unack'ed */ - uint32_t pba; /* partial bytes acked */ - uint32_t acked; - int64_t lastactive; - mblk_t *timer_mp; /* retransmission timer control */ + int sf_rto; /* RTO in tick */ + int sf_srtt; /* Smoothed RTT in tick */ + int sf_rttvar; /* RTT variance in tick */ + uint32_t sf_rtt_updates; + int sf_strikes; + int sf_max_retr; + uint32_t sf_pmss; + uint32_t sf_cwnd; + uint32_t sf_ssthresh; + uint32_t sf_suna; /* sent - unack'ed */ + uint32_t sf_pba; /* partial bytes acked */ + uint32_t sf_acked; + int64_t sf_lastactive; + mblk_t *sf_timer_mp; /* retransmission timer control */ uint32_t - hb_pending : 1, - timer_running : 1, - df : 1, - pmtu_discovered : 1, + sf_hb_pending : 1, + sf_timer_running : 1, + sf_df : 1, + sf_pmtu_discovered : 1, - rc_timer_running : 1, - isv4 : 1, - hb_enabled : 1; + sf_rc_timer_running : 1, + sf_isv4 : 1, + sf_hb_enabled : 1; - mblk_t *rc_timer_mp; /* reliable control chunk timer */ - ip_xmit_attr_t *ixa; /* Transmit attributes */ - uint32_t T3expire; /* # of times T3 timer expired */ + mblk_t *sf_rc_timer_mp; /* reliable control chunk timer */ + ip_xmit_attr_t *sf_ixa; /* Transmit attributes */ + uint32_t sf_T3expire; /* # of times T3 timer expired */ - uint64_t hb_secret; /* per addr "secret" in heartbeat */ - uint32_t rxt_unacked; /* # unack'ed retransmitted bytes */ + uint64_t sf_hb_secret; /* per addr "secret" in heartbeat */ + uint32_t sf_rxt_unacked; /* # unack'ed retransmitted bytes */ } sctp_faddr_t; /* Flags to indicate supported address type in the PARM_SUP_ADDRS. */ @@ -592,8 +592,8 @@ * as the jitter does not really need to be "very" random. */ #define SET_HB_INTVL(fp) \ - ((fp)->hb_interval + (fp)->rto + ((fp)->rto >> 1) - \ - (uint_t)gethrtime() % (fp)->rto) + ((fp)->sf_hb_interval + (fp)->sf_rto + ((fp)->sf_rto >> 1) - \ + (uint_t)gethrtime() % (fp)->sf_rto) #define SCTP_IPIF_HASH 16 @@ -611,7 +611,7 @@ */ #define SET_CWND(fp, mss, def_max_init_cwnd) \ { \ - (fp)->cwnd = MIN(def_max_init_cwnd * (mss), \ + (fp)->sf_cwnd = MIN(def_max_init_cwnd * (mss), \ MIN(4 * (mss), MAX(2 * (mss), 4380 / (mss) * (mss)))); \ }
--- a/usr/src/uts/common/inet/sctp/sctp_init.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_init.c Tue Aug 03 22:50:37 2010 -0700 @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/types.h> @@ -221,7 +220,7 @@ BUMP_LOCAL(sctp->sctp_obchunks); - sctp_set_iplen(sctp, mp, fp->ixa); + sctp_set_iplen(sctp, mp, fp->sf_ixa); return (mp); }
--- a/usr/src/uts/common/inet/sctp/sctp_input.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_input.c Tue Aug 03 22:50:37 2010 -0700 @@ -343,13 +343,13 @@ sin4 = (struct sockaddr_in *)sin_buf; sin4->sin_family = AF_INET; sin4->sin_port = connp->conn_fport; - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, sin4->sin_addr.s_addr); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, sin4->sin_addr.s_addr); hdrlen = sizeof (*tudi) + sizeof (*sin4); } else { sin6 = sin_buf; sin6->sin6_family = AF_INET6; sin6->sin6_port = connp->conn_fport; - sin6->sin6_addr = fp->faddr; + sin6->sin6_addr = fp->sf_faddr; hdrlen = sizeof (*tudi) + sizeof (*sin6); } /* If app asked to receive send / recv info */ @@ -641,7 +641,7 @@ #ifdef DEBUG srp = (sctp_reass_t *)DB_BASE(mctl); /* Partial delivery can leave empty srp */ - ASSERT(mp->b_cont != NULL || srp->got == 0); + ASSERT(mp->b_cont != NULL || srp->sr_got == 0); #endif mp = mp->b_cont; mctl->b_cont = NULL; @@ -816,12 +816,12 @@ ASSERT(DB_TYPE(hmp) == M_CTL); dprint(4, ("trypartial: got=%d, needed=%d\n", - (int)(srp->got), (int)(srp->needed))); + (int)(srp->sr_got), (int)(srp->sr_needed))); mp = hmp->b_cont; qdc = (sctp_data_hdr_t *)mp->b_rptr; - ASSERT(SCTP_DATA_GET_BBIT(qdc) && srp->hasBchunk); + ASSERT(SCTP_DATA_GET_BBIT(qdc) && srp->sr_hasBchunk); tsn = ntohl(qdc->sdh_tsn) + 1; @@ -851,11 +851,11 @@ if (mp == NULL) { dmp = hmp->b_cont; hmp->b_cont = NULL; - srp->nexttsn = tsn; - srp->msglen = 0; - srp->needed = 0; - srp->got = 0; - srp->tail = NULL; + srp->sr_nexttsn = tsn; + srp->sr_msglen = 0; + srp->sr_needed = 0; + srp->sr_got = 0; + srp->sr_tail = NULL; } else { /* * There is a gap then some ordered frags which are not @@ -866,7 +866,7 @@ dmp = hmp->b_cont; hmp->b_cont = mp; } - srp->hasBchunk = B_FALSE; + srp->sr_hasBchunk = B_FALSE; /* * mp now points at the last chunk in the sequence, * and prev points to mp's previous in the list. @@ -875,10 +875,10 @@ * path unless they too exceed the sctp_pd_point. */ prev->b_cont = NULL; - srp->partial_delivered = B_TRUE; + srp->sr_partial_delivered = B_TRUE; dprint(4, ("trypartial: got some, got=%d, needed=%d\n", - (int)(srp->got), (int)(srp->needed))); + (int)(srp->sr_got), (int)(srp->sr_needed))); /* * Adjust all mblk's except the lead so their rptr's point to the @@ -886,14 +886,14 @@ * data chunk section, so leave it's rptr pointing at the data chunk. */ *dc = (sctp_data_hdr_t *)dmp->b_rptr; - if (srp->tail != NULL) { - srp->got--; - ASSERT(srp->got != 0); - if (srp->needed != 0) { - srp->needed--; - ASSERT(srp->needed != 0); + if (srp->sr_tail != NULL) { + srp->sr_got--; + ASSERT(srp->sr_got != 0); + if (srp->sr_needed != 0) { + srp->sr_needed--; + ASSERT(srp->sr_needed != 0); } - srp->msglen -= ntohs((*dc)->sdh_len); + srp->sr_msglen -= ntohs((*dc)->sdh_len); } for (qmp = dmp->b_cont; qmp != NULL; qmp = qmp->b_cont) { qdc = (sctp_data_hdr_t *)qmp->b_rptr; @@ -903,17 +903,17 @@ * Deduct the balance from got and needed here, now that * we know we are actually delivering these data. */ - if (srp->tail != NULL) { - srp->got--; - ASSERT(srp->got != 0); - if (srp->needed != 0) { - srp->needed--; - ASSERT(srp->needed != 0); + if (srp->sr_tail != NULL) { + srp->sr_got--; + ASSERT(srp->sr_got != 0); + if (srp->sr_needed != 0) { + srp->sr_needed--; + ASSERT(srp->sr_needed != 0); } - srp->msglen -= ntohs(qdc->sdh_len); + srp->sr_msglen -= ntohs(qdc->sdh_len); } } - ASSERT(srp->msglen == 0); + ASSERT(srp->sr_msglen == 0); BUMP_LOCAL(sctp->sctp_reassmsgs); return (dmp); @@ -956,10 +956,10 @@ reassq_next = reassq_prev = sip->istr_reass; for (; reassq_next != NULL; reassq_next = reassq_next->b_next) { srp = (sctp_reass_t *)DB_BASE(reassq_next); - if (ntohs((*dc)->sdh_ssn) == srp->ssn) { + if (ntohs((*dc)->sdh_ssn) == srp->sr_ssn) { reassq_curr = reassq_next; goto foundit; - } else if (SSN_GT(srp->ssn, ntohs((*dc)->sdh_ssn))) + } else if (SSN_GT(srp->sr_ssn, ntohs((*dc)->sdh_ssn))) break; reassq_prev = reassq_next; } @@ -1012,21 +1012,21 @@ } new_reassq->b_next = NULL; } - srp->partial_delivered = B_FALSE; - srp->ssn = ntohs((*dc)->sdh_ssn); - srp->hasBchunk = B_FALSE; + srp->sr_partial_delivered = B_FALSE; + srp->sr_ssn = ntohs((*dc)->sdh_ssn); + srp->sr_hasBchunk = B_FALSE; empty_srp: - srp->needed = 0; - srp->got = 1; + srp->sr_needed = 0; + srp->sr_got = 1; /* tail always the highest tsn on the reassembly queue for this ssn */ - srp->tail = dmp; + srp->sr_tail = dmp; if (SCTP_DATA_GET_BBIT(*dc)) { /* Incoming frag is flagged as the beginning of message */ - srp->msglen = ntohs((*dc)->sdh_len); - srp->nexttsn = ntohl((*dc)->sdh_tsn) + 1; - srp->hasBchunk = B_TRUE; - } else if (srp->partial_delivered && - srp->nexttsn == ntohl((*dc)->sdh_tsn)) { + srp->sr_msglen = ntohs((*dc)->sdh_len); + srp->sr_nexttsn = ntohl((*dc)->sdh_tsn) + 1; + srp->sr_hasBchunk = B_TRUE; + } else if (srp->sr_partial_delivered && + srp->sr_nexttsn == ntohl((*dc)->sdh_tsn)) { /* * The real beginning fragment of the message was already * delivered upward, so this is the earliest frag expected. @@ -1034,15 +1034,15 @@ * message. */ SCTP_DATA_SET_BBIT(*dc); - srp->hasBchunk = B_TRUE; - srp->msglen = ntohs((*dc)->sdh_len); + srp->sr_hasBchunk = B_TRUE; + srp->sr_msglen = ntohs((*dc)->sdh_len); if (SCTP_DATA_GET_EBIT(*dc)) { /* This frag is marked as the end of message */ - srp->needed = 1; + srp->sr_needed = 1; /* Got all fragments of this message now */ goto frag_done; } - srp->nexttsn++; + srp->sr_nexttsn++; } /* The only fragment of this message currently queued */ @@ -1054,15 +1054,15 @@ * in the reassembly queue. Try the tail first, on the assumption * that the fragments are arriving in order. */ - qmp = srp->tail; + qmp = srp->sr_tail; /* * A NULL tail means all existing fragments of the message have * been entirely consumed during a partially delivery. */ if (qmp == NULL) { - ASSERT(srp->got == 0 && srp->needed == 0 && - srp->partial_delivered); + ASSERT(srp->sr_got == 0 && srp->sr_needed == 0 && + srp->sr_partial_delivered); ASSERT(reassq_curr->b_cont == NULL); reassq_curr->b_cont = dmp; goto empty_srp; @@ -1075,10 +1075,10 @@ * be set as the new head of list upon arrival. Fake B-bit * on that frag then see if it also completes the message. */ - if (srp->partial_delivered && - srp->nexttsn == ntohl((*dc)->sdh_tsn)) { + if (srp->sr_partial_delivered && + srp->sr_nexttsn == ntohl((*dc)->sdh_tsn)) { SCTP_DATA_SET_BBIT(*dc); - srp->hasBchunk = B_TRUE; + srp->sr_hasBchunk = B_TRUE; if (SCTP_DATA_GET_EBIT(*dc)) { /* Got all fragments of this message now */ goto frag_done; @@ -1093,11 +1093,12 @@ /* check if the frag goes on the tail in order */ if (SEQ_GT(ntohl((*dc)->sdh_tsn), ntohl(qdc->sdh_tsn))) { qmp->b_cont = dmp; - srp->tail = dmp; + srp->sr_tail = dmp; dmp->b_cont = NULL; - if (srp->hasBchunk && srp->nexttsn == ntohl((*dc)->sdh_tsn)) { - srp->msglen += ntohs((*dc)->sdh_len); - srp->nexttsn++; + if (srp->sr_hasBchunk && srp->sr_nexttsn == + ntohl((*dc)->sdh_tsn)) { + srp->sr_msglen += ntohs((*dc)->sdh_len); + srp->sr_nexttsn++; } goto inserted; } @@ -1109,8 +1110,8 @@ dmp->b_cont = qmp; reassq_curr->b_cont = dmp; if (SCTP_DATA_GET_BBIT(*dc)) { - srp->hasBchunk = B_TRUE; - srp->nexttsn = ntohl((*dc)->sdh_tsn); + srp->sr_hasBchunk = B_TRUE; + srp->sr_nexttsn = ntohl((*dc)->sdh_tsn); } goto preinserted; } @@ -1134,13 +1135,13 @@ * Need head of message and to be due to deliver, otherwise skip * the recalculation of the message length below. */ - if (!srp->hasBchunk || ntohl((*dc)->sdh_tsn) != srp->nexttsn) + if (!srp->sr_hasBchunk || ntohl((*dc)->sdh_tsn) != srp->sr_nexttsn) goto inserted; /* * fraglen contains the length of consecutive chunks of fragments. * starting from the chunk we just inserted. */ - tsn = srp->nexttsn; + tsn = srp->sr_nexttsn; for (qmp = dmp; qmp != NULL; qmp = qmp->b_cont) { qdc = (sctp_data_hdr_t *)qmp->b_rptr; if (tsn != ntohl(qdc->sdh_tsn)) @@ -1148,23 +1149,23 @@ fraglen += ntohs(qdc->sdh_len); tsn++; } - srp->nexttsn = tsn; - srp->msglen += fraglen; + srp->sr_nexttsn = tsn; + srp->sr_msglen += fraglen; inserted: - srp->got++; + srp->sr_got++; first_mp = reassq_curr->b_cont; /* Prior to this frag either the beginning or end frag was missing */ - if (srp->needed == 0) { + if (srp->sr_needed == 0) { /* used to check if we have the first and last fragments */ bdc = (sctp_data_hdr_t *)first_mp->b_rptr; - edc = (sctp_data_hdr_t *)srp->tail->b_rptr; + edc = (sctp_data_hdr_t *)srp->sr_tail->b_rptr; /* * If we now have both the beginning and the end of the message, * calculate how many fragments in the complete message. */ if (SCTP_DATA_GET_BBIT(bdc) && SCTP_DATA_GET_EBIT(edc)) { - srp->needed = ntohl(edc->sdh_tsn) - + srp->sr_needed = ntohl(edc->sdh_tsn) - ntohl(bdc->sdh_tsn) + 1; } } @@ -1178,12 +1179,12 @@ * sctp_try_partial_delivery() will return a message consisting * of only consecutive fragments. */ - if (srp->needed != srp->got) { + if (srp->sr_needed != srp->sr_got) { /* we don't have the full message yet */ dmp = NULL; if (ntohl((*dc)->sdh_tsn) <= sctp->sctp_ftsn && - srp->msglen >= sctp->sctp_pd_point && - srp->ssn == sip->nextseq) { + srp->sr_msglen >= sctp->sctp_pd_point && + srp->sr_ssn == sip->nextseq) { dmp = sctp_try_partial_delivery(sctp, reassq_curr, srp, dc); } @@ -1869,7 +1870,7 @@ */ if (sctp->sctp_err_chunks != NULL) { fp = SCTP_CHUNK_DEST(sctp->sctp_err_chunks); - if (sctp->sctp_err_len + slen + dups_len > fp->sfa_pmss) { + if (sctp->sctp_err_len + slen + dups_len > fp->sf_pmss) { if ((smp = sctp_make_mp(sctp, fp, 0)) == NULL) { SCTP_KSTAT(sctps, sctp_send_err_failed); SCTP_KSTAT(sctps, sctp_send_sack_failed); @@ -1879,8 +1880,8 @@ return (NULL); } smp->b_cont = sctp->sctp_err_chunks; - sctp_set_iplen(sctp, smp, fp->ixa); - (void) conn_ip_output(smp, fp->ixa); + sctp_set_iplen(sctp, smp, fp->sf_ixa); + (void) conn_ip_output(smp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); sctp->sctp_err_chunks = NULL; sctp->sctp_err_len = 0; @@ -1935,14 +1936,14 @@ } dprint(2, ("sctp_sack: sending to %p %x:%x:%x:%x\n", (void *)sctp->sctp_lastdata, - SCTP_PRINTADDR(sctp->sctp_lastdata->faddr))); + SCTP_PRINTADDR(sctp->sctp_lastdata->sf_faddr))); sctp->sctp_active = LBOLT_FASTPATH64; SCTPS_BUMP_MIB(sctps, sctpOutAck); - sctp_set_iplen(sctp, smp, sctp->sctp_lastdata->ixa); - (void) conn_ip_output(smp, sctp->sctp_lastdata->ixa); + sctp_set_iplen(sctp, smp, sctp->sctp_lastdata->sf_ixa); + (void) conn_ip_output(smp, sctp->sctp_lastdata->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); return (B_TRUE); } @@ -1998,11 +1999,11 @@ return (ENOMEM); } SCTP_MSG_SET_ABANDONED(meta); - sctp_set_iplen(sctp, head, fp->ixa); - (void) conn_ip_output(head, fp->ixa); + sctp_set_iplen(sctp, head, fp->sf_ixa); + (void) conn_ip_output(head, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); mp1 = mp1->b_next; while (mp1 != NULL) { ASSERT(!SCTP_CHUNK_ISSENT(mp1)); @@ -2087,21 +2088,21 @@ continue; SCTP_CHUNK_SET_SACKCNT(mp, 0); SCTP_CHUNK_ACKED(mp); - ASSERT(fp->suna >= chunklen); - fp->suna -= chunklen; - fp->acked += chunklen; + ASSERT(fp->sf_suna >= chunklen); + fp->sf_suna -= chunklen; + fp->sf_acked += chunklen; cumack_forward += chunklen; ASSERT(sctp->sctp_unacked >= (chunklen - sizeof (*sdc))); sctp->sctp_unacked -= (chunklen - sizeof (*sdc)); - if (fp->suna == 0) { + if (fp->sf_suna == 0) { /* all outstanding data acked */ - fp->pba = 0; + fp->sf_pba = 0; SCTP_FADDR_TIMER_STOP(fp); } else { SCTP_FADDR_TIMER_RESTART(sctp, fp, - fp->rto); + fp->sf_rto); } } else { goto cum_ack_done; @@ -2223,7 +2224,7 @@ while (hmp != NULL) { hmp_next = hmp->b_next; srp = (sctp_reass_t *)DB_BASE(hmp); - if (SSN_GT(srp->ssn, ssn)) + if (SSN_GT(srp->sr_ssn, ssn)) return (dlen); /* * If we had sent part of this message up, send a partial @@ -2232,15 +2233,15 @@ * hence the ASSERT. See comments in sctp_data_chunk() for * trypartial. */ - if (srp->partial_delivered) { - if (srp->ssn != sip->nextseq) + if (srp->sr_partial_delivered) { + if (srp->sr_ssn != sip->nextseq) cmn_err(CE_WARN, "sctp partial" " delivery notify, sctp 0x%p" " sip = 0x%p ssn != nextseq" " ssn 0x%x nextseq 0x%x", (void *)sctp, (void *)sip, - srp->ssn, sip->nextseq); - ASSERT(sip->nextseq == srp->ssn); + srp->sr_ssn, sip->nextseq); + ASSERT(sip->nextseq == srp->sr_ssn); sctp_partial_delivery_event(sctp); } /* Take it out of the reass queue */ @@ -2470,15 +2471,15 @@ sctp_make_ftsns(sctp, meta, mp, &nmp, fp, &seglen); if (nmp == NULL) { sctp->sctp_adv_pap = adv_pap; - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); return; } - sctp_set_iplen(sctp, nmp, fp->ixa); - (void) conn_ip_output(nmp, fp->ixa); + sctp_set_iplen(sctp, nmp, fp->sf_ixa); + (void) conn_ip_output(nmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); } } @@ -2598,14 +2599,14 @@ fp = SCTP_CHUNK_DEST(mp); chunklen = ntohs(sdc->sdh_len); - ASSERT(fp->suna >= chunklen); - fp->suna -= chunklen; - if (fp->suna == 0) { + ASSERT(fp->sf_suna >= chunklen); + fp->sf_suna -= chunklen; + if (fp->sf_suna == 0) { /* All outstanding data acked. */ - fp->pba = 0; + fp->sf_pba = 0; SCTP_FADDR_TIMER_STOP(fp); } - fp->acked += chunklen; + fp->sf_acked += chunklen; acked += chunklen; sctp->sctp_unacked -= chunklen - sizeof (*sdc); ASSERT(sctp->sctp_unacked >= 0); @@ -2673,13 +2674,13 @@ * Entering fast recovery. */ fp = SCTP_CHUNK_DEST(mp); - fp->ssthresh = fp->cwnd / 2; - if (fp->ssthresh < 2 * fp->sfa_pmss) { - fp->ssthresh = - 2 * fp->sfa_pmss; + fp->sf_ssthresh = fp->sf_cwnd / 2; + if (fp->sf_ssthresh < 2 * fp->sf_pmss) { + fp->sf_ssthresh = + 2 * fp->sf_pmss; } - fp->cwnd = fp->ssthresh; - fp->pba = 0; + fp->sf_cwnd = fp->sf_ssthresh; + fp->sf_pba = 0; sctp->sctp_recovery_tsn = sctp->sctp_ltsn - 1; *fast_recovery = B_TRUE; @@ -2775,7 +2776,7 @@ * zero win probe via sctp_rexmit_packet(). */ if (mp != NULL && sctp->sctp_zero_win_probe && - ntohl(sc->ssc_a_rwnd) >= sctp->sctp_current->sfa_pmss) { + ntohl(sc->ssc_a_rwnd) >= sctp->sctp_current->sf_pmss) { mblk_t *pkt; uint_t pkt_len; mblk_t *mp1 = mp; @@ -2786,7 +2787,7 @@ * to send the ZWP. */ fp = sctp->sctp_current; - fp->rto = fp->srtt + 4 * fp->rttvar; + fp->sf_rto = fp->sf_srtt + 4 * fp->sf_rttvar; SCTP_MAX_RTO(sctp, fp); /* Resend the ZWP */ pkt = sctp_rexmit_packet(sctp, &meta, &mp1, fp, @@ -2795,12 +2796,12 @@ SCTP_KSTAT(sctps, sctp_ss_rexmit_failed); return (0); } - ASSERT(pkt_len <= fp->sfa_pmss); + ASSERT(pkt_len <= fp->sf_pmss); sctp->sctp_zero_win_probe = B_FALSE; sctp->sctp_rxt_nxttsn = sctp->sctp_ltsn; sctp->sctp_rxt_maxtsn = sctp->sctp_ltsn; - sctp_set_iplen(sctp, pkt, fp->ixa); - (void) conn_ip_output(pkt, fp->ixa); + sctp_set_iplen(sctp, pkt, fp->sf_ixa); + (void) conn_ip_output(pkt, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } } else { @@ -2810,7 +2811,7 @@ * to send the ZWP. */ fp = sctp->sctp_current; - fp->rto = fp->srtt + 4 * fp->rttvar; + fp->sf_rto = fp->sf_srtt + 4 * fp->sf_rttvar; SCTP_MAX_RTO(sctp, fp); sctp->sctp_zero_win_probe = B_FALSE; /* This is probably not required */ @@ -2930,13 +2931,13 @@ * Entering fast recovery. */ fp = SCTP_CHUNK_DEST(mp); - fp->ssthresh = fp->cwnd / 2; - if (fp->ssthresh < 2 * fp->sfa_pmss) { - fp->ssthresh = - 2 * fp->sfa_pmss; + fp->sf_ssthresh = fp->sf_cwnd / 2; + if (fp->sf_ssthresh < 2 * fp->sf_pmss) { + fp->sf_ssthresh = + 2 * fp->sf_pmss; } - fp->cwnd = fp->ssthresh; - fp->pba = 0; + fp->sf_cwnd = fp->sf_ssthresh; + fp->sf_pba = 0; sctp->sctp_recovery_tsn = sctp->sctp_ltsn - 1; fast_recovery = B_TRUE; @@ -2951,12 +2952,12 @@ if (SCTP_CHUNK_ISACKED(mp)) { chunklen = ntohs(sdc->sdh_len); fp = SCTP_CHUNK_DEST(mp); - fp->suna += chunklen; + fp->sf_suna += chunklen; sctp->sctp_unacked += chunklen - sizeof (*sdc); SCTP_CHUNK_CLEAR_ACKED(sctp, mp); - if (!fp->timer_running) { + if (!fp->sf_timer_running) { SCTP_FADDR_TIMER_RESTART(sctp, fp, - fp->rto); + fp->sf_rto); } } @@ -3000,14 +3001,14 @@ fp = SCTP_CHUNK_DEST(mp); chunklen = ntohs(sdc->sdh_len); - ASSERT(fp->suna >= chunklen); - fp->suna -= chunklen; - if (fp->suna == 0) { + ASSERT(fp->sf_suna >= chunklen); + fp->sf_suna -= chunklen; + if (fp->sf_suna == 0) { /* All outstanding data acked. */ - fp->pba = 0; + fp->sf_pba = 0; SCTP_FADDR_TIMER_STOP(fp); } - fp->acked += chunklen; + fp->sf_acked += chunklen; acked += chunklen; sctp->sctp_unacked -= chunklen - sizeof (*sdc); ASSERT(sctp->sctp_unacked >= 0); @@ -3086,7 +3087,7 @@ if (sctp->sctp_frwnd == 0 && sctp->sctp_unacked == 0 && sctp->sctp_unsent != 0) { SCTP_FADDR_TIMER_RESTART(sctp, sctp->sctp_current, - sctp->sctp_current->rto); + sctp->sctp_current->sf_rto); } /* @@ -3096,32 +3097,33 @@ * cwnd has been fully utilized (almost fully, need to allow * some leeway due to non-MSS sized messages). */ - if (sctp->sctp_current->acked == acked) { + if (sctp->sctp_current->sf_acked == acked) { /* * Fast-path, only data sent to sctp_current got acked. */ fp = sctp->sctp_current; if (cumack_forward && !fast_recovery && - (fp->acked + fp->suna > fp->cwnd - fp->sfa_pmss)) { - if (fp->cwnd < fp->ssthresh) { + (fp->sf_acked + fp->sf_suna > fp->sf_cwnd - fp->sf_pmss)) { + if (fp->sf_cwnd < fp->sf_ssthresh) { /* * Slow start */ - if (fp->acked > fp->sfa_pmss) { - fp->cwnd += fp->sfa_pmss; + if (fp->sf_acked > fp->sf_pmss) { + fp->sf_cwnd += fp->sf_pmss; } else { - fp->cwnd += fp->acked; + fp->sf_cwnd += fp->sf_acked; } - fp->cwnd = MIN(fp->cwnd, sctp->sctp_cwnd_max); + fp->sf_cwnd = MIN(fp->sf_cwnd, + sctp->sctp_cwnd_max); } else { /* * Congestion avoidance */ - fp->pba += fp->acked; - if (fp->pba >= fp->cwnd) { - fp->pba -= fp->cwnd; - fp->cwnd += fp->sfa_pmss; - fp->cwnd = MIN(fp->cwnd, + fp->sf_pba += fp->sf_acked; + if (fp->sf_pba >= fp->sf_cwnd) { + fp->sf_pba -= fp->sf_cwnd; + fp->sf_cwnd += fp->sf_pmss; + fp->sf_cwnd = MIN(fp->sf_cwnd, sctp->sctp_cwnd_max); } } @@ -3129,40 +3131,41 @@ /* * Limit the burst of transmitted data segments. */ - if (fp->suna + sctps->sctps_maxburst * fp->sfa_pmss < - fp->cwnd) { - fp->cwnd = fp->suna + sctps->sctps_maxburst * - fp->sfa_pmss; + if (fp->sf_suna + sctps->sctps_maxburst * fp->sf_pmss < + fp->sf_cwnd) { + fp->sf_cwnd = fp->sf_suna + sctps->sctps_maxburst * + fp->sf_pmss; } - fp->acked = 0; + fp->sf_acked = 0; goto check_ss_rxmit; } - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (cumack_forward && fp->acked && !fast_recovery && - (fp->acked + fp->suna > fp->cwnd - fp->sfa_pmss)) { - if (fp->cwnd < fp->ssthresh) { - if (fp->acked > fp->sfa_pmss) { - fp->cwnd += fp->sfa_pmss; + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (cumack_forward && fp->sf_acked && !fast_recovery && + (fp->sf_acked + fp->sf_suna > fp->sf_cwnd - fp->sf_pmss)) { + if (fp->sf_cwnd < fp->sf_ssthresh) { + if (fp->sf_acked > fp->sf_pmss) { + fp->sf_cwnd += fp->sf_pmss; } else { - fp->cwnd += fp->acked; + fp->sf_cwnd += fp->sf_acked; } - fp->cwnd = MIN(fp->cwnd, sctp->sctp_cwnd_max); + fp->sf_cwnd = MIN(fp->sf_cwnd, + sctp->sctp_cwnd_max); } else { - fp->pba += fp->acked; - if (fp->pba >= fp->cwnd) { - fp->pba -= fp->cwnd; - fp->cwnd += fp->sfa_pmss; - fp->cwnd = MIN(fp->cwnd, + fp->sf_pba += fp->sf_acked; + if (fp->sf_pba >= fp->sf_cwnd) { + fp->sf_pba -= fp->sf_cwnd; + fp->sf_cwnd += fp->sf_pmss; + fp->sf_cwnd = MIN(fp->sf_cwnd, sctp->sctp_cwnd_max); } } } - if (fp->suna + sctps->sctps_maxburst * fp->sfa_pmss < - fp->cwnd) { - fp->cwnd = fp->suna + sctps->sctps_maxburst * - fp->sfa_pmss; + if (fp->sf_suna + sctps->sctps_maxburst * fp->sf_pmss < + fp->sf_cwnd) { + fp->sf_cwnd = fp->sf_suna + sctps->sctps_maxburst * + fp->sf_pmss; } - fp->acked = 0; + fp->sf_acked = 0; } fp = sctp->sctp_current; check_ss_rxmit: @@ -3183,14 +3186,14 @@ * missing. */ if (cumack_forward) { - fp->rxt_unacked -= acked; + fp->sf_rxt_unacked -= acked; sctp_ss_rexmit(sctp); } } else { sctp->sctp_rexmitting = B_FALSE; sctp->sctp_rxt_nxttsn = sctp->sctp_ltsn; sctp->sctp_rxt_maxtsn = sctp->sctp_ltsn; - fp->rxt_unacked = 0; + fp->sf_rxt_unacked = 0; } } return (trysend); @@ -3580,8 +3583,15 @@ SCTPS_BUMP_MIB(sctps, sctpAborted); BUMP_LOCAL(sctp->sctp_ibchunks); - sctp_assoc_event(sctp, SCTP_COMM_LOST, - ntohs(((sctp_parm_hdr_t *)(ch + 1))->sph_type), ch); + /* + * SCTP_COMM_LOST is only sent up if the association is + * established (sctp_state >= SCTPS_ESTABLISHED). + */ + if (sctp->sctp_state >= SCTPS_ESTABLISHED) { + sctp_assoc_event(sctp, SCTP_COMM_LOST, + ntohs(((sctp_parm_hdr_t *)(ch + 1))->sph_type), ch); + } + sctp_clean_death(sctp, err); } @@ -3814,7 +3824,7 @@ goto done; } SCTP_FADDR_TIMER_RESTART(sctp, fp, - fp->rto); + fp->sf_rto); } break; case CHUNK_SACK: @@ -4375,10 +4385,10 @@ * If there is unsent data, make sure a timer is running, check * timer_mp, if sctp_closei_local() ran the timers may be free. */ - if (sctp->sctp_unsent > 0 && !sctp->sctp_current->timer_running && - sctp->sctp_current->timer_mp != NULL) { + if (sctp->sctp_unsent > 0 && !sctp->sctp_current->sf_timer_running && + sctp->sctp_current->sf_timer_mp != NULL) { SCTP_FADDR_TIMER_RESTART(sctp, sctp->sctp_current, - sctp->sctp_current->rto); + sctp->sctp_current->sf_rto); } done:
--- a/usr/src/uts/common/inet/sctp/sctp_notify.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_notify.c Tue Aug 03 22:50:37 2010 -0700 @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/types.h> @@ -77,14 +76,14 @@ /* * Fill in primary remote address. */ - if (IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + if (IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { struct sockaddr_in *sin4; tudi->SRC_length = sizeof (*sin4); sin4 = (struct sockaddr_in *)(tudi + 1); sin4->sin_family = AF_INET; sin4->sin_port = connp->conn_fport; - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, sin4->sin_addr.s_addr); + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, sin4->sin_addr.s_addr); mp->b_wptr = (uchar_t *)(sin4 + 1); } else { struct sockaddr_in6 *sin6; @@ -93,7 +92,7 @@ sin6 = (struct sockaddr_in6 *)(tudi + 1); sin6->sin6_family = AF_INET6; sin6->sin6_port = connp->conn_fport; - sin6->sin6_addr = fp->faddr; + sin6->sin6_addr = fp->sf_faddr; mp->b_wptr = (uchar_t *)(sin6 + 1); }
--- a/usr/src/uts/common/inet/sctp/sctp_opt_data.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_opt_data.c Tue Aug 03 22:50:37 2010 -0700 @@ -82,25 +82,25 @@ } fp = sctp->sctp_primary; - if (fp->isv4) { + if (fp->sf_isv4) { sin = (struct sockaddr_in *)&sp->spinfo_address; sin->sin_family = AF_INET; sin->sin_port = connp->conn_fport; - IN6_V4MAPPED_TO_INADDR(&fp->faddr, &sin->sin_addr); + IN6_V4MAPPED_TO_INADDR(&fp->sf_faddr, &sin->sin_addr); sp->spinfo_mtu = sctp->sctp_hdr_len; } else { sin6 = (struct sockaddr_in6 *)&sp->spinfo_address; sin6->sin6_family = AF_INET6; sin6->sin6_port = connp->conn_fport; - sin6->sin6_addr = fp->faddr; + sin6->sin6_addr = fp->sf_faddr; sp->spinfo_mtu = sctp->sctp_hdr6_len; } - sp->spinfo_state = fp->state == SCTP_FADDRS_ALIVE ? SCTP_ACTIVE : + sp->spinfo_state = fp->sf_state == SCTP_FADDRS_ALIVE ? SCTP_ACTIVE : SCTP_INACTIVE; - sp->spinfo_cwnd = fp->cwnd; - sp->spinfo_srtt = fp->srtt; - sp->spinfo_rto = fp->rto; - sp->spinfo_mtu += fp->sfa_pmss; + sp->spinfo_cwnd = fp->sf_cwnd; + sp->spinfo_srtt = fp->sf_srtt; + sp->spinfo_rto = fp->sf_rto; + sp->spinfo_mtu += fp->sf_pmss; noprim: sstat->sstat_unackdata = 0; @@ -173,12 +173,12 @@ if ((fp = sctp_lookup_faddr(sctp, &faddr)) == NULL) return (EINVAL); - infop->spinfo_state = (fp->state == SCTP_FADDRS_ALIVE) ? SCTP_ACTIVE : - SCTP_INACTIVE; - infop->spinfo_cwnd = fp->cwnd; - infop->spinfo_srtt = TICK_TO_MSEC(fp->srtt); - infop->spinfo_rto = TICK_TO_MSEC(fp->rto); - infop->spinfo_mtu = fp->sfa_pmss; + infop->spinfo_state = (fp->sf_state == SCTP_FADDRS_ALIVE) ? + SCTP_ACTIVE : SCTP_INACTIVE; + infop->spinfo_cwnd = fp->sf_cwnd; + infop->spinfo_srtt = TICK_TO_MSEC(fp->sf_srtt); + infop->spinfo_rto = TICK_TO_MSEC(fp->sf_rto); + infop->spinfo_mtu = fp->sf_pmss; *optlen = sizeof (struct sctp_paddrinfo); return (0); @@ -268,7 +268,7 @@ /* * Count the number of peer addresses */ - for (i = 0, fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (i = 0, fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { i++; } sap->sasoc_number_peer_destinations = i; @@ -293,8 +293,8 @@ * Bounds check: as per rfc2960, assoc max retr cannot * exceed the sum of all individual path max retr's. */ - for (fp = sctp->sctp_faddrs; fp; fp = fp->next) { - sum += fp->max_retr; + for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) { + sum += fp->sf_max_retr; } if (sap->sasoc_asocmaxrxt > sum) { return (EINVAL); @@ -439,8 +439,8 @@ return (retval); } if (fp) { - spp->spp_hbinterval = TICK_TO_MSEC(fp->hb_interval); - spp->spp_pathmaxrxt = fp->max_retr; + spp->spp_hbinterval = TICK_TO_MSEC(fp->sf_hb_interval); + spp->spp_pathmaxrxt = fp->sf_max_retr; } else { spp->spp_hbinterval = TICK_TO_MSEC(sctp->sctp_hb_interval); spp->spp_pathmaxrxt = sctp->sctp_pp_max_rxt; @@ -474,11 +474,11 @@ return (EINVAL); } if (spp->spp_pathmaxrxt && sctp->sctp_faddrs) { - for (fp2 = sctp->sctp_faddrs; fp2; fp2 = fp2->next) { + for (fp2 = sctp->sctp_faddrs; fp2; fp2 = fp2->sf_next) { if (!fp || fp2 == fp) { sum += spp->spp_pathmaxrxt; } else { - sum += fp2->max_retr; + sum += fp2->sf_max_retr; } } if (sctp->sctp_pa_max_rxt > sum) { @@ -495,8 +495,8 @@ */ sctp_send_heartbeat(sctp, fp); } else { - fp->hb_interval = MSEC_TO_TICK(spp->spp_hbinterval); - fp->hb_expiry = now + SET_HB_INTVL(fp); + fp->sf_hb_interval = MSEC_TO_TICK(spp->spp_hbinterval); + fp->sf_hb_expiry = now + SET_HB_INTVL(fp); /* * Restart the heartbeat timer using the new intrvl. * We need to call sctp_heartbeat_timer() to set @@ -505,10 +505,10 @@ sctp_heartbeat_timer(sctp); } if (spp->spp_pathmaxrxt) { - fp->max_retr = spp->spp_pathmaxrxt; + fp->sf_max_retr = spp->spp_pathmaxrxt; } } else { - for (fp2 = sctp->sctp_faddrs; fp2 != NULL; fp2 = fp2->next) { + for (fp2 = sctp->sctp_faddrs; fp2 != NULL; fp2 = fp2->sf_next) { if (spp->spp_hbinterval == UINT32_MAX) { /* * Send heartbeat immediatelly, don't modify @@ -516,12 +516,12 @@ */ sctp_send_heartbeat(sctp, fp2); } else { - fp2->hb_interval = MSEC_TO_TICK( + fp2->sf_hb_interval = MSEC_TO_TICK( spp->spp_hbinterval); - fp2->hb_expiry = now + SET_HB_INTVL(fp2); + fp2->sf_hb_expiry = now + SET_HB_INTVL(fp2); } if (spp->spp_pathmaxrxt) { - fp2->max_retr = spp->spp_pathmaxrxt; + fp2->sf_max_retr = spp->spp_pathmaxrxt; } } if (spp->spp_hbinterval != UINT32_MAX) { @@ -594,7 +594,7 @@ sctp->sctp_primary = fp; /* Only switch current if fp is alive */ - if (fp->state != SCTP_FADDRS_ALIVE || fp == sctp->sctp_current) { + if (fp->sf_state != SCTP_FADDRS_ALIVE || fp == sctp->sctp_current) { return (0); } sctp_set_faddr_current(sctp, fp); @@ -901,7 +901,7 @@ sctp_faddr_t *fp; for (i = 0, fp = sctp->sctp_faddrs; fp != NULL; - i++, fp = fp->next) + i++, fp = fp->sf_next) ; *(int32_t *)ptr = i; break; @@ -1331,7 +1331,7 @@ * We recache the information which might pick a different * source and redo IPsec as a result. */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) sctp_get_dest(sctp, fp); } if (coas.coa_changed & COA_HEADER_CHANGED) { @@ -1477,7 +1477,7 @@ /* If we want only one, give the primary */ if (max == 1) { - addr = sctp->sctp_primary->faddr; + addr = sctp->sctp_primary->sf_faddr; switch (family) { case AF_INET: sin4 = paddrs; @@ -1494,10 +1494,10 @@ sin6->sin6_flowinfo = connp->conn_flowinfo; if (IN6_IS_ADDR_LINKSCOPE(&addr) && sctp->sctp_primary != NULL && - (sctp->sctp_primary->ixa->ixa_flags & + (sctp->sctp_primary->sf_ixa->ixa_flags & IXAF_SCOPEID_SET)) { sin6->sin6_scope_id = - sctp->sctp_primary->ixa->ixa_scopeid; + sctp->sctp_primary->sf_ixa->ixa_scopeid; } else { sin6->sin6_scope_id = 0; } @@ -1507,8 +1507,8 @@ return (0); } - for (cnt = 0; cnt < max && fp != NULL; cnt++, fp = fp->next) { - addr = fp->faddr; + for (cnt = 0; cnt < max && fp != NULL; cnt++, fp = fp->sf_next) { + addr = fp->sf_faddr; switch (family) { case AF_INET: ASSERT(IN6_IS_ADDR_V4MAPPED(&addr)); @@ -1524,8 +1524,8 @@ sin6->sin6_family = AF_INET6; sin6->sin6_flowinfo = connp->conn_flowinfo; if (IN6_IS_ADDR_LINKSCOPE(&addr) && - (fp->ixa->ixa_flags & IXAF_SCOPEID_SET)) - sin6->sin6_scope_id = fp->ixa->ixa_scopeid; + (fp->sf_ixa->ixa_flags & IXAF_SCOPEID_SET)) + sin6->sin6_scope_id = fp->sf_ixa->ixa_scopeid; else sin6->sin6_scope_id = 0; sin6->__sin6_src_id = 0;
--- a/usr/src/uts/common/inet/sctp/sctp_output.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_output.c Tue Aug 03 22:50:37 2010 -0700 @@ -342,7 +342,7 @@ fp = SCTP_CHUNK_DEST(mdblk); if (fp == NULL) fp = sctp->sctp_current; - if (fp->isv4) + if (fp->sf_isv4) xtralen = sctp->sctp_hdr_len + sctps->sctps_wroff_xtra + sizeof (*sdc); else @@ -377,10 +377,10 @@ while (mp->b_next != NULL) mp = mp->b_next; chunk_len = ntohs(((sctp_data_hdr_t *)mp->b_rptr)->sdh_len); - if (fp->sfa_pmss - chunk_len > sizeof (*sdc)) - count = chunksize = fp->sfa_pmss - chunk_len; + if (fp->sf_pmss - chunk_len > sizeof (*sdc)) + count = chunksize = fp->sf_pmss - chunk_len; else - count = chunksize = fp->sfa_pmss; + count = chunksize = fp->sf_pmss; count = chunksize = count - sizeof (*sdc); } else { msg_hdr = (sctp_msg_hdr_t *)mdblk->b_rptr; @@ -499,7 +499,7 @@ bytes_to_send -= (chunksize - count); if (chunk_mp != NULL) { next: - count = chunksize = fp->sfa_pmss - sizeof (*sdc); + count = chunksize = fp->sf_pmss - sizeof (*sdc); goto nextchunk; } SCTP_DATA_SET_EBIT(sdc); @@ -527,21 +527,21 @@ if (fp == fp1) { size_t len = MBLKL(mdblk->b_cont); if ((count > 0) && - ((len > fp->sfa_pmss - sizeof (*sdc)) || + ((len > fp->sf_pmss - sizeof (*sdc)) || (len <= count))) { count -= sizeof (*sdc); count = chunksize = count - (count & 0x3); } else { - count = chunksize = fp->sfa_pmss - + count = chunksize = fp->sf_pmss - sizeof (*sdc); } } else { - if (fp1->isv4) + if (fp1->sf_isv4) xtralen = sctp->sctp_hdr_len; else xtralen = sctp->sctp_hdr6_len; xtralen += sctps->sctps_wroff_xtra + sizeof (*sdc); - count = chunksize = fp1->sfa_pmss - sizeof (*sdc); + count = chunksize = fp1->sf_pmss - sizeof (*sdc); fp = fp1; } goto nextmsg; @@ -570,7 +570,7 @@ { int hdrlen; uchar_t *hdr; - int isv4 = fp->isv4; + int isv4 = fp->sf_isv4; sctp_stack_t *sctps = sctp->sctp_sctps; if (error != NULL) @@ -586,18 +586,18 @@ /* * A reject|blackhole could mean that the address is 'down'. Similarly, * it is possible that the address went down, we tried to send an - * heartbeat and ended up setting fp->saddr as unspec because we + * heartbeat and ended up setting fp->sf_saddr as unspec because we * didn't have any usable source address. In either case * sctp_get_dest() will try find an IRE, if available, and set * the source address, if needed. If we still don't have any - * usable source address, fp->state will be SCTP_FADDRS_UNREACH and + * usable source address, fp->sf_state will be SCTP_FADDRS_UNREACH and * we return EHOSTUNREACH. */ - ASSERT(fp->ixa->ixa_ire != NULL); - if ((fp->ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE)) || - SCTP_IS_ADDR_UNSPEC(fp->isv4, fp->saddr)) { + ASSERT(fp->sf_ixa->ixa_ire != NULL); + if ((fp->sf_ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE)) || + SCTP_IS_ADDR_UNSPEC(fp->sf_isv4, fp->sf_saddr)) { sctp_get_dest(sctp, fp); - if (fp->state == SCTP_FADDRS_UNREACH) { + if (fp->sf_state == SCTP_FADDRS_UNREACH) { if (error != NULL) *error = EHOSTUNREACH; return (NULL); @@ -636,9 +636,9 @@ if (isv4) { ipha_t *iph = (ipha_t *)mp->b_rptr; - IN6_V4MAPPED_TO_IPADDR(&fp->faddr, iph->ipha_dst); - if (!IN6_IS_ADDR_V4MAPPED_ANY(&fp->saddr)) { - IN6_V4MAPPED_TO_IPADDR(&fp->saddr, + IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, iph->ipha_dst); + if (!IN6_IS_ADDR_V4MAPPED_ANY(&fp->sf_saddr)) { + IN6_V4MAPPED_TO_IPADDR(&fp->sf_saddr, iph->ipha_src); } else if (sctp->sctp_bound_to_all) { iph->ipha_src = INADDR_ANY; @@ -646,9 +646,9 @@ } else { ip6_t *ip6h = (ip6_t *)mp->b_rptr; - ip6h->ip6_dst = fp->faddr; - if (!IN6_IS_ADDR_UNSPECIFIED(&fp->saddr)) { - ip6h->ip6_src = fp->saddr; + ip6h->ip6_dst = fp->sf_faddr; + if (!IN6_IS_ADDR_UNSPECIFIED(&fp->sf_saddr)) { + ip6h->ip6_src = fp->sf_saddr; } else if (sctp->sctp_bound_to_all) { ip6h->ip6_src = ipv6_all_zeros; } @@ -723,7 +723,8 @@ chunk_fp = SCTP_CHUNK_DEST(mp); if (*fp == NULL) { *fp = chunk_fp; - if ((*fp)->state != SCTP_FADDRS_ALIVE) { + if ((*fp)->sf_state != + SCTP_FADDRS_ALIVE) { old_fp = *fp; *fp = sctp->sctp_current; } @@ -746,7 +747,7 @@ * PMTU may have changed. */ if (*total + msglen + extra > - (*fp)->sfa_pmss && start_mp != NULL) { + (*fp)->sf_pmss && start_mp != NULL) { return (start_mp); } if ((nmp = dupmsg(mp)) == NULL) @@ -807,7 +808,7 @@ * the unsent list, if any, and also as an input to sctp_chunkify() if so. * * firstseg_len indicates the space already used, cansend represents remaining - * space in the window, ((sfa_pmss - firstseg_len) can therefore reasonably + * space in the window, ((sf_pmss - firstseg_len) can therefore reasonably * be used to compute the cansend arg). */ mblk_t * @@ -906,19 +907,19 @@ ASSERT(sctp->sctp_unsent > 0); if (fp == NULL) { fp = SCTP_CHUNK_DEST(sctp->sctp_xmit_unsent); - if (fp == NULL || fp->state != SCTP_FADDRS_ALIVE) + if (fp == NULL || fp->sf_state != SCTP_FADDRS_ALIVE) fp = sctp->sctp_current; } else { /* * If user specified destination, try to honor that. */ fp1 = SCTP_CHUNK_DEST(sctp->sctp_xmit_unsent); - if (fp1 != NULL && fp1->state == SCTP_FADDRS_ALIVE && + if (fp1 != NULL && fp1->sf_state == SCTP_FADDRS_ALIVE && fp1 != fp) { goto chunk_done; } } - meta = sctp_chunkify(sctp, fp->sfa_pmss, firstseg_len, cansend); + meta = sctp_chunkify(sctp, fp->sf_pmss, firstseg_len, cansend); if (meta == NULL) goto chunk_done; /* @@ -969,16 +970,16 @@ SCTP_KSTAT(sctps, sctp_fr_add_hdr); return; } - if ((pktlen > fp->sfa_pmss) && fp->isv4) { + if ((pktlen > fp->sf_pmss) && fp->sf_isv4) { ipha_t *iph = (ipha_t *)head->b_rptr; iph->ipha_fragment_offset_and_flags = 0; } - sctp_set_iplen(sctp, head, fp->ixa); - (void) conn_ip_output(head, fp->ixa); + sctp_set_iplen(sctp, head, fp->sf_ixa); + (void) conn_ip_output(head, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); - sctp->sctp_active = fp->lastactive = ddi_get_lbolt64(); + sctp->sctp_active = fp->sf_lastactive = ddi_get_lbolt64(); } void @@ -1015,7 +1016,7 @@ (sizeof (sctp_sack_frag_t) * sctp->sctp_sack_gaps); lfp = sctp->sctp_lastdata; ASSERT(lfp != NULL); - if (lfp->state != SCTP_FADDRS_ALIVE) + if (lfp->sf_state != SCTP_FADDRS_ALIVE) lfp = sctp->sctp_current; } @@ -1028,9 +1029,9 @@ * trying to send into a zero window. This timer * ensures the blocked send attempt is retried. */ - if ((cansend < sctp->sctp_current->sfa_pmss / 2) && + if ((cansend < sctp->sctp_current->sf_pmss / 2) && (sctp->sctp_unacked != 0) && - (sctp->sctp_unacked < sctp->sctp_current->sfa_pmss) && + (sctp->sctp_unacked < sctp->sctp_current->sf_pmss) && !sctp->sctp_ndelay || (cansend == 0 && sctp->sctp_unacked == 0 && sctp->sctp_unsent != 0)) { @@ -1074,7 +1075,7 @@ if (chunklen > cansend) { head = NULL; fp = SCTP_CHUNK_DEST(meta); - if (fp == NULL || fp->state != SCTP_FADDRS_ALIVE) + if (fp == NULL || fp->sf_state != SCTP_FADDRS_ALIVE) fp = sctp->sctp_current; goto unsent_data; } @@ -1084,13 +1085,14 @@ /* * Pick destination address, and check cwnd. */ - if (sacklen > 0 && (seglen + extra <= lfp->cwnd - lfp->suna) && - (seglen + sacklen + extra <= lfp->sfa_pmss)) { + if (sacklen > 0 && (seglen + extra <= lfp->sf_cwnd - + lfp->sf_suna) && + (seglen + sacklen + extra <= lfp->sf_pmss)) { /* * Only include SACK chunk if it can be bundled * with a data chunk, and sent to sctp_lastdata. */ - pathmax = lfp->cwnd - lfp->suna; + pathmax = lfp->sf_cwnd - lfp->sf_suna; fp = lfp; if ((nmp = dupmsg(mp)) == NULL) { @@ -1124,18 +1126,18 @@ sacklen = 0; } else { fp = SCTP_CHUNK_DEST(meta); - if (fp == NULL || fp->state != SCTP_FADDRS_ALIVE) + if (fp == NULL || fp->sf_state != SCTP_FADDRS_ALIVE) fp = sctp->sctp_current; /* * If we haven't sent data to this destination for * a while, do slow start again. */ - if (now - fp->lastactive > fp->rto) { - SET_CWND(fp, fp->sfa_pmss, + if (now - fp->sf_lastactive > fp->sf_rto) { + SET_CWND(fp, fp->sf_pmss, sctps->sctps_slow_start_after_idle); } - pathmax = fp->cwnd - fp->suna; + pathmax = fp->sf_cwnd - fp->sf_suna; if (seglen + extra > pathmax) { head = NULL; goto unsent_data; @@ -1166,9 +1168,9 @@ goto unsent_data; } } - fp->lastactive = now; - if (pathmax > fp->sfa_pmss) - pathmax = fp->sfa_pmss; + fp->sf_lastactive = now; + if (pathmax > fp->sf_pmss) + pathmax = fp->sf_pmss; SCTP_CHUNK_SENT(sctp, mp, sdc, fp, chunklen, meta); mp = mp->b_next; @@ -1258,7 +1260,7 @@ linkb(head, nmp); mp = mp->b_next; } - if ((seglen > fp->sfa_pmss) && fp->isv4) { + if ((seglen > fp->sf_pmss) && fp->sf_isv4) { ipha_t *iph = (ipha_t *)head->b_rptr; /* @@ -1276,20 +1278,20 @@ seglen - xtralen, ntohl(sdc->sdh_tsn), ntohs(sdc->sdh_ssn), (void *)fp, sctp->sctp_frwnd, cansend, sctp->sctp_lastack_rxd)); - sctp_set_iplen(sctp, head, fp->ixa); - (void) conn_ip_output(head, fp->ixa); + sctp_set_iplen(sctp, head, fp->sf_ixa); + (void) conn_ip_output(head, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); /* arm rto timer (if not set) */ - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); notsent = B_FALSE; } sctp->sctp_active = now; return; unsent_data: /* arm persist timer (if rto timer not set) */ - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); if (head != NULL) freemsg(head); } @@ -1333,7 +1335,7 @@ * entry for stream id, sid, for this message already exists, the * sequence number, ssn, is updated if it is greater than the existing * one. If an entry for this sid does not exist, one is created if - * the size does not exceed fp->sfa_pmss. We return false in case + * the size does not exceed fp->sf_pmss. We return false in case * or an error. */ boolean_t @@ -1350,7 +1352,7 @@ ASSERT((*nsets == 0 && *s == NULL) || (*nsets > 0 && *s != NULL)); if (*s == NULL) { - ASSERT((*slen + sizeof (uint32_t)) <= fp->sfa_pmss); + ASSERT((*slen + sizeof (uint32_t)) <= fp->sf_pmss); *s = kmem_cache_alloc(sctp_kmem_ftsn_set_cache, KM_NOSLEEP); if (*s == NULL) return (B_FALSE); @@ -1373,7 +1375,7 @@ if (SSN_GT(ssn, p->ftsn_entries.ftsn_ssn)) p->ftsn_entries.ftsn_ssn = ssn; } else { - if ((*slen + sizeof (uint32_t)) > fp->sfa_pmss) + if ((*slen + sizeof (uint32_t)) > fp->sf_pmss) return (B_FALSE); p->next = kmem_cache_alloc(sctp_kmem_ftsn_set_cache, KM_NOSLEEP); @@ -1408,7 +1410,7 @@ sctp_stack_t *sctps = sctp->sctp_sctps; seglen += sizeof (sctp_chunk_hdr_t); - if (fp->isv4) + if (fp->sf_isv4) xtralen = sctp->sctp_hdr_len + sctps->sctps_wroff_xtra; else xtralen = sctp->sctp_hdr6_len + sctps->sctps_wroff_xtra; @@ -1515,7 +1517,7 @@ sacklen = sizeof (sctp_chunk_hdr_t) + sizeof (sctp_sack_chunk_t) + (sizeof (sctp_sack_frag_t) * sctp->sctp_sack_gaps); - if (*seglen + sacklen > sctp->sctp_lastdata->sfa_pmss) { + if (*seglen + sacklen > sctp->sctp_lastdata->sf_pmss) { /* piggybacked SACK doesn't fit */ sacklen = 0; } else { @@ -1755,8 +1757,8 @@ * Send a window probe. Inflate frwnd to allow * sending one segment. */ - if (sctp->sctp_frwnd < (oldfp->sfa_pmss - sizeof (*sdc))) - sctp->sctp_frwnd = oldfp->sfa_pmss - sizeof (*sdc); + if (sctp->sctp_frwnd < (oldfp->sf_pmss - sizeof (*sdc))) + sctp->sctp_frwnd = oldfp->sf_pmss - sizeof (*sdc); /* next TSN to send */ sctp->sctp_rxt_nxttsn = sctp->sctp_ltsn; @@ -1780,7 +1782,7 @@ * After a time out, assume that everything has left the network. So * we can clear rxt_unacked for the original peer address. */ - oldfp->rxt_unacked = 0; + oldfp->sf_rxt_unacked = 0; /* * If we were probing for zero window, don't adjust retransmission @@ -1795,13 +1797,13 @@ * and sctp_rxt_maxtsn will specify the ZWP packet. */ fp = oldfp; - if (oldfp->state != SCTP_FADDRS_ALIVE) + if (oldfp->sf_state != SCTP_FADDRS_ALIVE) fp = sctp_rotate_faddr(sctp, oldfp); pkt = sctp_rexmit_packet(sctp, &meta, &mp, fp, &pkt_len); if (pkt != NULL) { - ASSERT(pkt_len <= fp->sfa_pmss); - sctp_set_iplen(sctp, pkt, fp->ixa); - (void) conn_ip_output(pkt, fp->ixa); + ASSERT(pkt_len <= fp->sf_pmss); + sctp_set_iplen(sctp, pkt, fp->sf_ixa); + (void) conn_ip_output(pkt, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } else { SCTP_KSTAT(sctps, sctp_ss_rexmit_failed); @@ -1811,13 +1813,13 @@ * The strikes will be clear by sctp_faddr_alive() when the * other side sends us an ack. */ - oldfp->strikes++; + oldfp->sf_strikes++; sctp->sctp_strikes++; SCTP_CALC_RXT(sctp, oldfp, sctp->sctp_rto_max); - if (oldfp != fp && oldfp->suna != 0) - SCTP_FADDR_TIMER_RESTART(sctp, oldfp, fp->rto); - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (oldfp != fp && oldfp->sf_suna != 0) + SCTP_FADDR_TIMER_RESTART(sctp, oldfp, fp->sf_rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); SCTPS_BUMP_MIB(sctps, sctpOutWinProbe); return; } @@ -1825,11 +1827,11 @@ /* * Enter slowstart for this destination */ - oldfp->ssthresh = oldfp->cwnd / 2; - if (oldfp->ssthresh < 2 * oldfp->sfa_pmss) - oldfp->ssthresh = 2 * oldfp->sfa_pmss; - oldfp->cwnd = oldfp->sfa_pmss; - oldfp->pba = 0; + oldfp->sf_ssthresh = oldfp->sf_cwnd / 2; + if (oldfp->sf_ssthresh < 2 * oldfp->sf_pmss) + oldfp->sf_ssthresh = 2 * oldfp->sf_pmss; + oldfp->sf_cwnd = oldfp->sf_pmss; + oldfp->sf_pba = 0; fp = sctp_rotate_faddr(sctp, oldfp); ASSERT(fp != NULL); sdc = (sctp_data_hdr_t *)mp->b_rptr; @@ -1866,7 +1868,7 @@ sacklen = sizeof (sctp_chunk_hdr_t) + sizeof (sctp_sack_chunk_t) + (sizeof (sctp_sack_frag_t) * sctp->sctp_sack_gaps); - if (seglen + sacklen > sctp->sctp_lastdata->sfa_pmss) { + if (seglen + sacklen > sctp->sctp_lastdata->sf_pmss) { /* piggybacked SACK doesn't fit */ sacklen = 0; } else { @@ -1879,7 +1881,8 @@ * the fp is alive. */ if (sctp->sctp_lastdata != oldfp && - sctp->sctp_lastdata->state == SCTP_FADDRS_ALIVE) { + sctp->sctp_lastdata->sf_state == + SCTP_FADDRS_ALIVE) { fp = sctp->sctp_lastdata; } } @@ -1894,8 +1897,8 @@ sctp->sctp_out_time = 0; } /* Clear the counter as the RTT calculation may be off. */ - fp->rtt_updates = 0; - oldfp->rtt_updates = 0; + fp->sf_rtt_updates = 0; + oldfp->sf_rtt_updates = 0; /* * After a timeout, we should change the current faddr so that @@ -1931,7 +1934,7 @@ try_bundle: /* We can at least and at most send 1 packet at timeout. */ - while (seglen < fp->sfa_pmss) { + while (seglen < fp->sf_pmss) { int32_t new_len; /* Go through the list to find more chunks to be bundled. */ @@ -1961,7 +1964,7 @@ * could be bundled with this retransmission. */ meta = sctp_get_msg_to_send(sctp, &mp, NULL, &error, - seglen, fp->sfa_pmss - seglen, NULL); + seglen, fp->sf_pmss - seglen, NULL); if (error != 0 || meta == NULL) { /* No more chunk to be bundled. */ break; @@ -1976,7 +1979,7 @@ if ((extra = new_len & (SCTP_ALIGN - 1)) != 0) extra = SCTP_ALIGN - extra; - if ((new_len = seglen + new_len + extra) > fp->sfa_pmss) + if ((new_len = seglen + new_len + extra) > fp->sf_pmss) break; if ((nmp = dupmsg(mp)) == NULL) break; @@ -1999,7 +2002,7 @@ mp = mp->b_next; } done_bundle: - if ((seglen > fp->sfa_pmss) && fp->isv4) { + if ((seglen > fp->sf_pmss) && fp->sf_isv4) { ipha_t *iph = (ipha_t *)head->b_rptr; /* @@ -2009,7 +2012,7 @@ */ iph->ipha_fragment_offset_and_flags = 0; } - fp->rxt_unacked += seglen; + fp->sf_rxt_unacked += seglen; dprint(2, ("sctp_rexmit: Sending packet %d bytes, tsn %x " "ssn %d to %p (rwnd %d, lastack_rxd %x)\n", @@ -2019,8 +2022,8 @@ sctp->sctp_rexmitting = B_TRUE; sctp->sctp_rxt_nxttsn = first_ua_tsn; sctp->sctp_rxt_maxtsn = sctp->sctp_ltsn - 1; - sctp_set_iplen(sctp, head, fp->ixa); - (void) conn_ip_output(head, fp->ixa); + sctp_set_iplen(sctp, head, fp->sf_ixa); + (void) conn_ip_output(head, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); /* @@ -2028,7 +2031,7 @@ * the new fp timer for the retransmitted chunks. */ restart_timer: - oldfp->strikes++; + oldfp->sf_strikes++; sctp->sctp_strikes++; SCTP_CALC_RXT(sctp, oldfp, sctp->sctp_rto_max); /* @@ -2037,8 +2040,8 @@ * continue to run so it will do its job in checking the reachability * of the oldfp. */ - if (oldfp != fp && oldfp->suna != 0) - SCTP_FADDR_TIMER_RESTART(sctp, oldfp, oldfp->rto); + if (oldfp != fp && oldfp->sf_suna != 0) + SCTP_FADDR_TIMER_RESTART(sctp, oldfp, oldfp->sf_rto); /* * Should we restart the timer of the new fp? If there is @@ -2053,7 +2056,7 @@ * is the chunk we just retransmitted. So for now, let's * be conservative and restart the timer of the new fp. */ - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); sctp->sctp_active = ddi_get_lbolt64(); } @@ -2114,7 +2117,7 @@ *mp = (*mp)->b_next; try_bundle: - while (seglen < fp->sfa_pmss) { + while (seglen < fp->sf_pmss) { int32_t new_len; /* @@ -2157,7 +2160,7 @@ if ((extra = new_len & (SCTP_ALIGN - 1)) != 0) extra = SCTP_ALIGN - extra; - if ((new_len = seglen + new_len + extra) > fp->sfa_pmss) + if ((new_len = seglen + new_len + extra) > fp->sf_pmss) break; if ((nmp = dupmsg(*mp)) == NULL) break; @@ -2185,7 +2188,7 @@ *mp = (*mp)->b_next; } *packet_len = seglen; - fp->rxt_unacked += seglen; + fp->sf_rxt_unacked += seglen; return (head); } @@ -2258,10 +2261,10 @@ * retransmission, we skip this walk to save some time. This should * not make the retransmission too aggressive to cause congestion. */ - if (fp->cwnd <= fp->rxt_unacked) - tot_wnd = fp->sfa_pmss; + if (fp->sf_cwnd <= fp->sf_rxt_unacked) + tot_wnd = fp->sf_pmss; else - tot_wnd = fp->cwnd - fp->rxt_unacked; + tot_wnd = fp->sf_cwnd - fp->sf_rxt_unacked; /* Find the first unack'ed chunk */ for (meta = sctp->sctp_xmit_head; meta != NULL; meta = meta->b_next) { @@ -2286,14 +2289,14 @@ return; found_msg: - if (!fp->timer_running) - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + if (!fp->sf_timer_running) + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); pkt = sctp_rexmit_packet(sctp, &meta, &mp, fp, &pkt_len); if (pkt == NULL) { SCTP_KSTAT(sctps, sctp_ss_rexmit_failed); return; } - if ((pkt_len > fp->sfa_pmss) && fp->isv4) { + if ((pkt_len > fp->sf_pmss) && fp->sf_isv4) { ipha_t *iph = (ipha_t *)pkt->b_rptr; /* @@ -2303,12 +2306,12 @@ */ iph->ipha_fragment_offset_and_flags = 0; } - sctp_set_iplen(sctp, pkt, fp->ixa); - (void) conn_ip_output(pkt, fp->ixa); + sctp_set_iplen(sctp, pkt, fp->sf_ixa); + (void) conn_ip_output(pkt, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); /* Check and see if there is more chunk to be retransmitted. */ - if (tot_wnd <= pkt_len || tot_wnd - pkt_len < fp->sfa_pmss || + if (tot_wnd <= pkt_len || tot_wnd - pkt_len < fp->sf_pmss || meta == NULL) return; if (mp == NULL)
--- a/usr/src/uts/common/inet/sctp/sctp_shutdown.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_shutdown.c Tue Aug 03 22:50:37 2010 -0700 @@ -132,14 +132,14 @@ BUMP_LOCAL(sctp->sctp_obchunks); /* Send the shutdown and restart the timer */ - sctp_set_iplen(sctp, sendmp, fp->ixa); - (void) conn_ip_output(sendmp, fp->ixa); + sctp_set_iplen(sctp, sendmp, fp->sf_ixa); + (void) conn_ip_output(sendmp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); done: sctp->sctp_state = SCTPS_SHUTDOWN_SENT; SCTP_FADDR_TIMER_RESTART(sctp, sctp->sctp_current, - sctp->sctp_current->rto); + sctp->sctp_current->sf_rto); } int @@ -211,8 +211,8 @@ BUMP_LOCAL(sctp->sctp_obchunks); - sctp_set_iplen(sctp, scmp, sctp->sctp_current->ixa); - (void) conn_ip_output(scmp, sctp->sctp_current->ixa); + sctp_set_iplen(sctp, scmp, sctp->sctp_current->sf_ixa); + (void) conn_ip_output(scmp, sctp->sctp_current->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } @@ -405,11 +405,11 @@ BUMP_LOCAL(sctp->sctp_obchunks); - sctp_set_iplen(sctp, samp, fp->ixa); - (void) conn_ip_output(samp, fp->ixa); + sctp_set_iplen(sctp, samp, fp->sf_ixa); + (void) conn_ip_output(samp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); dotimer: sctp->sctp_state = SCTPS_SHUTDOWN_ACK_SENT; - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); }
--- a/usr/src/uts/common/inet/sctp/sctp_snmp.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_snmp.c Tue Aug 03 22:50:37 2010 -0700 @@ -664,17 +664,17 @@ if (sctp->sctp_primary != NULL) { fp = sctp->sctp_primary; - if (IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + if (IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { sce.sctpAssocRemPrimAddrType = MIB2_SCTP_ADDR_V4; } else { sce.sctpAssocRemPrimAddrType = MIB2_SCTP_ADDR_V6; } - sce.sctpAssocRemPrimAddr = fp->faddr; - sce.sctpAssocLocPrimAddr = fp->saddr; + sce.sctpAssocRemPrimAddr = fp->sf_faddr; + sce.sctpAssocLocPrimAddr = fp->sf_saddr; sce.sctpAssocHeartBeatInterval = TICK_TO_MSEC( - fp->hb_interval); + fp->sf_hb_interval); } else { sce.sctpAssocRemPrimAddrType = MIB2_SCTP_ADDR_V4; bzero(&sce.sctpAssocRemPrimAddr, @@ -724,15 +724,15 @@ /* * Table for remote addresses */ - for (fp = sctp->sctp_faddrs; fp; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) { scre.sctpAssocId = ntohl(sctp->sctp_lvtag); - if (IN6_IS_ADDR_V4MAPPED(&fp->faddr)) { + if (IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) { scre.sctpAssocRemAddrType = MIB2_SCTP_ADDR_V4; } else { scre.sctpAssocRemAddrType = MIB2_SCTP_ADDR_V6; } - scre.sctpAssocRemAddr = fp->faddr; - if (fp->state == SCTP_FADDRS_ALIVE) { + scre.sctpAssocRemAddr = fp->sf_faddr; + if (fp->sf_state == SCTP_FADDRS_ALIVE) { scre.sctpAssocRemAddrActive = scre.sctpAssocRemAddrHBActive = MIB2_SCTP_ACTIVE; @@ -741,9 +741,9 @@ scre.sctpAssocRemAddrHBActive = MIB2_SCTP_INACTIVE; } - scre.sctpAssocRemAddrRTO = TICK_TO_MSEC(fp->rto); - scre.sctpAssocRemAddrMaxPathRtx = fp->max_retr; - scre.sctpAssocRemAddrRtx = fp->T3expire; + scre.sctpAssocRemAddrRTO = TICK_TO_MSEC(fp->sf_rto); + scre.sctpAssocRemAddrMaxPathRtx = fp->sf_max_retr; + scre.sctpAssocRemAddrRtx = fp->sf_T3expire; (void) snmp_append_data2(mp_rem_data, &mp_rem_tail, (char *)&scre, sizeof (scre)); }
--- a/usr/src/uts/common/inet/sctp/sctp_timer.c Tue Aug 03 20:50:58 2010 -0700 +++ b/usr/src/uts/common/inet/sctp/sctp_timer.c Tue Aug 03 22:50:37 2010 -0700 @@ -433,11 +433,11 @@ * and the number of peer addresses should not be big, this should * be OK. */ - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { if (sctps->sctps_reclaim) - pp_max_retr = MIN(sctp_pp_early_abort, fp->max_retr); + pp_max_retr = MIN(sctp_pp_early_abort, fp->sf_max_retr); else - pp_max_retr = fp->max_retr; + pp_max_retr = fp->sf_max_retr; /* * If the peer is unreachable because there is no available @@ -449,28 +449,29 @@ * up to the normal heartbeat max times. But if heartbeat * is disable, this retry may go on forever. */ - if (fp->state == SCTP_FADDRS_UNREACH) { + if (fp->sf_state == SCTP_FADDRS_UNREACH) { sctp_get_dest(sctp, fp); - if (fp->state == SCTP_FADDRS_UNREACH) { - if (fp->hb_enabled && - ++fp->strikes > pp_max_retr && + if (fp->sf_state == SCTP_FADDRS_UNREACH) { + if (fp->sf_hb_enabled && + ++fp->sf_strikes > pp_max_retr && sctp_faddr_dead(sctp, fp, SCTP_FADDRS_DOWN) == -1) { /* Assoc is dead */ return; } - fp->hb_expiry = now + SET_HB_INTVL(fp); + fp->sf_hb_expiry = now + SET_HB_INTVL(fp); goto set_expiry; } else { /* Send a heartbeat immediately. */ - fp->hb_expiry = now; + fp->sf_hb_expiry = now; } } /* * Don't send heartbeat to this address if it is not * hb_enabled and the address has been confirmed. */ - if (!fp->hb_enabled && fp->state != SCTP_FADDRS_UNCONFIRMED) { + if (!fp->sf_hb_enabled && fp->sf_state != + SCTP_FADDRS_UNCONFIRMED) { continue; } @@ -485,15 +486,15 @@ * heartbeat timeout value. If there is no heartbeat pending, * just send out one. */ - if (now >= fp->hb_expiry) { - if (fp->hb_pending) { + if (now >= fp->sf_hb_expiry) { + if (fp->sf_hb_pending) { /* * If an address is not confirmed, no need * to bump the overall counter as it doesn't * matter as we will not use it to send data * and it should not affect the association. */ - switch (fp->state) { + switch (fp->sf_state) { case SCTP_FADDRS_ALIVE: sctp->sctp_strikes++; /* FALLTHRU */ @@ -502,9 +503,9 @@ * Retransmission implies that RTO * is probably not correct. */ - fp->rtt_updates = 0; - fp->strikes++; - if (fp->strikes > pp_max_retr) { + fp->sf_rtt_updates = 0; + fp->sf_strikes++; + if (fp->sf_strikes > pp_max_retr) { if (sctp_faddr_dead(sctp, fp, SCTP_FADDRS_DOWN) == -1) { /* Assoc is dead */ @@ -514,18 +515,20 @@ * Addr is down; keep initial * RTO */ - fp->rto = + fp->sf_rto = sctp->sctp_rto_initial; goto dead_addr; } else { SCTP_CALC_RXT(sctp, fp, sctp->sctp_rto_max); - fp->hb_expiry = now + fp->rto; + fp->sf_hb_expiry = now + + fp->sf_rto; } break; case SCTP_FADDRS_DOWN: dead_addr: - fp->hb_expiry = now + SET_HB_INTVL(fp); + fp->sf_hb_expiry = now + + SET_HB_INTVL(fp); break; default: continue; @@ -535,11 +538,12 @@ * If there is unack'ed data, no need to * send a heart beat. */ - if (fp->suna > 0) { - fp->hb_expiry = now + SET_HB_INTVL(fp); + if (fp->sf_suna > 0) { + fp->sf_hb_expiry = now + + SET_HB_INTVL(fp); goto set_expiry; } else { - fp->hb_expiry = now + fp->rto; + fp->sf_hb_expiry = now + fp->sf_rto; } } /* @@ -552,12 +556,13 @@ * is not sent, it will not affect the state of the * peer address. */ - if (fp->state != SCTP_FADDRS_UNCONFIRMED || cnt-- > 0) + if (fp->sf_state != SCTP_FADDRS_UNCONFIRMED || + cnt-- > 0) sctp_send_heartbeat(sctp, fp); } set_expiry: - if (fp->hb_expiry < earliest_expiry || earliest_expiry == 0) - earliest_expiry = fp->hb_expiry; + if (fp->sf_hb_expiry < earliest_expiry || earliest_expiry == 0) + earliest_expiry = fp->sf_hb_expiry; } if (sctp->sctp_autoclose != 0) { int64_t expire; @@ -590,22 +595,22 @@ ASSERT(fp != NULL); dprint(3, ("sctp_timer: faddr=%x:%x:%x:%x\n", - SCTP_PRINTADDR(fp->faddr))); + SCTP_PRINTADDR(fp->sf_faddr))); - fp->timer_running = 0; + fp->sf_timer_running = 0; if (!sctps->sctps_reclaim) { - pp_max_retr = fp->max_retr; + pp_max_retr = fp->sf_max_retr; pa_max_retr = sctp->sctp_pa_max_rxt; } else { /* App may have set a very aggressive retransmission limit. */ - pp_max_retr = MIN(sctp_pp_early_abort, fp->max_retr); + pp_max_retr = MIN(sctp_pp_early_abort, fp->sf_max_retr); pa_max_retr = MIN(sctp_pa_early_abort, sctp->sctp_pa_max_rxt); } /* Check is we've reached the max for retries */ if (sctp->sctp_state < SCTPS_ESTABLISHED) { - if (fp->strikes >= sctp->sctp_max_init_rxt) { + if (fp->sf_strikes >= sctp->sctp_max_init_rxt) { /* time to give up */ SCTPS_BUMP_MIB(sctps, sctpAborted); SCTPS_BUMP_MIB(sctps, sctpTimRetransDrop); @@ -626,7 +631,7 @@ } } - if (fp->strikes >= pp_max_retr) { + if (fp->sf_strikes >= pp_max_retr) { if (sctp_faddr_dead(sctp, fp, SCTP_FADDRS_DOWN) == -1) { return; } @@ -669,7 +674,7 @@ mp = sctp_init_mp(sctp, fp); if (mp != NULL) { SCTPS_BUMP_MIB(sctps, sctpTimRetrans); - (void) conn_ip_output(mp, fp->ixa); + (void) conn_ip_output(mp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); } rto_max = sctp->sctp_rto_max_init; @@ -683,7 +688,7 @@ mp = dupmsg(sctp->sctp_cookie_mp); if (mp == NULL) break; - (void) conn_ip_output(mp, fp->ixa); + (void) conn_ip_output(mp, fp->sf_ixa); BUMP_LOCAL(sctp->sctp_opkts); SCTPS_BUMP_MIB(sctps, sctpTimRetrans); rto_max = sctp->sctp_rto_max_init; @@ -708,11 +713,11 @@ break; } - fp->strikes++; + fp->sf_strikes++; sctp->sctp_strikes++; SCTP_CALC_RXT(sctp, fp, rto_max); - SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); + SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->sf_rto); } /* @@ -730,10 +735,10 @@ dprint(5, ("sctp_update_rtt: fp = %p, rtt = %d\n", (void *)fp, rtt)); /* Is this the first RTT measurement? */ - if (fp->srtt == -1) { - fp->srtt = rtt; - fp->rttvar = rtt / 2; - fp->rto = 3 * rtt; /* == rtt + 4 * rttvar ( == rtt / 2) */ + if (fp->sf_srtt == -1) { + fp->sf_srtt = rtt; + fp->sf_rttvar = rtt / 2; + fp->sf_rto = 3 * rtt; /* == rtt + 4 * rttvar ( == rtt / 2) */ } else { int abs; /* @@ -741,28 +746,28 @@ * alpha and beta are NOT tunable in this implementation, * and so are hard-coded in. alpha = 1/8, beta = 1/4. */ - abs = fp->srtt - rtt; + abs = fp->sf_srtt - rtt; abs = abs >= 0 ? abs : -abs; - fp->rttvar = (3 * fp->rttvar + abs) >> 2; - fp->rttvar = fp->rttvar != 0 ? fp->rttvar : 1; + fp->sf_rttvar = (3 * fp->sf_rttvar + abs) >> 2; + fp->sf_rttvar = fp->sf_rttvar != 0 ? fp->sf_rttvar : 1; - fp->srtt = (7 * fp->srtt + rtt) >> 3; - fp->rto = fp->srtt + 4 * fp->rttvar; + fp->sf_srtt = (7 * fp->sf_srtt + rtt) >> 3; + fp->sf_rto = fp->sf_srtt + 4 * fp->sf_rttvar; } dprint(5, ("sctp_update_rtt: srtt = %d, rttvar = %d, rto = %d\n", - fp->srtt, fp->rttvar, fp->rto)); + fp->sf_srtt, fp->sf_rttvar, fp->sf_rto)); /* Bound the RTO by configured min and max values */ - if (fp->rto < sctp->sctp_rto_min) { - fp->rto = sctp->sctp_rto_min; + if (fp->sf_rto < sctp->sctp_rto_min) { + fp->sf_rto = sctp->sctp_rto_min; } - if (fp->rto > sctp->sctp_rto_max) { - fp->rto = sctp->sctp_rto_max; + if (fp->sf_rto > sctp->sctp_rto_max) { + fp->sf_rto = sctp->sctp_rto_max; } SCTP_MAX_RTO(sctp, fp); - fp->rtt_updates++; + fp->sf_rtt_updates++; } void @@ -770,16 +775,16 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { - if (fp->timer_mp != NULL) { - sctp_timer_free(fp->timer_mp); - fp->timer_mp = NULL; - fp->timer_running = 0; + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { + if (fp->sf_timer_mp != NULL) { + sctp_timer_free(fp->sf_timer_mp); + fp->sf_timer_mp = NULL; + fp->sf_timer_running = 0; } - if (fp->rc_timer_mp != NULL) { - sctp_timer_free(fp->rc_timer_mp); - fp->rc_timer_mp = NULL; - fp->rc_timer_running = 0; + if (fp->sf_rc_timer_mp != NULL) { + sctp_timer_free(fp->sf_rc_timer_mp); + fp->sf_rc_timer_mp = NULL; + fp->sf_rc_timer_running = 0; } } } @@ -789,7 +794,7 @@ { sctp_faddr_t *fp; - for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->next) { + for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { SCTP_FADDR_TIMER_STOP(fp); SCTP_FADDR_RC_TIMER_STOP(fp); }