code: plan9front

Download patch

ref: e3920d71c6273b8d0c773b411717a2d0137ee0ec
parent: f3032eb9536fef95fc35a58a6831540b6ffe0893
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Sep 3 15:29:06 EDT 2022

devip: make Rproxy flag explicit

--- a/sys/man/3/ip
+++ b/sys/man/3/ip
@@ -420,6 +420,9 @@
 .B p
 point-to-point route
 .TP
+.B y
+proxy ARP for this route
+.TP
 .B t
 network source address translation
 .PD
--- a/sys/src/9/ip/iproute.c
+++ b/sys/src/9/ip/iproute.c
@@ -312,7 +312,7 @@
 		if((p->type & Rifc) == 0)
 			copygate(p, new);
 		else if(new->type & Rifc){
-			p->type = (p->type & ~Rtrans) | (new->type & Rtrans);
+			p->type = (p->type & ~(Rproxy|Rtrans)) | (new->type & (Rproxy|Rtrans));
 			p->ref++;
 		}
 		freeroute(new);
@@ -877,6 +877,9 @@
 	case 'p':
 		if(((type ^= Rptpt) & Rptpt) != Rptpt) return -1;
 		break;
+	case 'y':
+		if(((type ^= Rproxy) & Rproxy) != Rproxy) return -1;
+		break;
 	case 't':
 		if(((type ^= Rtrans) & Rtrans) != Rtrans) return -1;
 		break;
@@ -905,6 +908,9 @@
 
 	if(type & Rptpt)
 		*p++ = 'p';
+
+	if(type & Rproxy)
+		*p++ = 'y';
 
 	if(type & Rtrans)
 		*p++ = 't';