[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 13/26: pflocal: fix destruction of explicitely bound sockets
From: |
Samuel Thibault |
Subject: |
[hurd] 13/26: pflocal: fix destruction of explicitely bound sockets |
Date: |
Sat, 02 Nov 2013 14:44:45 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 4660ac02b9723380b4581b4c6a46e54861b95059
Author: Richard Braun <address@hidden>
Date: Fri Oct 18 01:16:07 2013 +0200
pflocal: fix destruction of explicitely bound sockets
Sockets must have a weak reference on the address they're bound to so
that addr_unbind is properly called before addr_clean. For sockets that
are automatically bound, this weak reference is created in ensure_addr.
Do the same in sock_bind.
* pflocal/sock.c (sock_bind): Handle weak reference on addr.
---
pflocal/sock.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pflocal/sock.c b/pflocal/sock.c
index 2641e1c..8076dd3 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... */
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 12/26: term: fix read on a closed PTY, (continued)
- [hurd] 12/26: term: fix read on a closed PTY, Samuel Thibault, 2013/11/02
- [hurd] 23/26: libshouldbeinlibc: fix error handling in maptime_map, Samuel Thibault, 2013/11/02
- [hurd] 05/26: trans: rename a global variable, Samuel Thibault, 2013/11/02
- [hurd] 07/26: console-client: remove the pid file on clean exits, Samuel Thibault, 2013/11/02
- [hurd] 08/26: console-client: entitle console_exit with the noreturn attribute, Samuel Thibault, 2013/11/02
- [hurd] 06/26: libfshelp: properly free active translator entries, Samuel Thibault, 2013/11/02
- [hurd] 21/26: configure.ac: properly escape the test for X11/keysymdef.h, Samuel Thibault, 2013/11/02
- [hurd] 25/26: libports: fix error handling in _ports_create_port_internal, Samuel Thibault, 2013/11/02
- [hurd] 14/26: libdiskfs: fix removal of socket nodes, Samuel Thibault, 2013/11/02
- [hurd] 22/26: exec: Remove the remaining BFD related bits, Samuel Thibault, 2013/11/02
- [hurd] 13/26: pflocal: fix destruction of explicitely bound sockets,
Samuel Thibault <=
- [hurd] 20/26: Make boot script accept more fsck values, Samuel Thibault, 2013/11/02
- [hurd] 19/26: Add xenl to hurd.ti, Samuel Thibault, 2013/11/02
- [hurd] 18/26: Make CUD more usual, Samuel Thibault, 2013/11/02
- [hurd] 17/26: Make boot script reboot when fsck told so, Samuel Thibault, 2013/11/02
- [hurd] 15/26: pflocal: fix port leak when receiving port rights, Samuel Thibault, 2013/11/02
- [hurd] 16/26: pflocal: fix message flags on receive, Samuel Thibault, 2013/11/02