shithub: gefs

Download patch

ref: 37e3d345b45173cf230d560b6a52e12c5ece5243
parent: 2774f7c4733f4f1fe6c49f300943d4f1579def46
author: Michael Forney <[email protected]>
date: Sat Mar 12 17:48:54 EST 2022

fs: strip trailing suffix during version negotiation

This is needed to downgrade 9p2000.L to 9p2000 for the linux v9fs
client, and is also documented in version(5).

--- a/fs.c
+++ b/fs.c
@@ -535,8 +535,12 @@
 fsversion(Fmsg *m, int *msz)
 {
 	Fcall r;
+	char *p;
 
 	memset(&r, 0, sizeof(Fcall));
+	p = strchr(m->version, '.');
+	if(p != nil)
+		*p = '\0';
 	if(strcmp(m->version, "9P2000") == 0){
 		if(m->msize < *msz)
 			*msz = m->msize;