commit | 3142f646ac879eacd25daa1ec22f6c8e14069ceb | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@ak.jp.nec.com> | Wed Jun 07 11:12:45 2017 -0700 |
committer | Yuta HIGUCHI <y-higuchi@onlab.us> | Fri Jun 09 17:27:31 2017 +0000 |
tree | b1bca22fd550499799a0709174f5f8c26bc2ec07 | |
parent | 2ad387d7a0d2b495dda6990bb296401bb3b87c98 [diff] |
Avoid accidental link type override Change-Id: I3462838f8208c231f7b7ff24e63a03984fae4475
diff --git a/core/net/src/main/java/org/onosproject/net/link/impl/BasicLinkOperator.java b/core/net/src/main/java/org/onosproject/net/link/impl/BasicLinkOperator.java index 7795f77..9247b83 100644 --- a/core/net/src/main/java/org/onosproject/net/link/impl/BasicLinkOperator.java +++ b/core/net/src/main/java/org/onosproject/net/link/impl/BasicLinkOperator.java
@@ -58,11 +58,11 @@ return descr; } - // cfg.type() defaults to DIRECT, so there is a risk of unwanted override. - // do we want this behavior? Link.Type type = descr.type(); - if (cfg.type() != type) { - type = cfg.type(); + if (cfg.isTypeConfigured()) { + if (cfg.type() != type) { + type = cfg.type(); + } } SparseAnnotations sa = combine(cfg, descr.annotations());