mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-ggsn.git
synced 2025-11-01 12:43:43 +00:00
sgsnemu: Fix bad ptr during context deallocation
Older commit switched pdp_t to have an array of 2 peers instead of
only one in order to accomodate for ipv4v6 contexts, which can have 2
addresses assigned. The usage of peer field was not updated in sgsnemu
accordingly, which means the wrong memory portion was being accessed.
Fixes: 2d6a69e69a
("Add support for IPv4v6 End User Addresses")
Change-Id: I9e563522173a82b265e93b1ef9dc93ced40fefa2
This commit is contained in:
@@ -1312,8 +1312,8 @@ static int delete_context(struct pdp_t *pdp)
|
||||
if (tun && options.ipdown)
|
||||
tun_runscript(tun, options.ipdown);
|
||||
|
||||
ipdel((struct iphash_t *)pdp->peer);
|
||||
memset(pdp->peer, 0, sizeof(struct iphash_t)); /* To be sure */
|
||||
ipdel((struct iphash_t *)pdp->peer[0]);
|
||||
memset(pdp->peer[0], 0, sizeof(struct iphash_t)); /* To be sure */
|
||||
|
||||
if (1 == options.contexts)
|
||||
state = 5; /* Disconnected */
|
||||
|
Reference in New Issue
Block a user