diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-13 18:58:17 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-13 18:58:17 +0200 |
| commit | 71ce6f53a431962a3dc17947deb1ff8336f37d13 (patch) | |
| tree | 696d49216801c6421b850708cd4f476221f351bf | |
| parent | 8fdd633d57778af2e7fc01115e67f3735e553244 (diff) | |
| download | plan9front-71ce6f53a431962a3dc17947deb1ff8336f37d13.tar.xz | |
devip: reject incompatible multicast/interface ip address pairs for ipifcaddmulti()
| -rw-r--r-- | sys/src/9/ip/ipifc.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |
