git: 9front

Download patch

ref: 6543fb3561a32f20651e98a10e460b9066d1ccda
parent: a3ef83a4cdf6f2e3575e9e1b7a8282ede59be789
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Sep 3 13:25:45 EDT 2022

devip: replicate the nat-flag (Rtrans) when superceding interface route

Superceding interface routes is handled specially,
only incrementing reference count, but need to take
the new Rtrans flag into account.

--- a/sys/src/9/ip/iproute.c
+++ b/sys/src/9/ip/iproute.c
@@ -311,8 +311,10 @@
 		 */
 		if((p->type & Rifc) == 0)
 			copygate(p, new);
-		else if(new->type & Rifc)
+		else if(new->type & Rifc){
+			p->type = (p->type & ~Rtrans) | (new->type & Rtrans);
 			p->ref++;
+		}
 		freeroute(new);
 		break;
 	case Roverlaps:
--