diff options
| author | Brian Somers <brian@FreeBSD.org> | 1998-05-10 10:21:11 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 1998-05-10 10:21:11 +0000 |
| commit | e8607d386f7af1f0a7c2503d4e32a53b7a33af90 (patch) | |
| tree | 1aec6418e40f7dd27a6d78b576b8e62572082cfe /usr.sbin | |
| parent | 52ff8cacf66de3bf20d22df8445916f6a3811a46 (diff) | |
Notes
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/ppp/bundle.c | 20 | ||||
| -rw-r--r-- | usr.sbin/ppp/bundle.h | 6 |
2 files changed, 17 insertions, 9 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 0b29aebdacc6..0ae522503314 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.1.2.78 1998/05/09 13:52:10 brian Exp $ + * $Id: bundle.c,v 1.1.2.79 1998/05/09 14:44:11 brian Exp $ */ #include <sys/types.h> @@ -1151,15 +1151,23 @@ bundle_GenPhysType(struct bundle *bundle) bundle->phys_type |= dl->physical->type; } -void +int bundle_DatalinkClone(struct bundle *bundle, struct datalink *dl, const char *name) { - struct datalink *ndl = datalink_Clone(dl, name); + struct datalink *ndl; - ndl->next = dl->next; - dl->next = ndl; - bundle_GenPhysType(bundle); + ndl = bundle2datalink(bundle, name); + if (!ndl) { + ndl = datalink_Clone(dl, name); + ndl->next = dl->next; + dl->next = ndl; + bundle_GenPhysType(bundle); + return 1; + } + + log_Printf(LogWARN, "Clone: %s: name already exists\n", ndl->name); + return 0; } void diff --git a/usr.sbin/ppp/bundle.h b/usr.sbin/ppp/bundle.h index 4968f4783f5a..bb181b48d642 100644 --- a/usr.sbin/ppp/bundle.h +++ b/usr.sbin/ppp/bundle.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.h,v 1.1.2.37 1998/05/06 18:50:04 brian Exp $ + * $Id: bundle.h,v 1.1.2.38 1998/05/06 23:50:02 brian Exp $ */ #define PHASE_DEAD 0 /* Link is dead */ @@ -144,8 +144,8 @@ extern void bundle_WriteTermPrompt(struct bundle *, struct datalink *, const char *, int); extern void bundle_SetTtyCommandMode(struct bundle *, struct datalink *); -extern void bundle_DatalinkClone(struct bundle *, struct datalink *, - const char *); +extern int bundle_DatalinkClone(struct bundle *, struct datalink *, + const char *); extern void bundle_DatalinkRemove(struct bundle *, struct datalink *); extern void bundle_CleanDatalinks(struct bundle *); extern void bundle_SetLabel(struct bundle *, const char *); |
