summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-09-19 13:46:46 +0200
committerSander Vrijders <sander@ouroboros.rocks>2023-09-20 18:51:19 +0200
commit3be8a872c638b81f39596a2fd5e9b0c43533e002 (patch)
treebd42327028d596c0dd841d5e376af19d46ecb56f
parentcd649633abae9a0fd2bdbcda965ee1dfd4c6fedd (diff)
downloadouroboros-3be8a872c638b81f39596a2fd5e9b0c43533e002.tar.gz
ouroboros-3be8a872c638b81f39596a2fd5e9b0c43533e002.zip
ipcpd: Fix dereference of unknown pointer type
The event handler was dereferencing the pointer to a connection, but the pointer type is not known yet. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/ipcpd/unicast/dt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/unicast/dt.c b/src/ipcpd/unicast/dt.c
index af2a6e29..2c166751 100644
--- a/src/ipcpd/unicast/dt.c
+++ b/src/ipcpd/unicast/dt.c
@@ -405,10 +405,9 @@ static void handle_event(void * self,
c = (struct conn *) o;
- fd = c->flow_info.fd;
-
switch (event) {
case NOTIFY_DT_CONN_ADD:
+ fd = c->flow_info.fd;
#ifdef IPCP_FLOW_STATS
stat_used(fd, c->conn_info.addr);
#endif
@@ -416,6 +415,7 @@ static void handle_event(void * self,
log_dbg("Added fd %d to packet scheduler.", fd);
break;
case NOTIFY_DT_CONN_DEL:
+ fd = c->flow_info.fd;
#ifdef IPCP_FLOW_STATS
stat_used(fd, INVALID_ADDR);
#endif