Skip to content

Commit aab72b5

Browse files
CA-151464: Don't check the contents of the bond slaves file
Signed-off-by: Si Beaumont <[email protected]>
1 parent 2738b79 commit aab72b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/network_utils.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,8 @@ module Linux_bonding = struct
459459
let master_symlink = Sysfs.getpath slave "master" in
460460
let master_path = Unix.readlink master_symlink in
461461
let slaves_path = Filename.concat master_symlink "bonding/slaves" in
462-
let slaves = Sysfs.read_one_line slaves_path |> String.split ' ' in
463-
if List.mem slave slaves
464-
then Some (List.hd (List.rev (String.split '/' master_path)))
465-
else None
462+
Unix.access slaves_path [ Unix.F_OK ];
463+
Some (List.hd (List.rev (String.split '/' master_path)))
466464
with _ -> None
467465
end
468466

0 commit comments

Comments
 (0)