Deleted Added
full compact
sctp_asconf.c (236515) sctp_asconf.c (237715)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

--- 17 unchanged lines hidden (view full) ---

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

--- 17 unchanged lines hidden (view full) ---

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 236515 2012-06-03 14:54:50Z tuexen $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 237715 2012-06-28 16:01:08Z tuexen $");
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_var.h>
38#include <netinet/sctp_sysctl.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctp_header.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>
43#include <netinet/sctp_asconf.h>
44#include <netinet/sctp_timer.h>
45
46/*
47 * debug flags:
48 * SCTP_DEBUG_ASCONF1: protocol info, general info and errors
49 * SCTP_DEBUG_ASCONF2: detailed info
50 */
51
52
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_var.h>
38#include <netinet/sctp_sysctl.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctp_header.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>
43#include <netinet/sctp_asconf.h>
44#include <netinet/sctp_timer.h>
45
46/*
47 * debug flags:
48 * SCTP_DEBUG_ASCONF1: protocol info, general info and errors
49 * SCTP_DEBUG_ASCONF2: detailed info
50 */
51
52
53static void
54sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa)
55{
56 struct ip *iph;
57
58#ifdef INET
59 struct sockaddr_in *sin;
60
61#endif
62#ifdef INET6
63 struct sockaddr_in6 *sin6;
64
65#endif
66
67 iph = mtod(m, struct ip *);
68 switch (iph->ip_v) {
69#ifdef INET
70 case IPVERSION:
71 {
72 /* IPv4 source */
73 sin = (struct sockaddr_in *)sa;
74 bzero(sin, sizeof(*sin));
75 sin->sin_family = AF_INET;
76 sin->sin_len = sizeof(struct sockaddr_in);
77 sin->sin_port = 0;
78 sin->sin_addr.s_addr = iph->ip_src.s_addr;
79 break;
80 }
81#endif
82#ifdef INET6
83 case (IPV6_VERSION >> 4):
84 {
85 /* IPv6 source */
86 struct ip6_hdr *ip6;
87
88 sin6 = (struct sockaddr_in6 *)sa;
89 bzero(sin6, sizeof(*sin6));
90 sin6->sin6_family = AF_INET6;
91 sin6->sin6_len = sizeof(struct sockaddr_in6);
92 sin6->sin6_port = 0;
93 ip6 = mtod(m, struct ip6_hdr *);
94 sin6->sin6_addr = ip6->ip6_src;
95 break;
96 }
97#endif /* INET6 */
98 default:
99 break;
100 }
101 return;
102}
103
104/*
53/*
105 * draft-ietf-tsvwg-addip-sctp
54 * RFC 5061
106 *
107 * An ASCONF parameter queue exists per asoc which holds the pending address
108 * operations. Lists are updated upon receipt of ASCONF-ACK.
109 *
110 * A restricted_addrs list exists per assoc to hold local addresses that are
111 * not (yet) usable by the assoc as a source address. These addresses are
112 * either pending an ASCONF operation (and exist on the ASCONF parameter
113 * queue), or they are permanently restricted (the peer has returned an

--- 75 unchanged lines hidden (view full) ---

189 SCTP_BUF_LEN(m_reply) = aph->ph.param_length;
190 error->length = htons(error->length);
191 aph->ph.param_length = htons(aph->ph.param_length);
192
193 return (m_reply);
194}
195
196static struct mbuf *
55 *
56 * An ASCONF parameter queue exists per asoc which holds the pending address
57 * operations. Lists are updated upon receipt of ASCONF-ACK.
58 *
59 * A restricted_addrs list exists per assoc to hold local addresses that are
60 * not (yet) usable by the assoc as a source address. These addresses are
61 * either pending an ASCONF operation (and exist on the ASCONF parameter
62 * queue), or they are permanently restricted (the peer has returned an

--- 75 unchanged lines hidden (view full) ---

138 SCTP_BUF_LEN(m_reply) = aph->ph.param_length;
139 error->length = htons(error->length);
140 aph->ph.param_length = htons(aph->ph.param_length);
141
142 return (m_reply);
143}
144
145static struct mbuf *
197sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph,
146sctp_process_asconf_add_ip(struct sockaddr *src, struct sctp_asconf_paramhdr *aph,
198 struct sctp_tcb *stcb, int send_hb, int response_required)
199{
200 struct sctp_nets *net;
201 struct mbuf *m_reply = NULL;
147 struct sctp_tcb *stcb, int send_hb, int response_required)
148{
149 struct sctp_nets *net;
150 struct mbuf *m_reply = NULL;
202 struct sockaddr_storage sa_source, sa_store;
151 struct sockaddr_storage sa_store;
203 struct sctp_paramhdr *ph;
204 uint16_t param_type, param_length, aparam_length;
205 struct sockaddr *sa;
206 int zero_address = 0;
207 int bad_address = 0;
208
209#ifdef INET
210 struct sockaddr_in *sin;

--- 63 unchanged lines hidden (view full) ---

274 m_reply = sctp_asconf_error_response(aph->correlation_id,
275 SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
276 aparam_length);
277 return (m_reply);
278 } /* end switch */
279
280 /* if 0.0.0.0/::0, add the source address instead */
281 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
152 struct sctp_paramhdr *ph;
153 uint16_t param_type, param_length, aparam_length;
154 struct sockaddr *sa;
155 int zero_address = 0;
156 int bad_address = 0;
157
158#ifdef INET
159 struct sockaddr_in *sin;

