summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-04-26 20:12:50 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-04-26 20:55:57 +0200
commit9bf4a7b3e3c44ef8cc255b27d2c6d74af95f73ce (patch)
tree0f3efebf7d3b26b04953bd49dea013b8597ca640 /src/Network
parentdab23fd7890ea2c27096015bb49ec526fafa14c7 (diff)
Use link objects for disconnect commands
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/Ip.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/Ip.hs b/src/Network/Ip.hs
index 13fc284..e3d95cb 100644
--- a/src/Network/Ip.hs
+++ b/src/Network/Ip.hs
@@ -130,10 +130,10 @@ addAddress link addr@(IpAddress prefix _) = do
let bcast = IpAddress prefix 255
postpone $ callOn link $ "ip addr add " <> textIpAddressCidr addr <> " broadcast " <> textIpAddress bcast <> " dev \"" <> linkName link <> "\""
-setMaster :: (MonadPIO m, MonadFail m) => Link a -> Link Bridge -> m ()
-setMaster link bridge = do
+setMaster :: MonadPIO m => Link a -> Link Bridge -> m ()
+setMaster link bridge = postpone $ do
when (getNetns link /= getNetns bridge) $ fail "link and bridge in different network namespaces"
- postpone $ callOn link $ "ip link set dev \"" <> linkName link <> "\" master \"" <> linkName bridge <> "\""
+ callOn link $ "ip link set dev \"" <> linkName link <> "\" master \"" <> linkName bridge <> "\""
linkUp :: MonadPIO m => Link a -> m ()
linkUp link = do