9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] ip/ping -6
@ 2017-06-18  3:03 cinap_lenrek
  0 siblings, 0 replies; 3+ messages in thread
From: cinap_lenrek @ 2017-06-18  3:03 UTC (permalink / raw)
  To: 9front

this is the wrong place. ndb/cs should just not hand out
v4 addresses for proto icmpv6...

--
cinap


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] ip/ping -6
  2017-06-18  3:22 cinap_lenrek
@ 2017-06-18  4:33 ` Kenji Arisawa
  0 siblings, 0 replies; 3+ messages in thread
From: Kenji Arisawa @ 2017-06-18  4:33 UTC (permalink / raw)
  To: 9front

thanks a lot.
works.

> 2017/06/18 12:22、cinap_lenrek@felloff.net のメール:
> 
> +		/* 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))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] ip/ping -6
@ 2017-06-18  3:22 cinap_lenrek
  2017-06-18  4:33 ` Kenji Arisawa
  0 siblings, 1 reply; 3+ messages in thread
From: cinap_lenrek @ 2017-06-18  3:22 UTC (permalink / raw)
  To: 9front


untested patch, filters out v4/v6 for icmpv6/icmp and il

--- a/sys/src/cmd/ndb/cs.c	Thu Jun 15 15:59:02 2017 +0000
+++ b/sys/src/cmd/ndb/cs.c	Sun Jun 18 05:19:48 2017 +0200
@@ -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",

--
cinap


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-18  4:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-18  3:03 [9front] ip/ping -6 cinap_lenrek
2017-06-18  3:22 cinap_lenrek
2017-06-18  4:33 ` Kenji Arisawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).