shithub: riscv

Download patch

ref: 4ad70e6055093123f0611269ca7e8e201257e5db
parent: e35616cb661708bcd0c8680b8562e7dc44c7a1b9
author: aiju <devnull@localhost>
date: Wed Dec 13 17:20:12 EST 2017

vmx(1): fix virtio network bloomfilter

--- a/sys/src/cmd/vmx/virtio.c
+++ b/sys/src/cmd/vmx/virtio.c
@@ -423,7 +423,7 @@
 			return (d->net.flags & VNETNOUNI) == 0;
 		if(memcmp(mac, d->net.mac, 6) == 0) return 1;
 		if(d->net.macbloom == 0) return 0;
-		return d->net.macbloom & 1ULL<<bloomhash(mac);
+		return d->net.macbloom >> bloomhash(mac) & 1;
 	}else if(memcmp(mac, bcast, 6) == 0)
 		return (d->net.flags & VNETNOBCAST) == 0;
 	else{
@@ -430,7 +430,7 @@
 		if((d->net.flags & (VNETNOMULTI|VNETALLMULTI)) != 0)
 			return (d->net.flags & VNETNOMULTI) == 0;
 		if(d->net.multibloom == 0) return 0;
-		return d->net.multibloom & 1ULL<<bloomhash(mac);
+		return d->net.multibloom >> bloomhash(mac) & 1;
 	}
 }