shithub: riscv

Download patch

ref: 0a7279b3aff262493e5c80f17a540a4b5e8987a5
parent: 11fa01778a4a798b9cf6a45f216003b9aca227b3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun May 12 09:39:58 EDT 2024

devip: make "null" medium bindable

It can actually be usefull to bind this dummy
"null" medium to an address, which gives a way to
divert packets towards it that should be discarded.

--- a/sys/src/9/ip/nullmedium.c
+++ b/sys/src/9/ip/nullmedium.c
@@ -10,7 +10,6 @@
 static void
 nullbind(Ipifc*, int, char**)
 {
-	error("cannot bind null device");
 }
 
 static void
@@ -27,6 +26,7 @@
 
 Medium nullmedium =
 {
+.maxtu=		64*1024,
 .name=		"null",
 .bind=		nullbind,
 .unbind=	nullunbind,
@@ -36,6 +36,7 @@
 /* used in ipifc to prevent unbind while bind is in progress */
 Medium unboundmedium =
 {
+.maxtu=		64*1024,
 .name=		"unbound",
 .bind=		nullbind,
 .unbind=	nullunbind,