summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-09-04 00:50:09 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-09-04 00:50:09 +0200
commit0687986bb30a3c550ce056fc1170712c90188257 (patch)
tree08f6401179458d7fa98fc1b45280710751968aa3
parentba9feb14c5f5780758b6d62ebb44cd90b99eccc4 (diff)
pflocal: Remove unused write_addr fieldv0.9.git20230912
It was never set, and re-connecting a socket to another address would try to deref the port, thus crashing.
-rw-r--r--pflocal/sock.c7
-rw-r--r--pflocal/sock.h4
2 files changed, 1 insertions, 10 deletions
diff --git a/pflocal/sock.c b/pflocal/sock.c
index 3daf8282..90c618ec 100644
--- a/pflocal/sock.c
+++ b/pflocal/sock.c
@@ -394,7 +394,6 @@ sock_connect (struct sock *sock1, struct sock *sock2)
/* In the case of a connectionless protocol, an already-connected socket may
be reconnected, so save the old destination for later disposal. */
struct pipe *old_sock1_write_pipe = NULL;
- struct addr *old_sock1_write_addr = NULL;
void connect (struct sock *wr, struct sock *rd)
{
@@ -426,7 +425,6 @@ sock_connect (struct sock *sock1, struct sock *sock2)
else
{
old_sock1_write_pipe = sock1->write_pipe;
- old_sock1_write_addr = sock1->write_addr;
/* Always make the forward connection. */
connect (sock1, sock2);
@@ -449,10 +447,7 @@ sock_connect (struct sock *sock1, struct sock *sock2)
pthread_mutex_unlock (&socket_pair_lock);
if (old_sock1_write_pipe)
- {
- pipe_remove_writer (old_sock1_write_pipe);
- ports_port_deref (old_sock1_write_addr);
- }
+ pipe_remove_writer (old_sock1_write_pipe);
return err;
}
diff --git a/pflocal/sock.h b/pflocal/sock.h
index c686dec4..6a724d4c 100644
--- a/pflocal/sock.h
+++ b/pflocal/sock.h
@@ -74,10 +74,6 @@ struct sock
one could tell anyway). */
struct addr *addr;
- /* If this sock has been connected to another sock, then WRITE_ADDR is the
- addr of that sock. We *do* hold a reference to this addr. */
- struct addr *write_addr;
-
/* A connection queue to listen for incoming connections on. Once a socket
has one of these, it always does, and can never again be used for
anything but accepting incoming connections. */