shithub: riscv

Download patch

ref: 71ce6f53a431962a3dc17947deb1ff8336f37d13
parent: 8fdd633d57778af2e7fc01115e67f3735e553244
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jun 13 14:58:17 EDT 2018

devip: reject incompatible multicast/interface ip address pairs for ipifcaddmulti()

--- a/sys/src/9/ip/ipifc.c
+++ b/sys/src/9/ip/ipifc.c
@@ -1466,6 +1466,9 @@
 	Ipifc *ifc;
 	Fs *f;
 
+	if(isv4(ma) != isv4(ia))
+		error("incompatible multicast/interface ip address");
+
 	for(l = &c->multi; *l != nil; l = &(*l)->next)
 		if(ipcmp(ma, (*l)->ma) == 0 && ipcmp(ia, (*l)->ia) == 0)
 			return;		/* it's already there */