commit-hurd
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]