Fix: improved load balancing algorithm
[l2tpns.git] / grpsess.c
index f38ab1a..a4b63ab 100644 (file)
--- a/grpsess.c
+++ b/grpsess.c
@@ -571,7 +571,7 @@ sessionidt grp_getnextsession(groupidt g, in_addr_t ip, in_addr_t ip_src)
                uint8_t *ad = (uint8_t *) &ip;
                uint16_t ai = ad[3];
                ai <<= 8;
-               ai &= as[3];
+               ai |= as[3];
 
                s = grp_local[g].sid_loaddist[ai];
                if (!s)