diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-11 03:14:28 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-11 03:14:28 +0200 |
| commit | 94f6f89ac1e8731a27c38b54b54348bc063fb6c3 (patch) | |
| tree | df6efab81efefe4828c45cdbbae4da3e30a5303b | |
| parent | d497eb2d2f88e3ae7fd7b2a4594aededed75468e (diff) | |
| download | plan9front-94f6f89ac1e8731a27c38b54b54348bc063fb6c3.tar.xz | |
devip: do not icmp reply on multicast destination
| -rw-r--r-- | sys/src/9/ip/icmp6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/9/ip/icmp6.c b/sys/src/9/ip/icmp6.c index cbbf3f182..bceb6aeff 100644 --- a/sys/src/9/ip/icmp6.c +++ b/sys/src/9/ip/icmp6.c @@ -430,7 +430,7 @@ icmphostunr6(Fs *f, Ipifc *ifc, Block *bp, int code, int tome) uchar ia[IPaddrlen]; p = (Ip6hdr *)bp->rp; - if(isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) + if(isv6mcast(p->dst) || isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) return; netlog(f, Logicmp, "send icmphostunr %I -> src %I dst %I\n", @@ -467,7 +467,7 @@ icmpttlexceeded6(Fs *f, Ipifc *ifc, Block *bp) uchar ia[IPaddrlen]; p = (Ip6hdr *)bp->rp; - if(isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) + if(isv6mcast(p->dst) || isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) return; netlog(f, Logicmp, "send icmpttlexceeded6 %I -> src %I dst %I\n", @@ -500,7 +500,7 @@ icmppkttoobig6(Fs *f, Ipifc *ifc, Block *bp) uchar ia[IPaddrlen]; p = (Ip6hdr *)bp->rp; - if(isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) + if(isv6mcast(p->dst) || isv6mcast(p->src) || !ipv6local(ifc, ia, p->src)) return; netlog(f, Logicmp, "send icmppkttoobig6 %I -> src %I dst %I\n", |
