Module Name: src
Committed By: pgoyette
Date: Tue Mar 26 06:59:11 UTC 2019
Modified Files:
src/sys/net: if_srt.c
Log Message:
Add cloned-interface-create code to srt open() routine so behavior
matches that which is documented in srtconfig(1) man page. Without
this, srt only works if you first create the srtN interface with
ifconfig(8).
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/net/if_srt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_srt.c
diff -u src/sys/net/if_srt.c:1.28 src/sys/net/if_srt.c:1.29
--- src/sys/net/if_srt.c:1.28 Tue Mar 26 00:23:32 2019
+++ src/sys/net/if_srt.c Tue Mar 26 06:59:11 2019
@@ -1,8 +1,8 @@
-/* $NetBSD: if_srt.c,v 1.28 2019/03/26 00:23:32 pgoyette Exp $ */
+/* $NetBSD: if_srt.c,v 1.29 2019/03/26 06:59:11 pgoyette Exp $ */
/* This file is in the public domain. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.28 2019/03/26 00:23:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.29 2019/03/26 06:59:11 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -401,6 +401,10 @@ srt_open(dev_t dev, int flag, int mode,
if (unit < 0 || unit > SRT_MAXUNIT)
return ENXIO;
sc = softcv[unit];
+ if (sc == NULL) {
+ (void)srt_clone_create(&srt_clone, minor(dev));
+ sc = softcv[unit];
+ }
if (! sc)
return ENXIO;
sc->kflags |= SKF_CDEVOPEN;