diff options
author | rrs <rrs@FreeBSD.org> | 2007-07-24 20:06:02 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-07-24 20:06:02 +0000 |
commit | 1db8ba247453b3da31775f1a39199179ca75bfb7 (patch) | |
tree | d2ea0fd9ef19605e959e0ed17a4723e94186c995 /sys/netinet/sctp_pcb.c | |
parent | 4177278d87cbfa0b06b72d4b526e3a39dbd7838b (diff) | |
download | FreeBSD-src-1db8ba247453b3da31775f1a39199179ca75bfb7.zip FreeBSD-src-1db8ba247453b3da31775f1a39199179ca75bfb7.tar.gz |
- take out a needless panic under invariants for sctp_output.c
- Fix addrs's error checking of sctp_sendx(3) when addrcnt is less than
SCTP_SMALL_IOVEC_SIZE
- re-add back inpcb_bind local address check bypass capability
- Fix it so sctp_opt_info is independant of assoc_id postion.
- Fix cookie life set to use MSEC_TO_TICKS() macro.
- asconf changes
o More comment changes/clarifications related to the old local address
"not" list which is now an explicit restricted list.
o Rename some functions for clarity:
- sctp_add/del_local_addr_assoc to xxx_local_addr_restricted()
- asconf related iterator functions to sctp_asconf_iterator_xxx()
o Fix bug when the same address is deleted and added (and removed from
the asconf queue) where the ifa is "freed" twice refcount wise,
possibly freeing it completely.
o Fix bug in output where the first ASCONF would not go out after the
last address is changed (e.g. only goes out when retransmitted).
o Fix bug where multiple ASCONFs can be bundled in the same packet with
the and with the same serial numbers.
o Fix asconf stcb iterator to not send ASCONF until after all work
queue entries have been processed.
o Change behavior so that when the last address is deleted (auto asconf
on a bound all endpoint) no action is taken until an address is
added; at that time, an ASCONF add+delete is sent (if the assoc
is still up).
o Fix local address counting so that address scoping is taken into
account.
o #ifdef SCTP_TIMER_BASED_ASCONF the old timer triggered sending
of ASCONF (after an RTO). The default now is to send
ASCONF immediately (except for the case of changing/deleting the
last usable address).
Approved by: re(ken smith)@freebsd.org
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
-rw-r--r-- | sys/netinet/sctp_pcb.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 0096047..df6689f 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2123,9 +2123,10 @@ sctp_isport_inuse(struct sctp_inpcb *inp, uint16_t lport, uint32_t vrf_id) +/* sctp_ifap is used to bypass normal local address validation checks */ int sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, - struct thread *p) + struct sctp_ifa *sctp_ifap, struct thread *p) { /* bind a ep to a socket address */ struct sctppcbhead *head; @@ -2396,8 +2397,17 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, * zero out the port to find the address! yuck! can't do * this earlier since need port for sctp_pcb_findep() */ - ifa = sctp_find_ifa_by_addr((struct sockaddr *)&store_sa, - vrf_id, 0); + if (sctp_ifap != NULL) + ifa = sctp_ifap; + else { + /* + * Note for BSD we hit here always other O/S's will + * pass things in via the sctp_ifap argument + * (Panda). + */ + ifa = sctp_find_ifa_by_addr((struct sockaddr *)&store_sa, + vrf_id, 0); + } if (ifa == NULL) { /* Can't find an interface with that address */ SCTP_INP_WUNLOCK(inp); @@ -3401,6 +3411,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, */ if ((err = sctp_inpcb_bind(inp->sctp_socket, (struct sockaddr *)NULL, + (struct sctp_ifa *)NULL, p ))) { /* bind error, probably perm */ @@ -4461,13 +4472,12 @@ sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa) } /* - * Add the addr to the TCB local address list For the BOUNDALL or dynamic - * case, this is a "pending" address list (eg. addresses waiting for an - * ASCONF-ACK response) For the subset binding, static case, this is a - * "valid" address list + * Add the address to the TCB local address restricted list. + * This is a "pending" address list (eg. addresses waiting for an + * ASCONF-ACK response) and cannot be used as a valid source address. */ void -sctp_add_local_addr_assoc(struct sctp_tcb *stcb, struct sctp_ifa *ifa, int restricted_list) +sctp_add_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa) { struct sctp_inpcb *inp; struct sctp_laddr *laddr; @@ -4538,10 +4548,10 @@ sctp_remove_laddr(struct sctp_laddr *laddr) } /* - * Remove an address from the TCB local address list + * Remove a local address from the TCB local address restricted list */ void -sctp_del_local_addr_assoc(struct sctp_tcb *stcb, struct sctp_ifa *ifa) +sctp_del_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa) { struct sctp_inpcb *inp; struct sctp_laddr *laddr; |