Hello, I just upgraded from tinc1.0pre4 to 1.0pre7 and the new thing works fine. But with on exception: your function maskcheck() ist still silly. It classifies the subnet definition 172.16.11.8/29 as wrong (seems to be the same error as in 1.0pre6 as dicussed in April). My whole VPN is a class C network (24 bit netmask) and thus every edge of the VPN serves subnets of the class C network. Therefor the definition 172.16.11.8/29 is for me mandatory to be working. My first workaround was to comment out your maskcheck code (just below the comment "teach newbies what subnets are" and before the statement "*result = subnet" in src/conf.c). Please find an other fix for that because I think the maskcheck itself make sense. Unfortunately I am no good C programmer but an better assembler programmer. My fix of the maskcheck function would not be elegant C code. In assembler language I would create code that serves for the following function (IPv4): netmask := ( 0xffffffff00000000 rshiftby netmasklength ) and 0xffffffff OK := (netaddress and not(netmask)) = 0 I?ve no idea how to check IPv6 because I had not (yet) contact with the new standard :-( In general you are doing a good job with tinc. Congratulations Johnny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://brouwer.uvt.nl/pipermail/tinc-devel/attachments/20020607/f1668fe0/attachment.html
On 2002-06-07 11:17:17+0200, Johannes Lode wrote:> Please find an other fix for that because I think the maskcheck itself > make sense. Unfortunately I am no good C programmer but an better > assembler programmer. My fix of the maskcheck function would not be > elegant C code. > In assembler language I would create code that serves for the following > function (IPv4): > > netmask := ( 0xffffffff00000000 rshiftby netmasklength ) and 0xffffffff > > OK := (netaddress and not(netmask)) = 0I just changed it to this: int maskcheck(char *a, int masklen, int len) { int i; i = masklen / 8; masklen %= 8; if(a[i++] & (0xff >> masklen)) return -1; for(; i < len; i++) if(a[i] != 0) return -2; return 0; } ...which I hope will work better. Have fun, -- Wessel Dankers <wsl@fruit.eu.org> Dew on the telephone lines. -- TINC development list, tinc-devel@nl.linux.org Archive: http://mail.nl.linux.org/tinc-devel/