diff options
Diffstat (limited to 'net/dccp/ackvec.c')
-rw-r--r-- | net/dccp/ackvec.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index 66b8a51300c0..41819848bdda 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c | |||
@@ -343,6 +343,34 @@ free_records: | |||
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | /* | ||
347 | * Routines to keep track of Ack Vectors received in an skb | ||
348 | */ | ||
349 | int dccp_ackvec_parsed_add(struct list_head *head, u8 *vec, u8 len, u8 nonce) | ||
350 | { | ||
351 | struct dccp_ackvec_parsed *new = kmalloc(sizeof(*new), GFP_ATOMIC); | ||
352 | |||
353 | if (new == NULL) | ||
354 | return -ENOBUFS; | ||
355 | new->vec = vec; | ||
356 | new->len = len; | ||
357 | new->nonce = nonce; | ||
358 | |||
359 | list_add_tail(&new->node, head); | ||
360 | return 0; | ||
361 | } | ||
362 | EXPORT_SYMBOL_GPL(dccp_ackvec_parsed_add); | ||
363 | |||
364 | void dccp_ackvec_parsed_cleanup(struct list_head *parsed_chunks) | ||
365 | { | ||
366 | struct dccp_ackvec_parsed *cur, *next; | ||
367 | |||
368 | list_for_each_entry_safe(cur, next, parsed_chunks, node) | ||
369 | kfree(cur); | ||
370 | INIT_LIST_HEAD(parsed_chunks); | ||
371 | } | ||
372 | EXPORT_SYMBOL_GPL(dccp_ackvec_parsed_cleanup); | ||
373 | |||
346 | int __init dccp_ackvec_init(void) | 374 | int __init dccp_ackvec_init(void) |
347 | { | 375 | { |
348 | dccp_ackvec_slab = kmem_cache_create("dccp_ackvec", | 376 | dccp_ackvec_slab = kmem_cache_create("dccp_ackvec", |