From 71ce6f53a431962a3dc17947deb1ff8336f37d13 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 13 Jun 2018 18:58:17 +0200 Subject: [PATCH] devip: reject incompatible multicast/interface ip address pairs for ipifcaddmulti() --- sys/src/9/ip/ipifc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/src/9/ip/ipifc.c b/sys/src/9/ip/ipifc.c index b2fc1676c..4261eac90 100644 --- a/sys/src/9/ip/ipifc.c +++ b/sys/src/9/ip/ipifc.c @@ -1466,6 +1466,9 @@ ipifcaddmulti(Conv *c, uchar *ma, uchar *ia) 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 */