Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Add cloned-interface-create code to srt open() routi...



details:   https://anonhg.NetBSD.org/src/rev/141f0699a2f8
branches:  trunk
changeset: 449839:141f0699a2f8
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Mar 26 06:59:11 2019 +0000

description:
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).

diffstat:

 sys/net/if_srt.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r c9d672b2db17 -r 141f0699a2f8 sys/net/if_srt.c
--- a/sys/net/if_srt.c  Tue Mar 26 05:17:17 2019 +0000
+++ b/sys/net/if_srt.c  Tue Mar 26 06:59:11 2019 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index