From b12763136e0169485da2a910127cea27353dd17b Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 4 Oct 2017 05:04:33 +0200 Subject: [PATCH] ndb/cs: icmp only supports version 4 addresses, icmpv6 only version 6 addresses --- sys/src/cmd/ndb/cs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/ndb/cs.c b/sys/src/cmd/ndb/cs.c index 432008848..a573bc674 100644 --- a/sys/src/cmd/ndb/cs.c +++ b/sys/src/cmd/ndb/cs.c @@ -1525,8 +1525,12 @@ iptrans(Ndbtuple *t, Network *np, char *serv, char *rem, int hack) snprint(reply, sizeof(reply), "%s/%s/clone %s%s", mntpt, np->net, ts, x); else { - /* il only supports ipv4 addresses */ - if(strcmp(np->net, "il") == 0 && !isv4str(t->val)) + /* il and icmp only supports ipv4 addresses */ + if((strcmp(np->net, "il") == 0 || strcmp(np->net, "icmp") == 0) && !isv4str(t->val)) + return nil; + + /* icmpv6 does not support ipv4 addresses */ + if(strcmp(np->net, "icmpv6") == 0 && isv4str(t->val)) return nil; snprint(reply, sizeof(reply), "%s/%s/clone %s!%s%s%s",