From 16c3f57ed63c65043561c6bb4cec2430d0537aff Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 11 Nov 2015 17:27:01 +0100 Subject: gtphub: fix numerous segfaults, and other stupidities. Initialize llist_heads to empty (2 were missing). Move those for struct gtphub instances to gtphub_zero() (one moved, one added). In from_[gs]gsns_read_cb(), use a return type that can actually reflect negative return values. resolved_addr.buf: no need to take the address of a byte array var (cosmetic). Pass the proper user data address to sgsn_ares_query(), not the address of the pointer holding the user data address. Initialize ggsn_lookup->expiry_entry (was missing). Publish the function for that in gtphub.h so gtphub_ext.c can use it. Sponsored-by: On-Waves ehi --- openbsc/include/openbsc/gtphub.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openbsc/include') diff --git a/openbsc/include/openbsc/gtphub.h b/openbsc/include/openbsc/gtphub.h index 79f138b0a..a0125669d 100644 --- a/openbsc/include/openbsc/gtphub.h +++ b/openbsc/include/openbsc/gtphub.h @@ -182,6 +182,9 @@ void expiry_init(struct expiry *exq, int expiry_in_seconds); /* Add a new mapping, or restart the expiry timeout for an already listed mapping. */ void expiry_add(struct expiry *exq, struct expiring_item *mapping, time_t now); +/* Initialize to all-empty; must be called before using the item in any way. */ +void expiring_item_init(struct expiring_item *item); + /* Remove the given item from its expiry queue, and call item->del_cb, if set. * This sets item->del_cb to NULL and is harmless when run a second time on the * same item, so the del_cb may choose to call this function, too, to allow -- cgit v1.2.3