Lines Matching refs:fp
63 sctp_set_saddr(sctp_t *sctp, sctp_faddr_t *fp)
65 boolean_t v6 = !fp->sf_isv4;
68 fp->sf_saddr = sctp_get_valid_addr(sctp, v6, &addr_set);
76 fp->sf_state = SCTP_FADDRS_UNREACH;
80 * Call this function to get information about a peer addr fp.
86 sctp_get_dest(sctp_t *sctp, sctp_faddr_t *fp)
104 fp->sf_saddr = ipv6_all_zeros;
111 if (fp->sf_state == SCTP_FADDRS_UNREACH) {
112 fp->sf_state = SCTP_FADDRS_UNCONFIRMED;
119 fp->sf_ixa->ixa_flags |= IXAF_PMTU_DISCOVERY;
121 ip_attr_nexthop(&connp->conn_xmit_ipp, fp->sf_ixa, &fp->sf_faddr,
124 laddr = fp->sf_saddr;
125 error = ip_attr_connect(connp, fp->sf_ixa, &laddr, &fp->sf_faddr,
130 SCTP_PRINTADDR(fp->sf_faddr)));
148 sctp_set_saddr(sctp, fp);
149 if (fp->sf_state == SCTP_FADDRS_UNREACH)
153 ASSERT(fp->sf_ixa->ixa_ire != NULL);
154 ASSERT(!(fp->sf_ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE)));
165 fp->sf_saddr = laddr;
177 sctp_set_saddr(sctp, fp);
178 if (fp->sf_state == SCTP_FADDRS_UNREACH) {
187 if (fp->sf_srtt == -1 && uinfo.iulp_rtt != 0) {
189 fp->sf_srtt = MSEC_TO_TICK(uinfo.iulp_rtt);
190 fp->sf_rttvar = MSEC_TO_TICK(uinfo.iulp_rtt_sd);
191 fp->sf_rto = 3 * fp->sf_srtt;
194 if (fp->sf_rto < sctp->sctp_rto_min) {
195 fp->sf_rto = sctp->sctp_rto_min;
197 if (fp->sf_rto > sctp->sctp_rto_max) {
198 fp->sf_rto = sctp->sctp_rto_max;
200 SCTP_MAX_RTO(sctp, fp);
208 if (fp->sf_isv4) {
213 if ((fp->sf_pmss + hdrlen) != pmtu) {
215 fp->sf_pmss = (pmtu - hdrlen) & ~(SCTP_ALIGN - 1);
216 if (fp->sf_cwnd < (fp->sf_pmss * 2)) {
217 SET_CWND(fp, fp->sf_pmss,
223 if (fp == sctp->sctp_current)
224 sctp_set_faddr_current(sctp, fp);
230 sctp_faddr_t *fp;
236 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) {
243 if (fp->sf_pmtu_discovered) {
244 if (fp->sf_isv4) {
245 uinfo.iulp_mtu = fp->sf_pmss +
248 uinfo.iulp_mtu = fp->sf_pmss +
253 fp->sf_rtt_updates >= sctps->sctps_rtt_updates) {
258 uinfo.iulp_rtt = TICK_TO_MSEC(fp->sf_srtt);
259 uinfo.iulp_rtt_sd = TICK_TO_MSEC(fp->sf_rttvar);
260 fp->sf_rtt_updates = 0;
263 if (IN6_IS_ADDR_LINKSCOPE(&fp->sf_faddr)) {
268 if (fp->sf_ixa->ixa_nce != NULL) {
269 ifindex = fp->sf_ixa->ixa_nce->nce_common->
276 (void) dce_update_uinfo(&fp->sf_faddr, ifindex, &uinfo, ipst);
284 sctp_make_mp(sctp_t *sctp, sctp_faddr_t *fp, int trailer)
292 ASSERT(fp != NULL);
293 isv4 = fp->sf_isv4;
295 if (SCTP_IS_ADDR_UNSPEC(isv4, fp->sf_saddr) ||
296 (fp->sf_ixa->ixa_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))) {
298 sctp_get_dest(sctp, fp);
308 if (fp->sf_state == SCTP_FADDRS_UNREACH)
311 ASSERT(fp->sf_ixa->ixa_ire != NULL);
312 ASSERT(!SCTP_IS_ADDR_UNSPEC(isv4, fp->sf_saddr));
334 if (fp != sctp->sctp_current || src_changed) {
336 IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, iph->ipha_dst);
337 IN6_V4MAPPED_TO_IPADDR(&fp->sf_saddr, iph->ipha_src);
340 if (fp->sf_df) {
347 if (fp != sctp->sctp_current || src_changed) {
349 ((ip6_t *)(mp->b_rptr))->ip6_dst = fp->sf_faddr;
350 ((ip6_t *)(mp->b_rptr))->ip6_src = fp->sf_saddr;
556 sctp_faddr_t *fp;
558 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) {
559 if (IN6_ARE_ADDR_EQUAL(&fp->sf_faddr, addr))
563 return (fp);
567 sctp_lookup_faddr_nosctp(sctp_faddr_t *fp, in6_addr_t *addr)
569 for (; fp; fp = fp->sf_next) {
570 if (IN6_ARE_ADDR_EQUAL(&fp->sf_faddr, addr)) {
575 return (fp);
582 sctp_set_faddr_current(sctp_t *sctp, sctp_faddr_t *fp)
585 if (fp->sf_isv4) {
586 IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr,
588 IN6_V4MAPPED_TO_IPADDR(&fp->sf_saddr,
591 if (fp->sf_df) {
598 sctp->sctp_ip6h->ip6_dst = fp->sf_faddr;
599 sctp->sctp_ip6h->ip6_src = fp->sf_saddr;
602 sctp->sctp_current = fp;
603 sctp->sctp_mss = fp->sf_pmss;
613 sctp_faddr_t *fp;
615 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) {
616 sctp_get_dest(sctp, fp);
621 sctp_faddr_alive(sctp_t *sctp, sctp_faddr_t *fp)
635 fp->sf_strikes = 0;
636 fp->sf_lastactive = now;
637 fp->sf_hb_expiry = now + SET_HB_INTVL(fp);
638 fp->sf_hb_pending = B_FALSE;
639 if (fp->sf_state != SCTP_FADDRS_ALIVE) {
640 fp->sf_state = SCTP_FADDRS_ALIVE;
641 sctp_intf_event(sctp, fp->sf_faddr, SCTP_ADDR_AVAILABLE, 0);
643 sctp_get_dest(sctp, fp);
652 if (fp == sctp->sctp_primary &&
653 fp->sf_state != SCTP_FADDRS_UNREACH) {
654 sctp_set_faddr_current(sctp, fp);
667 sctp_faddr_t *fp;
669 for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) {
670 if (fp->sf_state == SCTP_FADDRS_ALIVE && fp->sf_strikes == 0) {
686 sctp_faddr_dead(sctp_t *sctp, sctp_faddr_t *fp, int newstate)
691 if (fp->sf_state == SCTP_FADDRS_ALIVE) {
692 sctp_intf_event(sctp, fp->sf_faddr, SCTP_ADDR_UNREACHABLE, 0);
694 fp->sf_state = newstate;
697 SCTP_PRINTADDR(fp->sf_faddr), newstate));
699 if (fp == sctp->sctp_current) {
705 ofp = fp;
706 for (fp = fp->sf_next; fp != NULL; fp = fp->sf_next) {
707 if (fp->sf_state == SCTP_FADDRS_ALIVE) {
712 if (fp == NULL) {
714 for (fp = sctp->sctp_faddrs; fp != ofp; fp = fp->sf_next) {
715 if (fp->sf_state == SCTP_FADDRS_ALIVE) {
722 * Find a new fp, so if the current faddr is dead, use the new fp
725 if (fp != ofp) {
728 SCTP_PRINTADDR(fp->sf_faddr)));
731 * of the new fp.
733 sctp_set_faddr_current(sctp, fp);
803 sctp_unlink_faddr(sctp_t *sctp, sctp_faddr_t *fp)
811 if (fp->sf_timer_mp != NULL) {
812 sctp_timer_free(fp->sf_timer_mp);
813 fp->sf_timer_mp = NULL;
814 fp->sf_timer_running = 0;
816 if (fp->sf_rc_timer_mp != NULL) {
817 sctp_timer_free(fp->sf_rc_timer_mp);
818 fp->sf_rc_timer_mp = NULL;
819 fp->sf_rc_timer_running = 0;
821 if (fp->sf_ixa != NULL) {
822 ixa_refrele(fp->sf_ixa);
823 fp->sf_ixa = NULL;
826 if (fp == sctp->sctp_faddrs) {
830 for (fpp = sctp->sctp_faddrs; fpp->sf_next != fp; fpp = fpp->sf_next)
836 if (fp == sctp->sctp_faddrs) {
837 sctp->sctp_faddrs = fp->sf_next;
839 fpp->sf_next = fp->sf_next;
842 kmem_cache_free(sctp_kmem_faddr_cache, fp);
849 sctp_faddr_t *fp, *fpn;
868 for (fp = sctp->sctp_faddrs; fp; fp = fpn) {
869 fpn = fp->sf_next;
870 if (fp->sf_ixa != NULL) {
871 ixa_refrele(fp->sf_ixa);
872 fp->sf_ixa = NULL;
874 kmem_cache_free(sctp_kmem_faddr_cache, fp);
1039 sctp_v4_label(sctp_t *sctp, sctp_faddr_t *fp)
1043 ASSERT(fp->sf_ixa->ixa_flags & IXAF_IS_IPV4);
1044 return (conn_update_label(connp, fp->sf_ixa, &fp->sf_faddr,
1049 sctp_v6_label(sctp_t *sctp, sctp_faddr_t *fp)
1053 ASSERT(!(fp->sf_ixa->ixa_flags & IXAF_IS_IPV4));
1054 return (conn_update_label(connp, fp->sf_ixa, &fp->sf_faddr,
1069 sctp_faddr_t *fp;
1097 for (fp = sctp->sctp_faddrs; fp; fp = fp->sf_next) {
1098 if (!gotv4 && IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) {
1100 sctp_v4_label(sctp, fp) == 0) {
1106 } else if (!gotv6 && !IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) {
1108 sctp_v6_label(sctp, fp) == 0) {
1266 sctp_faddr_t *fp;
1312 fp = sctp_lookup_faddr(sctp, hdrsaddr);
1313 if (fp == NULL) {
1320 fp = sctp->sctp_faddrs;
1327 sctp->sctp_primary = fp;
1328 sctp->sctp_current = fp;
1329 sctp->sctp_mss = fp->sf_pmss;
1511 sctp_faddr_t *fp, *fphead = NULL;
1598 fp = sctp_lookup_faddr_nosctp(fphead, hdraddr);
1599 if (fp == NULL) {
1601 fp = kmem_cache_alloc(sctp_kmem_faddr_cache, sleep);
1602 if (fp == NULL) {
1605 bzero(fp, sizeof (*fp));
1606 fp->sf_faddr = *hdraddr;
1607 fp->sf_next = fphead;
1608 fphead = fp;
1646 for (fp = fphead; fp; fp = fp->sf_next) {
1647 if (sctp_lookup_faddr(sctp, &fp->sf_faddr)) {
1648 fp->sf_rto = 0;
1650 fp->sf_rto = 1;
1676 for (fp = fphead; fp; fp = fp->sf_next) {
1677 if (fp->sf_rto == 0) {
1680 if (IN6_IS_ADDR_V4MAPPED(&fp->sf_faddr)) {
1685 IN6_V4MAPPED_TO_IPADDR(&fp->sf_faddr, addr4);
1695 bcopy(&fp->sf_faddr, ph, sizeof (fp->sf_faddr));
1697 ((char *)ph + sizeof (fp->sf_faddr));
1714 for (fp = fphead; fp; fp = fpn) {
1715 fpn = fp->sf_next;
1716 if (fp->sf_ixa != NULL) {
1717 ixa_refrele(fp->sf_ixa);
1718 fp->sf_ixa = NULL;
1720 kmem_cache_free(sctp_kmem_faddr_cache, fp);
1733 sctp_faddr_t *fp;
1737 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) {
1738 fp->sf_ssthresh = sctps->sctps_initial_mtu;
1739 SET_CWND(fp, fp->sf_pmss, sctps->sctps_slow_start_initial);
1740 fp->sf_suna = 0;
1741 fp->sf_pba = 0;
1778 sctp_init_faddr(sctp_t *sctp, sctp_faddr_t *fp, in6_addr_t *addr,
1783 ASSERT(fp->sf_ixa != NULL);
1785 bcopy(addr, &fp->sf_faddr, sizeof (*addr));
1787 fp->sf_isv4 = 1;
1789 fp->sf_pmss =
1792 fp->sf_ixa->ixa_flags |= IXAF_IS_IPV4;
1794 fp->sf_isv4 = 0;
1795 fp->sf_pmss =
1798 fp->sf_ixa->ixa_flags &= ~IXAF_IS_IPV4;
1800 fp->sf_cwnd = sctps->sctps_slow_start_initial * fp->sf_pmss;
1801 fp->sf_rto = MIN(sctp->sctp_rto_initial, sctp->sctp_rto_max_init);
1802 SCTP_MAX_RTO(sctp, fp);
1803 fp->sf_srtt = -1;
1804 fp->sf_rtt_updates = 0;
1805 fp->sf_strikes = 0;
1806 fp->sf_max_retr = sctp->sctp_pp_max_rxt;
1808 fp->sf_state = SCTP_FADDRS_UNCONFIRMED;
1809 fp->sf_hb_interval = sctp->sctp_hb_interval;
1810 fp->sf_ssthresh = sctps->sctps_initial_ssthresh;
1811 fp->sf_suna = 0;
1812 fp->sf_pba = 0;
1813 fp->sf_acked = 0;
1814 fp->sf_lastactive = fp->sf_hb_expiry = ddi_get_lbolt64();
1815 fp->sf_timer_mp = timer_mp;
1816 fp->sf_hb_pending = B_FALSE;
1817 fp->sf_hb_enabled = B_TRUE;
1818 fp->sf_df = 1;
1819 fp->sf_pmtu_discovered = 0;
1820 fp->sf_next = NULL;
1821 fp->sf_T3expire = 0;
1822 (void) random_get_pseudo_bytes((uint8_t *)&fp->sf_hb_secret,
1823 sizeof (fp->sf_hb_secret));
1824 fp->sf_rxt_unacked = 0;
1826 sctp_get_dest(sctp, fp);
1833 sctp_faddr_t *fp = buf;
1835 fp->sf_timer_mp = NULL;
1836 fp->sf_timer_running = 0;
1838 fp->sf_rc_timer_mp = NULL;
1839 fp->sf_rc_timer_running = 0;
1848 sctp_faddr_t *fp = buf;
1850 ASSERT(fp->sf_timer_mp == NULL);
1851 ASSERT(fp->sf_timer_running == 0);
1853 ASSERT(fp->sf_rc_timer_mp == NULL);
1854 ASSERT(fp->sf_rc_timer_running == 0);