Code

daemon: consider only address in kill_some_child()
authorErik Faye-Lund <kusmabite@googlemail.com>
Sat, 9 Jan 2010 14:13:28 +0000 (15:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Jan 2010 07:43:49 +0000 (23:43 -0800)
commit15515b73716a6ead5a5a348a7d04cc7d73c74bff
tree0690239ef2fc030846cbe77ea85ae369f370c200
parent3caa82396ca8a78da05f7759570444e9a666b2e8
daemon: consider only address in kill_some_child()

kill_some_child() compares the entire sockaddr_storage
structure (with the pad-bits zeroed out) when trying to
find out if connections originate from the same host.
However, sockaddr_storage contains the port-number for
the connection (which varies between connections), so
the comparison always fails.

Change the code so we only consider the host-address,
by introducing the addrcmp()-function that inspects
the address family and compare as appropriate.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c