--- 63 unchanged lines hidden (view full) ---

223 m_reply = sctp_asconf_error_response(aph->correlation_id,
224 SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
225 aparam_length);
226 return (m_reply);
227 } /* end switch */
228
229 /* if 0.0.0.0/::0, add the source address instead */
230 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
282 sa = (struct sockaddr *)&sa_source;
283 sctp_asconf_get_source_ip(m, sa);
231 sa = src;
284 SCTPDBG(SCTP_DEBUG_ASCONF1,
285 "process_asconf_add_ip: using source addr ");
232 SCTPDBG(SCTP_DEBUG_ASCONF1,
233 "process_asconf_add_ip: using source addr ");
286 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
234 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src);
287 }
288 /* add the address */
289 if (bad_address) {
290 m_reply = sctp_asconf_error_response(aph->correlation_id,
291 SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
292 aparam_length);
293 } else if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE,
294 SCTP_ADDR_DYNAMIC_ADDED) != 0) {

--- 43 unchanged lines hidden (view full) ---

338 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0,
339 (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED);
340 }
341 }
342 return (0);
343}
344
345static struct mbuf *
235 }
236 /* add the address */
237 if (bad_address) {
238 m_reply = sctp_asconf_error_response(aph->correlation_id,
239 SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
240 aparam_length);
241 } else if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE,
242 SCTP_ADDR_DYNAMIC_ADDED) != 0) {

--- 43 unchanged lines hidden (view full) ---

286 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0,
287 (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED);
288 }
289 }
290 return (0);
291}
292
293static struct mbuf *
346sctp_process_asconf_delete_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph,
294sctp_process_asconf_delete_ip(struct sockaddr *src,
295 struct sctp_asconf_paramhdr *aph,
347 struct sctp_tcb *stcb, int response_required)
348{
349 struct mbuf *m_reply = NULL;
296 struct sctp_tcb *stcb, int response_required)
297{
298 struct mbuf *m_reply = NULL;
350 struct sockaddr_storage sa_source, sa_store;
299 struct sockaddr_storage sa_store;
351 struct sctp_paramhdr *ph;
352 uint16_t param_type, param_length, aparam_length;
353 struct sockaddr *sa;
354 int zero_address = 0;
355 int result;
356
357#ifdef INET
358 struct sockaddr_in *sin;
359 struct sctp_ipv4addr_param *v4addr;
360
361#endif
362#ifdef INET6
363 struct sockaddr_in6 *sin6;
364 struct sctp_ipv6addr_param *v6addr;
365
366#endif
367
300 struct sctp_paramhdr *ph;
301 uint16_t param_type, param_length, aparam_length;
302 struct sockaddr *sa;
303 int zero_address = 0;
304 int result;
305
306#ifdef INET
307 struct sockaddr_in *sin;
308 struct sctp_ipv4addr_param *v4addr;
309
310#endif
311#ifdef INET6
312 struct sockaddr_in6 *sin6;
313 struct sctp_ipv6addr_param *v6addr;
314
315#endif
316
368 /* get the source IP address for src and 0.0.0.0/::0 delete checks */
369 sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source);
370
371 aparam_length = ntohs(aph->ph.param_length);
372 ph = (struct sctp_paramhdr *)(aph + 1);
373 param_type = ntohs(ph->param_type);
374 param_length = ntohs(ph->param_length);
375
376 sa = (struct sockaddr *)&sa_store;
377 switch (param_type) {
378#ifdef INET

--- 40 unchanged lines hidden (view full) ---

419 default:
420 m_reply = sctp_asconf_error_response(aph->correlation_id,
421 SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
422 aparam_length);
423 return (m_reply);
424 }
425
426 /* make sure the source address is not being deleted */
317 aparam_length = ntohs(aph->ph.param_length);
318 ph = (struct sctp_paramhdr *)(aph + 1);
319 param_type = ntohs(ph->param_type);
320 param_length = ntohs(ph->param_length);
321
322 sa = (struct sockaddr *)&sa_store;
323 switch (param_type) {
324#ifdef INET

--- 40 unchanged lines hidden (view full) ---

365 default:
366 m_reply = sctp_asconf_error_response(aph->correlation_id,
367 SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
368 aparam_length);
369 return (m_reply);
370 }
371
372 /* make sure the source address is not being deleted */
427 if (sctp_cmpaddr(sa, (struct sockaddr *)&sa_source)) {
373 if (sctp_cmpaddr(sa, src)) {
428 /* trying to delete the source address! */
429 SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n");
430 m_reply = sctp_asconf_error_response(aph->correlation_id,
431 SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph,
432 aparam_length);
433 return (m_reply);
434 }
435 /* if deleting 0.0.0.0/::0, delete all addresses except src addr */
436 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
374 /* trying to delete the source address! */
375 SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n");
376 m_reply = sctp_asconf_error_response(aph->correlation_id,
377 SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph,
378 aparam_length);
379 return (m_reply);
380 }
381 /* if deleting 0.0.0.0/::0, delete all addresses except src addr */
382 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
437 result = sctp_asconf_del_remote_addrs_except(stcb,
438 (struct sockaddr *)&sa_source);
383 result = sctp_asconf_del_remote_addrs_except(stcb, src);
439
440 if (result) {
441 /* src address did not exist? */
442 SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: src addr does not exist?\n");
443 /* what error to reply with?? */
444 m_reply =
445 sctp_asconf_error_response(aph->correlation_id,
446 SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *) aph,

--- 23 unchanged lines hidden (view full) ---

470 }
471 /* notify upper layer */
472 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED);
473 }
474 return (m_reply);
475}
476
477static struct mbuf *
384
385 if (result) {
386 /* src address did not exist? */
387 SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: src addr does not exist?\n");
388 /* what error to reply with?? */
389 m_reply =
390 sctp_asconf_error_response(aph->correlation_id,
391 SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *) aph,

--- 23 unchanged lines hidden (view full) ---

415 }
416 /* notify upper layer */
417 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED);
418 }
419 return (m_reply);
420}
421
422static struct mbuf *
478sctp_process_asconf_set_primary(struct mbuf *m,
423sctp_process_asconf_set_primary(struct sockaddr *src,
479 struct sctp_asconf_paramhdr *aph,
480 struct sctp_tcb *stcb, int response_required)
481{
482 struct mbuf *m_reply = NULL;
424 struct sctp_asconf_paramhdr *aph,
425 struct sctp_tcb *stcb, int response_required)
426{
427 struct mbuf *m_reply = NULL;
483 struct sockaddr_storage sa_source, sa_store;
428 struct sockaddr_storage sa_store;
484 struct sctp_paramhdr *ph;
485 uint16_t param_type, param_length, aparam_length;
486 struct sockaddr *sa;
487 int zero_address = 0;
488
489#ifdef INET
490 struct sockaddr_in *sin;
491 struct sctp_ipv4addr_param *v4addr;

--- 53 unchanged lines hidden (view full) ---

545 m_reply = sctp_asconf_error_response(aph->correlation_id,
546 SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
547 aparam_length);
548 return (m_reply);
549 }
550
551 /* if 0.0.0.0/::0, use the source address instead */
552 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
429 struct sctp_paramhdr *ph;
430 uint16_t param_type, param_length, aparam_length;
431 struct sockaddr *sa;
432 int zero_address = 0;
433
434#ifdef INET
435 struct sockaddr_in *sin;
436 struct sctp_ipv4addr_param *v4addr;

--- 53 unchanged lines hidden (view full) ---

490 m_reply = sctp_asconf_error_response(aph->correlation_id,
491 SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
492 aparam_length);
493 return (m_reply);
494 }
495
496 /* if 0.0.0.0/::0, use the source address instead */
497 if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
553 sa = (struct sockaddr *)&sa_source;
554 sctp_asconf_get_source_ip(m, sa);
498 sa = src;
555 SCTPDBG(SCTP_DEBUG_ASCONF1,
556 "process_asconf_set_primary: using source addr ");
499 SCTPDBG(SCTP_DEBUG_ASCONF1,
500 "process_asconf_set_primary: using source addr ");
557 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
501 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src);
558 }
559 /* set the primary address */
560 if (sctp_set_primary_addr(stcb, sa, NULL) == 0) {
561 SCTPDBG(SCTP_DEBUG_ASCONF1,
562 "process_asconf_set_primary: primary address set\n");
563 /* notify upper layer */
564 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa, SCTP_SO_NOT_LOCKED);
565 if ((stcb->asoc.primary_destination->dest_state & SCTP_ADDR_REACHABLE) &&

--- 55 unchanged lines hidden (view full) ---

621}
622
623/*
624 * handles an ASCONF chunk.
625 * if all parameters are processed ok, send a plain (empty) ASCONF-ACK
626 */
627void
628sctp_handle_asconf(struct mbuf *m, unsigned int offset,
502 }
503 /* set the primary address */
504 if (sctp_set_primary_addr(stcb, sa, NULL) == 0) {
505 SCTPDBG(SCTP_DEBUG_ASCONF1,
506 "process_asconf_set_primary: primary address set\n");
507 /* notify upper layer */
508 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa, SCTP_SO_NOT_LOCKED);
509 if ((stcb->asoc.primary_destination->dest_state & SCTP_ADDR_REACHABLE) &&

--- 55 unchanged lines hidden (view full) ---

565}
566
567/*
568 * handles an ASCONF chunk.
569 * if all parameters are processed ok, send a plain (empty) ASCONF-ACK
570 */
571void
572sctp_handle_asconf(struct mbuf *m, unsigned int offset,
573 struct sockaddr *src,
629 struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb,
630 int first)
631{
632 struct sctp_association *asoc;
633 uint32_t serial_num;
634 struct mbuf *n, *m_ack, *m_result, *m_tail;
635 struct sctp_asconf_ack_chunk *ack_cp;
636 struct sctp_asconf_paramhdr *aph, *ack_aph;

--- 120 unchanged lines hidden (view full) ---

757 if (aph == NULL) {
758 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get entire param\n");
759 sctp_m_freem(m_ack);
760 return;
761 }
762 switch (param_type) {
763 case SCTP_ADD_IP_ADDRESS:
764 asoc->peer_supports_asconf = 1;
574 struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb,
575 int first)
576{
577 struct sctp_association *asoc;
578 uint32_t serial_num;
579 struct mbuf *n, *m_ack, *m_result, *m_tail;
580 struct sctp_asconf_ack_chunk *ack_cp;
581 struct sctp_asconf_paramhdr *aph, *ack_aph;

--- 120 unchanged lines hidden (view full) ---

702 if (aph == NULL) {
703 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get entire param\n");
704 sctp_m_freem(m_ack);
705 return;
706 }
707 switch (param_type) {
708 case SCTP_ADD_IP_ADDRESS:
709 asoc->peer_supports_asconf = 1;
765 m_result = sctp_process_asconf_add_ip(m, aph, stcb,
710 m_result = sctp_process_asconf_add_ip(src, aph, stcb,
766 (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error);
767 cnt++;
768 break;
769 case SCTP_DEL_IP_ADDRESS:
770 asoc->peer_supports_asconf = 1;
711 (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error);
712 cnt++;
713 break;
714 case SCTP_DEL_IP_ADDRESS:
715 asoc->peer_supports_asconf = 1;
771 m_result = sctp_process_asconf_delete_ip(m, aph, stcb,
716 m_result = sctp_process_asconf_delete_ip(src, aph, stcb,
772 error);
773 break;
774 case SCTP_ERROR_CAUSE_IND:
775 /* not valid in an ASCONF chunk */
776 break;
777 case SCTP_SET_PRIM_ADDR:
778 asoc->peer_supports_asconf = 1;
717 error);
718 break;
719 case SCTP_ERROR_CAUSE_IND:
720 /* not valid in an ASCONF chunk */
721 break;
722 case SCTP_SET_PRIM_ADDR:
723 asoc->peer_supports_asconf = 1;
779 m_result = sctp_process_asconf_set_primary(m, aph,
724 m_result = sctp_process_asconf_set_primary(src, aph,
780 stcb, error);
781 break;
782 case SCTP_NAT_VTAGS:
783 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: sees a NAT VTAG state parameter\n");
784 break;
785 case SCTP_SUCCESS_REPORT:
786 /* not valid in an ASCONF chunk */
787 break;

--- 63 unchanged lines hidden (view full) ---

851 TAILQ_INSERT_TAIL(&stcb->asoc.asconf_ack_sent, ack, next);
852
853 /* see if last_control_chunk_from is set properly (use IP src addr) */
854 if (stcb->asoc.last_control_chunk_from == NULL) {
855 /*
856 * this could happen if the source address was just newly
857 * added
858 */
725 stcb, error);
726 break;
727 case SCTP_NAT_VTAGS:
728 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: sees a NAT VTAG state parameter\n");
729 break;
730 case SCTP_SUCCESS_REPORT:
731 /* not valid in an ASCONF chunk */
732 break;

--- 63 unchanged lines hidden (view full) ---

796 TAILQ_INSERT_TAIL(&stcb->asoc.asconf_ack_sent, ack, next);
797
798 /* see if last_control_chunk_from is set properly (use IP src addr) */
799 if (stcb->asoc.last_control_chunk_from == NULL) {
800 /*
801 * this could happen if the source address was just newly
802 * added
803 */
859 struct sockaddr_storage addr;
860 struct sockaddr *src = (struct sockaddr *)&addr;
861
862 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n");
804 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n");
863 sctp_asconf_get_source_ip(m, src);
864 SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: ");
865 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src);
866 /* look up the from address */
867 stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, src);
868#ifdef SCTP_DEBUG
869 if (stcb->asoc.last_control_chunk_from == NULL) {
870 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n");
871 }

--- 2664 unchanged lines hidden ---
805 SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: ");
806 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src);
807 /* look up the from address */
808 stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, src);
809#ifdef SCTP_DEBUG
810 if (stcb->asoc.last_control_chunk_from == NULL) {
811 SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n");
812 }

--- 2664 unchanged lines hidden ---