Skip to content

Commit d76171c

Browse files
maiquebcathay4t
authored andcommitted
linkAdd: support setting hw addr
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
1 parent 22f4950 commit d76171c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/link/add.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,12 @@ impl LinkAddRequest {
795795
self
796796
}
797797

798+
/// Define the hardware address of the link when creating it (equivalent to
799+
/// `ip link add NAME address ADDRESS`)
800+
pub fn address(self, address: Vec<u8>) -> Self {
801+
self.append_nla(LinkAttribute::Address(address))
802+
}
803+
798804
fn append_nla(mut self, nla: LinkAttribute) -> Self {
799805
self.message.attributes.push(nla);
800806
self

0 commit comments

Comments
 (0)