Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
salcock committed Jan 24, 2024
2 parents 8639aa0 + 975aec9 commit cc98f68
Show file tree
Hide file tree
Showing 10 changed files with 464 additions and 163 deletions.
94 changes: 84 additions & 10 deletions .github/workflows/pkg-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
arch:
- amd64
target:
- "debian:bookworm"
- "debian:buster"
- "debian:bullseye"
- "debian:bookworm"
- "ubuntu:bionic"
- "ubuntu:focal"
- "ubuntu:jammy"

Expand All @@ -30,16 +29,91 @@ jobs:
run: ./debpkg-setup.sh
- name: Build packages
run: ./debpkg-build.sh
- name: Store packages
- name: Set environment variables for upload
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Copy packages to uploadable location
run: |
export DIRNAME=`echo ${{ matrix.target }} | tr ':' '_'`
mkdir -p packages/${DIRNAME}
cp ../*.deb packages/${DIRNAME}/
- name: Publish packages to cloudsmith
uses: wandnz/action-cloudsmith-upload-[email protected]
- name: Store packages
uses: actions/upload-artifact@v3
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libtrace
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}
name: packages-${{ env.DIRNAME }}
path: packages/${{ env.DIRNAME }}/*.deb
retention-days: 1

test:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "debian:buster"
- "debian:bullseye"
- "ubuntu:focal"
- "ubuntu:jammy"
- "debian:bookworm"
needs: build
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages-${{ env.DIRNAME }}
- name: Add repositories
run: |
apt update -y
apt install -y apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.deb.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.deb.sh' | bash
- name: Test package install
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt update -y
find . -name "*.deb" | xargs apt install -y
- name: Test package removal
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt remove -y --purge libtrace4
publish:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "debian:buster"
- "debian:bullseye"
- "debian:bookworm"
- "ubuntu:focal"
- "ubuntu:jammy"
needs: test
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages-${{ env.DIRNAME }}
- name: Copy packages
run: |
mkdir -p packages/${DIRNAME}
find . -name "*.deb" | xargs cp -t packages/${DIRNAME}/
- name: Publish package to cloudsmith
uses: wanduow/action-cloudsmith-upload-packages@v1
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libtrace
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}
140 changes: 113 additions & 27 deletions .github/workflows/rpm-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Packaging for Centos and Fedora
name: Packaging for RPM

on:
push:
Expand All @@ -7,40 +7,126 @@ on:

jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "centos:7"
- "fedora:37"
- "fedora:38"
- "rockylinux:8"
- "rockylinux:9"


steps:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
- "fedora:39"
- "fedora:38"
- "centos:7"

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install prereq packages
run: ./rpmpkg-setup.sh ${{ matrix.target }}
- name: Build packages
run: ./rpmpkg-build.sh ${{ matrix.target }}
- name: Store packages
run: ./rpmpkg-build.sh
- name: Set environment variables for upload
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Copy packages to uploadable location
run: |
export DIRNAME=`echo ${{ matrix.target }} | tr ':' '_'`
mkdir -p packages/${DIRNAME}
cp ~/rpmbuild/RPMS/x86_64/*.rpm packages/${DIRNAME}/
- name: Publish packages to cloudsmith
uses: salcock/action-cloudsmith-upload-[email protected]
- name: Store packages
uses: actions/upload-artifact@v3
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libtrace
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}
name: packages-${{ env.DIRNAME }}
path: packages/${{ env.DIRNAME }}/*.rpm
retention-days: 1

test:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
- "fedora:39"
- "fedora:38"
- "centos:7"
needs: build
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages-${{ env.DIRNAME }}
- name: Add repositories
env:
TARGET: ${{ matrix.target }}
run: |
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.rpm.sh' | bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.rpm.sh' | bash
if [ "${TARGET}" == "centos:7" ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true
fi
if [[ "${TARGET}" =~ rocky* ]]; then
dnf install -y dnf-plugins-core epel-release || true
dnf config-manager --set-enabled powertools || true
/usr/bin/crb enable || true
fi
- name: Test package install
run: |
yum install -y findutils
find . -name "*.rpm" | xargs yum install -y
- name: Test package removal
run: |
rpm -e libtrace4-tools
rpm -e libpacketdump4-devel
rpm -e libtrace4-devel
rpm -e libpacketdump4
rpm -e libtrace4
publish:
runs-on: ubuntu-latest
container:
image: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
arch:
- amd64
target:
- "rockylinux:8"
- "rockylinux:9"
- "fedora:39"
- "fedora:38"
- "centos:7"
needs: test
steps:
- name: Set environment variables for download
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: packages-${{ env.DIRNAME }}
- name: Copy packages
run: |
mkdir -p packages/${DIRNAME}
yum install -y findutils
find . -name "*.rpm" | xargs cp -t packages/${DIRNAME}/
- name: Publish package to cloudsmith
uses: wanduow/action-cloudsmith-upload-packages@v1
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/libtrace
username: salcock
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}



2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libtrace 4.0.23
libtrace 4.0.24

Code and documentation added since version 4.0.20 is
Copyright (c) 2023 Shane Alcock and has been contributed as per
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Now you only need to update the version number in two places - below,
# and in the README

AC_INIT([libtrace],[4.0.23],[[email protected]],[libtrace])
AC_INIT([libtrace],[4.0.24],[[email protected]],[libtrace])

LIBTRACE_MAJOR=4
LIBTRACE_MID=0
LIBTRACE_MINOR=23
LIBTRACE_MINOR=24

# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
# searched by default - add it to LDFLAGS so we at least have a chance of
Expand Down
21 changes: 21 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
libtrace4 (4.0.24-1) unstable; urgency=medium

* ndagtcp: fix miscalculation of ERF header length that would
prevent packets from being able to be decoded correctly.
* traceucast: do not exit if the client disconnects, instead try to
reconnect and resume unicasting.
* traceucast: fix memory errors when attempting to send a captured
packet that is larger than 10K bytes.
* ndagtcp: fix issue that would cause input to silently stop reading
if it received a packet larger than 10K bytes.
* ndagtcp: fix lock-up that occurred when trying to halt a program
that was reading from an ndagtcp input.
* ndagtcp: fix erroneous "Malformed beacon" message when an ndagtcp
input reconnects to traceucast.
* traceucast: fix getaddrinfo memory leak.
* traceucast: fix endless reconnection loop bug.
* traceucast: fix race condition that would prevent Ctrl-C from
halting traceucast properly.

-- Shane Alcock <[email protected]> Wed, 24 Jan 2024 13:43:51 +1300

libtrace4 (4.0.23-1) unstable; urgency=medium

* Add new tool: traceucast, a TCP unicast variant of tracemcast.
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ endif

AM_CPPFLAGS= @ADD_INCLS@
libtrace_la_LIBADD = @LIBTRACE_LIBS@ @LTLIBOBJS@ $(DPDKLIBS)
libtrace_la_LDFLAGS=-version-info 7:7:0 @ADD_LDFLAGS@
libtrace_la_LDFLAGS=-version-info 7:8:0 @ADD_LDFLAGS@
dagapi.c:
cp @DAG_TOOLS_DIR@/dagapi.c .

Expand Down
1 change: 1 addition & 0 deletions lib/format_erf.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ int erf_get_padding(const libtrace_packet_t *packet)
case TRACE_FORMAT_NDAG:
case TRACE_FORMAT_RAWERF:
case TRACE_FORMAT_DPDK_NDAG:
case TRACE_FORMAT_NDAG_TCP:
switch((erfptr->type & 0x7f)) {
case TYPE_ETH:
case TYPE_COLOR_ETH:
Expand Down
11 changes: 5 additions & 6 deletions lib/format_ndag.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "format_ndag.h"

#define NDAG_IDLE_TIMEOUT (600)
#define ENCAP_BUFSIZE (10000)
#define ENCAP_BUFSIZE (65536)
#define CTRL_BUF_SIZE (10000)
#define ENCAP_BUFFERS (1000)

Expand Down Expand Up @@ -440,7 +440,7 @@ static int ndag_parse_control_message(libtrace_t *libtrace, char *msgbuf,
numstreams = ntohs(*ptr);
ptr ++;

if ((uint32_t)msgsize != ((numstreams + 1) * sizeof(uint16_t)))
if ((uint32_t)msgsize < ((numstreams + 1) * sizeof(uint16_t)))
{
fprintf(stderr, "Malformed beacon (length doesn't match number of streams).\n");
fprintf(stderr, "%u %u\n", msgsize, numstreams);
Expand Down Expand Up @@ -556,7 +556,7 @@ static int accept_ndagtcp_connection(libtrace_t *libtrace,

fcntl(sock, F_SETFL, O_NONBLOCK);

while (is_halted(libtrace) == -1) {
while (is_halted(libtrace) == -1 && !ndag_paused) {
r = select_on_sock(sock);
if (r < 0) {
fprintf(stderr, "Error in select while accepting connection on socket for %s:%s -- %s\n",
Expand Down Expand Up @@ -1098,7 +1098,7 @@ static int ndag_prepare_packet_stream_encaperf(libtrace_t *restrict libtrace,
nr = ssock->nextreadind;
available = ssock->savedsize[nr] - (ssock->nextread - ssock->saved[nr]);

if (ssock->nextrlen == 0 || ssock->nextrlen > ENCAP_BUFSIZE) {
if (ssock->nextrlen == 0) {
return -1;
}

Expand Down Expand Up @@ -1175,7 +1175,7 @@ static int ndag_prepare_packet_stream_corsarotag(libtrace_t *restrict libtrace,
nr = ssock->nextreadind;
available = ssock->savedsize[nr] - (ssock->nextread - ssock->saved[nr]);

if (ssock->nextrlen == 0 || ssock->nextrlen > ENCAP_BUFSIZE) {
if (ssock->nextrlen == 0) {
return -1;
}

Expand Down Expand Up @@ -1574,7 +1574,6 @@ static int receive_from_single_socket(streamsock_t *ssock, struct timeval *tv,
ssock->sock = -1;
return 0;
}

ssock->startidle = 0;

ssock->savedsize[ssock->nextwriteind] = ret;
Expand Down
Loading

0 comments on commit cc98f68

Please sign in to comment.