This is an automated email from the ASF dual-hosted git repository.

abudnik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 0dbb535  Fix `link::lo()` to deal with `None` value.
0dbb535 is described below

commit 0dbb535fa7a6790d824c75df1b79917343403115
Author: Pavel Kirillov <49415588+pashakiril...@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;
     }
   }

Reply via email to