From 3bb10129da2d5eb2e72488e3d7a032df4bbf2280 Mon Sep 17 00:00:00 2001 From: Paul Wekesa Date: Fri, 27 Dec 2024 07:56:37 +0300 Subject: [PATCH 1/2] chore: add tagging for docker images Signed-off-by: Paul Wekesa --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 19a1ebab..cd57bff3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -73,5 +73,8 @@ jobs: password: ${{secrets.GITHUB_TOKEN}} - name: Build and push container image run: | - docker build . -f docker/Dockerfile --tag ghcr.io/holo-routing/holo:latest + docker build . -f docker/Dockerfile --tag ghcr.io/holo-routing/holo:latest ghcr.io/holo-routing/holo:0.6.0 + docker push ghcr.io/holo-routing/holo:latest + docker push ghcr.io/holo-routing/holo:0.6.0 + From 945e7bf200a3a9c638fcba09c2c823f72f8362cc Mon Sep 17 00:00:00 2001 From: Paul Wekesa Date: Fri, 27 Dec 2024 09:27:11 +0300 Subject: [PATCH 2/2] chore: deal with clippy issues latest nightly update has new clippy rules. Implemented here. Signed-off-by: Paul Wekesa --- holo-bfd/src/packet.rs | 4 ++-- holo-ospf/src/ospfv3/packet/mod.rs | 4 ++-- holo-vrrp/src/packet.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/holo-bfd/src/packet.rs b/holo-bfd/src/packet.rs index 04e484b0..f570d151 100644 --- a/holo-bfd/src/packet.rs +++ b/holo-bfd/src/packet.rs @@ -103,8 +103,8 @@ impl Packet { let mut buf = buf.borrow_mut(); buf.clear(); - buf.put_u8(self.version << 5 | self.diag); - buf.put_u8((self.state as u8) << 6 | self.flags.bits()); + buf.put_u8((self.version << 5) | self.diag); + buf.put_u8(((self.state as u8) << 6) | self.flags.bits()); buf.put_u8(self.detect_mult); // The length will be initialized later. buf.put_u8(0); diff --git a/holo-ospf/src/ospfv3/packet/mod.rs b/holo-ospf/src/ospfv3/packet/mod.rs index da537cf8..cde3e62b 100644 --- a/holo-ospf/src/ospfv3/packet/mod.rs +++ b/holo-ospf/src/ospfv3/packet/mod.rs @@ -915,12 +915,12 @@ fn packet_options(data: &[u8]) -> Option { match pkt_type { PacketType::Hello => { let options = &data[PacketHdr::LENGTH as usize + 6..]; - let options = (options[0] as u16) << 8 | options[1] as u16; + let options = ((options[0] as u16) << 8) | options[1] as u16; Some(Options::from_bits_truncate(options)) } PacketType::DbDesc => { let options = &data[PacketHdr::LENGTH as usize + 2..]; - let options = (options[0] as u16) << 8 | options[1] as u16; + let options = ((options[0] as u16) << 8) | options[1] as u16; Some(Options::from_bits_truncate(options)) } PacketType::LsRequest | PacketType::LsUpdate | PacketType::LsAck => { diff --git a/holo-vrrp/src/packet.rs b/holo-vrrp/src/packet.rs index 01688dc4..ae96bd01 100644 --- a/holo-vrrp/src/packet.rs +++ b/holo-vrrp/src/packet.rs @@ -217,7 +217,7 @@ impl Ipv4Hdr { let mut buf = BytesMut::new(); // ver_ihl -> version[4 bits] + ihl[4 bits] - buf.put_u8(self.version << 4 | self.ihl); + buf.put_u8((self.version << 4) | self.ihl); buf.put_u8(self.tos); buf.put_u16(self.total_length); buf.put_u16(self.identification);