Skip to content

Commit

Permalink
Merge branch 'main' into vlan_qos_rich
Browse files Browse the repository at this point in the history
  • Loading branch information
cathay4t committed Jul 10, 2023
2 parents 2c62754 + b6de604 commit 224d5b9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog
### [0.16.0] - 2023-06-25
## [0.16.1] - 2023-07-10
### Breaking changes
- N/A

### New features
- N/A

### Bug fixes
- Use latest rust-netlink crates. (2eda618)

## [0.16.0] - 2023-06-25
### Breaking changes
- Replaced all `slave` to `port`. (bfa1ec3)
* `InfoBond::ActiveSlave` -> `InfoBond::ActivePort`
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Corentin Henry <[email protected]>"]
name = "netlink-packet-route"
version = "0.16.0"
version = "0.16.1"
edition = "2018"

homepage = "https://github.com/rust-netlink/netlink-packet-route"
Expand All @@ -18,7 +18,7 @@ rich_nlas = []
anyhow = "1.0.31"
byteorder = "1.3.2"
libc = "0.2.66"
netlink-packet-core = { version = "0.6.0" }
netlink-packet-core = { version = "0.7.0" }
netlink-packet-utils = { version = "0.5.2" }
bitflags = "1.2.1"

Expand Down
2 changes: 1 addition & 1 deletion src/rtnl/link/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod test {

let packet = LinkMessage { header, nlas };

let mut buf = vec![0; 96];
let mut buf = [0; 96];

assert_eq!(packet.buffer_len(), 96);
packet.emit(&mut buf[..]);
Expand Down
19 changes: 6 additions & 13 deletions src/rtnl/link/nlas/link_infos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1885,8 +1885,7 @@ mod tests {
#[rustfmt::skip]
#[test]
fn parse_veth_info() {
let data = vec![
0x08, 0x00, // length = 8
let data = [0x08, 0x00, // length = 8
0x01, 0x00, // type = 1 = IFLA_INFO_KIND
0x76, 0x65, 0x74, 0x68, // VETH

Expand All @@ -1909,8 +1908,7 @@ mod tests {
// NLA
0x08, 0x00, // length = 8
0x0d, 0x00, // type = IFLA_TXQLEN
0x00, 0x00, 0x00, 0x00,
];
0x00, 0x00, 0x00, 0x00];
let nla = NlaBuffer::new_checked(&data[..]).unwrap();
let parsed = VecInfo::parse(&nla).unwrap().0;
let expected = vec![
Expand All @@ -1935,8 +1933,7 @@ mod tests {
#[rustfmt::skip]
#[test]
fn parse_info_bondport() {
let data = vec![
0x09, 0x00, // length
let data = [0x09, 0x00, // length
0x04, 0x00, // IFLA_INFO_PORT_KIND
0x62, 0x6f, 0x6e, 0x64, 0x00, // V = "bond\0"
0x00, 0x00, 0x00, // padding
Expand All @@ -1950,9 +1947,7 @@ mod tests {

0x08, 0x00, // length
0x09, 0x00, // IFLA_BOND_PORT_PRIO
0x32, 0x00, 0x00, 0x00, // 50

];
0x32, 0x00, 0x00, 0x00];
let nla = NlaBuffer::new_checked(&data[..]).unwrap();
let parsed = VecInfo::parse(&nla).unwrap().0;
let expected = vec![
Expand All @@ -1967,8 +1962,7 @@ mod tests {
#[rustfmt::skip]
#[test]
fn parse_info_bond() {
let data = vec![
0x08, 0x00, // length
let data = [0x08, 0x00, // length
0x01, 0x00, // IFLA_INFO_KIND
0x62, 0x6f, 0x6e, 0x64, // "bond"

Expand Down Expand Up @@ -2031,8 +2025,7 @@ mod tests {
0x05, 0x00, // IFLA_BOND_AD_INFO_PARTNER_MAC
0x00, 0x11, 0x22, // 00:11:22:33:44:55
0x33, 0x44, 0x55,
0x00, 0x00, // padding
];
0x00, 0x00];
let nla = NlaBuffer::new_checked(&data[..]).unwrap();
let parsed = VecInfo::parse(&nla).unwrap().0;
let expected = vec![
Expand Down
2 changes: 1 addition & 1 deletion src/rtnl/link/nlas/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fn parse_af_inet() {

#[test]
fn emit_af_inet() {
let mut bytes = vec![0xff; 132];
let mut bytes = [0xff; 132];

// Note: the value is a Vec of nlas, so the padding is automatically added
// for each nla.
Expand Down
2 changes: 1 addition & 1 deletion src/rtnl/neighbour/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ mod test {

let nlas = vec![];
let packet = NeighbourMessage { header, nlas };
let mut buf = vec![0; 12];
let mut buf = [0; 12];

assert_eq!(packet.buffer_len(), 12);
packet.emit(&mut buf[..]);
Expand Down
1 change: 0 additions & 1 deletion src/rtnl/route/nlas/next_hops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use netlink_packet_utils::{
bitflags! {
#[non_exhaustive]
pub struct NextHopFlags: u8 {
const RTNH_F_EMPTY = 0;
const RTNH_F_DEAD = constants::RTNH_F_DEAD;
const RTNH_F_PERVASIVE = constants::RTNH_F_PERVASIVE;
const RTNH_F_ONLINK = constants::RTNH_F_ONLINK;
Expand Down

0 comments on commit 224d5b9

Please sign in to comment.