shithub: riscv

Download patch

ref: b12763136e0169485da2a910127cea27353dd17b
parent: c11a3bb3b1e2713b1f48fd7df8ead818f62cf4ac
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Oct 4 01:04:33 EDT 2017

ndb/cs: icmp only supports version 4 addresses, icmpv6 only version 6 addresses

--- a/sys/src/cmd/ndb/cs.c
+++ b/sys/src/cmd/ndb/cs.c
@@ -1525,8 +1525,12 @@
 		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",