Skip to content

Commit

Permalink
Bump to Alpine 3.20, Fedora 40, FreeBSD 13.4 and 14.1 (#1588)
Browse files Browse the repository at this point in the history
* Bump to Alpine 3.20

* Bump to Fedora 40

* ci: bump FreeBSD to 13.4 and 14.1

* pcap++: pcaplivedevice avoid variable-length arrays
  • Loading branch information
clementperon authored Sep 24, 2024
1 parent 20974e6 commit 26ced48
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
config-zstd: OFF
- image: ubuntu2004-zstd
config-zstd: ON
- image: fedora39
- image: fedora40
config-zstd: OFF
- image: alpine317
- image: alpine320
config-zstd: OFF

steps:
Expand Down Expand Up @@ -585,12 +585,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["14.0", "13.2"]
version: ["14.1", "13.4"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Test in FreeBSD
id: test
uses: vmactions/freebsd-vm@12c207ac1ba13827f25726fe93f9c2e6f685f0f3 # v1.0.8
uses: vmactions/freebsd-vm@d7b8fcc7711aa41ad45e8d9b737cf90f035a7e3d # v1.1.3
with:
release: ${{ matrix.version }}
usesh: true
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
config-zstd: OFF
- image: rhel94
config-zstd: OFF
- image: fedora39
- image: fedora40
config-zstd: OFF
- image: alpine317
- image: alpine320
config-zstd: OFF

steps:
Expand Down Expand Up @@ -93,17 +93,16 @@ jobs:
id-token: write
strategy:
matrix:
include:
- freebsd-version: "13.2"
- freebsd-version: "14.0"
version: ["14.1", "13.4"]

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Test in FreeBSD
uses: vmactions/freebsd-vm@12c207ac1ba13827f25726fe93f9c2e6f685f0f3 # v1.0.8
uses: vmactions/freebsd-vm@d7b8fcc7711aa41ad45e8d9b737cf90f035a7e3d # v1.1.3
with:
release: ${{ matrix.freebsd-version }}
release: ${{ matrix.version }}
envs: 'BUILD_DIR'
usesh: true
prepare: |
Expand Down
6 changes: 3 additions & 3 deletions Pcap++/src/PcapLiveDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,15 +1011,15 @@ namespace pcpp
return;
}

uint8_t buf[len];
std::vector<uint8_t> buf(len);

if (sysctl(mib, 6, buf, &len, nullptr, 0) < 0)
if (sysctl(mib, 6, buf.data(), &len, nullptr, 0) < 0)
{
PCPP_LOG_DEBUG("Error in retrieving MAC address: sysctl 2 error");
return;
}

struct if_msghdr* ifm = (struct if_msghdr*)buf;
struct if_msghdr* ifm = (struct if_msghdr*)buf.data();
struct sockaddr_dl* sdl = (struct sockaddr_dl*)(ifm + 1);
uint8_t* ptr = (uint8_t*)LLADDR(sdl);
m_MacAddress = MacAddress(ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
Expand Down

0 comments on commit 26ced48

Please sign in to comment.