You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ab...@apache.org on 2019/04/09 15:05:56 UTC
[mesos] 01/02: Fix `link::lo()` to deal with `None` value.
This is an automated email from the ASF dual-hosted git repository.
abudnik pushed a commit to branch 1.8.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 7d7d8db9b9963e9a079bee54f06e3aac97f7910c
Author: Pavel Kirillov <49...@users.noreply.github.com>
AuthorDate: Tue Apr 9 15:44:24 2019 +0200
Fix `link::lo()` to deal with `None` value.
Some network links may cause `link::internal::test(link, IFF_LOOPBACK)`
to be `None`.
`Link::lo` should deal with `None` values of test var.
This closes #330
---
src/linux/routing/link/link.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/linux/routing/link/link.cpp b/src/linux/routing/link/link.cpp
index 9dc30c5..bff172d 100644
--- a/src/linux/routing/link/link.cpp
+++ b/src/linux/routing/link/link.cpp
@@ -99,7 +99,7 @@ Result<string> lo()
Result<bool> test = link::internal::test(link, IFF_LOOPBACK);
if (test.isError()) {
return Error("Failed to check the flag on link: " + link);
- } else if (test.get()) {
+ } else if (test.isSome() && test.get()) {
return link;
}
}