Fix child-address counting.
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 28 Feb 2017 18:24:40 +0000 (18:24 +0000)
committerPhil Pennock <pdp@exim.org>
Tue, 28 Feb 2017 22:38:35 +0000 (17:38 -0500)
commitc3a4f56818a937123279a4c0e3d785a1f71339f3
treefdde2215890c7688c5477c3180d391c010ed02ae
parentbe43ad74273ed8a4e7c5bdc3345e4310a4767327
Fix child-address counting.

When a new address was created by a routing step it was possible for the parent address in the tree to
be marked as having zero children, despite the new child having a pointer to the parent.  When the child
was then delivered, the count on the parent could go negative or, if other children had been added which
correctly incremented the count, arrive at zero while some children were outstanding.  Fix this to
maintin the invariant.  While there, make the counter unsigned.

(cherry picked from commit 82f90600647a5322e9e7b58fc127eb8be839165c)
Signed-off-by: Phil Pennock <pdp@exim.org>
src/src/deliver.c
src/src/routers/iplookup.c
src/src/routers/queryprogram.c
src/src/routers/redirect.c
src/src/routers/rf_change_domain.c
src/src/structs.h