From 9bf4a7b3e3c44ef8cc255b27d2c6d74af95f73ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 26 Apr 2023 20:12:50 +0200 Subject: Use link objects for disconnect commands --- src/Network/Ip.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Network') 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 -- cgit v1.2.3