summaryrefslogtreecommitdiff
path: root/pflocal/sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'pflocal/sock.c')
-rw-r--r--pflocal/sock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pflocal/sock.c b/pflocal/sock.c
index 2641e1c5..8076dd36 100644
--- a/pflocal/sock.c
+++ b/pflocal/sock.c
@@ -294,12 +294,16 @@ sock_bind (struct sock *sock, struct addr *addr)
{
sock->addr = addr;
if (addr)
- sock->refs++;
+ {
+ sock->refs++;
+ ports_port_ref_weak (addr);
+ }
if (old_addr)
{
/* Note that we don't have to worry about SOCK's ref count going to
zero because whoever's calling us should be holding a ref. */
sock->refs--;
+ ports_port_deref_weak (addr);
assert (sock->refs > 0); /* But make sure... */
}
}