| 606 | } |
| 607 | |
| 608 | int |
| 609 | sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest) |
| 610 | { |
| 611 | sctp_sharedkey_t *skey, *new_skey; |
| 612 | int count = 0; |
| 613 | |
| 614 | if ((src == NULL) || (dest == NULL)) |
| 615 | return (0); |
| 616 | LIST_FOREACH(skey, src, next) { |
| 617 | new_skey = sctp_copy_sharedkey(skey); |
| 618 | if (new_skey != NULL) { |
| 619 | if (sctp_insert_sharedkey(dest, new_skey)) { |
| 620 | sctp_free_sharedkey(new_skey); |
| 621 | } else { |
| 622 | count++; |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | return (count); |
| 627 | } |
| 628 | |
| 629 | sctp_hmaclist_t * |
| 630 | sctp_alloc_hmaclist(uint16_t num_hmacs) |
no test coverage detected