Allow link ban

This commit is contained in:
Quentin Dufour 2019-03-27 11:19:05 +01:00
parent febfed9d1d
commit 627523e1c7

View file

@ -121,6 +121,12 @@ void rr_pkt_register(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo,
if (bp->ip.ap.str.id > rr->my_links_ver) {
rr->my_links = bp->ip.ap.str.bitfield;
rr->my_links_ver = bp->ip.ap.str.id;
printf("Links availability: [");
for (int i = 0; i < 8; i++) {
if (rr->my_links & 1 << i) printf("U");
else printf("-");
}
printf("]\n");
}
// 2. If packet arrived too late, we discard it
@ -385,7 +391,7 @@ int rr_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
printf("Timer reached for packet %d\n", pkt->id);
// !BLACKLIST LINK
//rr->remote_links &= 0xffff ^ 1 << pkt->link_num;
rr->remote_links &= 0xff ^ 1 << pkt->link_num;
while (ring_lt(rr->recv_id, pkt->id)) {
rr->recv_id++;