Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
rtnetlink: LinkDelRequest set correct flags
Browse files Browse the repository at this point in the history
NLM_F_EXCL and NLM_F_CREATE are not valid flags for the delete request.
On kernel v5.19 there was a new delete flag NLM_F_BULK added which has
the same value as NLM_F_EXCL. This causes the kernel to respond with
EOPNOTSUPP when trying to remove an interface.

Fixes #273

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 authored and cathay4t committed Jul 11, 2022
1 parent 99b5765 commit 9dccf92
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions rtnetlink/src/link/del.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@
use futures::stream::StreamExt;

use crate::{
packet::{
LinkMessage,
NetlinkMessage,
RtnlMessage,
NLM_F_ACK,
NLM_F_CREATE,
NLM_F_EXCL,
NLM_F_REQUEST,
},
packet::{LinkMessage, NetlinkMessage, RtnlMessage, NLM_F_ACK, NLM_F_REQUEST},
try_nl,
Error,
Handle,
Expand All @@ -36,7 +28,7 @@ impl LinkDelRequest {
message,
} = self;
let mut req = NetlinkMessage::from(RtnlMessage::DelLink(message));
req.header.flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE;
req.header.flags = NLM_F_REQUEST | NLM_F_ACK;

let mut response = handle.request(req)?;
while let Some(message) = response.next().await {
Expand Down

0 comments on commit 9dccf92

Please sign in to comment.