]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/ip/tcp.c
set router R-flag when sendra is active for neighbor advertisement
[plan9front.git] / sys / src / 9 / ip / tcp.c
index 050a24a0b0c5ebb9ddb830e3183a068bb6300aa3..f241a5c8ef775e7ec9adbe76f47da67893fd44d5 100644 (file)
@@ -864,13 +864,14 @@ tcpmtu(Route *r, int version, uint *scale)
         * otherwise, we use the default MSS which assumes a
         * safe minimum MTU of 1280 bytes for V6.
         */  
-       if(r != nil && (version == V4 || (r->type & (Rifc|Runi)) != 0)){
+       if(r != nil){
                ifc = r->ifc;
                mtu = ifc->maxtu - ifc->m->hsize;
-               if(version == V6)
-                       return mtu - (TCP6_PKT + TCP6_HDRSIZE);
-               else
+               if(version == V4)
                        return mtu - (TCP4_PKT + TCP4_HDRSIZE);
+               mtu -= TCP6_PKT + TCP6_HDRSIZE;
+               if((r->type & (Rifc|Runi)) != 0 || mtu <= DEF_MSS6)
+                       return mtu;
        }
        if(version == V6)
                return DEF_MSS6;
@@ -3281,6 +3282,8 @@ tcpporthogdefensectl(char *val)
 static char*
 tcpctl(Conv* c, char** f, int n)
 {
+       if(n == 1 && strcmp(f[0], "close") == 0)
+               return tcpclose(c), nil;
        if(n == 1 && strcmp(f[0], "hangup") == 0)
                return tcphangup(c);
        if(n >= 1 && strcmp(f[0], "keepalive") == 0)