diff options
| author | pgoyette <pgoyette@NetBSD.org> | 2019-03-26 06:59:11 +0000 |
|---|---|---|
| committer | pgoyette <pgoyette@NetBSD.org> | 2019-03-26 06:59:11 +0000 |
| commit | 6bb559ad37bd7991dc9e110fbc8dfe09fd76eec0 (patch) | |
| tree | afafbf5a69f74bdcb1e71a5d9d9987911ecafdcf | |
| parent | ceaf9be1e5a87e1415788096772f1331c5ecda8f (diff) | |
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).
| -rw-r--r-- | sys/net/if_srt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_srt.c b/sys/net/if_srt.c index c057b4713c9..0e535f895b1 100644 --- a/sys/net/if_srt.c +++ b/sys/net/if_srt.c @@ -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, struct lwp *l) 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; |
