Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- os: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate
Expand Down
101 changes: 52 additions & 49 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run minimal test set
run: |
./autogen.sh
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Make the makefiles
run: |
Expand All @@ -44,14 +44,14 @@ jobs:
name: Test Linux
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install essential
run: |
Expand Down Expand Up @@ -85,39 +85,40 @@ jobs:

- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tests-out
name: tests-out-${{ matrix.os }}
path: tests

- name: Generate coverage reports
run: |
rm -f a-conftest.gcno a-conftest.gcda
make gcov
make cover COVERAGEDIR=coverage/${{ matrix.os }}
shell: bash

- name: Upload gcovr report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-${{ matrix.os }}
path: coverage

- name: Upload data to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4

test_macos:
needs: smoketest
name: Test MacOS
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os:
- macos-11
- macos-12
- macos-14
- macos-15

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install packages
run: |
Expand Down Expand Up @@ -150,9 +151,9 @@ jobs:

- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tests-out
name: tests-out-${{ matrix.os }}
path: tests

- name: Generate coverage reports
Expand All @@ -169,27 +170,27 @@ jobs:
shell: bash

# - name: Upload gcovr report artifact
# uses: actions/upload-artifact@v2
# uses: actions/upload-artifact@v4
# with:
# name: coverage
# name: coverage-${{ matrix.os }}
# path: coverage

- name: Upload data to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4

test_windows:
needs: smoketest
name: Test Windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
- windows-2025

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: generate a makefile and use it to install more packages
run: |
Expand Down Expand Up @@ -218,18 +219,19 @@ jobs:

- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tests-out
name: tests-out-${{ matrix.os }}
path: tests

- name: Generate coverage data
run: |
make gcov
make gcov || true
shell: bash

- name: Upload data to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
continue-on-error: true

package_dpkg:
name: Package for Debian/Ubuntu
Expand All @@ -246,7 +248,7 @@ jobs:
- i386

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -280,9 +282,9 @@ jobs:
make

- name: Upload dpkg
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: packages-dpkg
name: packages-dpkg-${{ matrix.arch }}
path: packages/debian/*.deb

package_rpm:
Expand All @@ -292,7 +294,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -321,7 +323,7 @@ jobs:
mv ../rpmbuild ./

- name: Upload rpm
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: packages-rpm
path: rpmbuild/RPMS/x86_64/*.rpm
Expand All @@ -333,7 +335,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fix Checkout
run: |
Expand All @@ -351,9 +353,9 @@ jobs:
make install DESTDIR=binaries/x86_64-pc-mingw64

- name: Upload binary artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: binaries
name: binaries-windows
path: binaries

binaries_macos:
Expand All @@ -369,7 +371,7 @@ jobs:
- arm64-apple-macos

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fix Checkout
run: |
Expand All @@ -393,7 +395,7 @@ jobs:

- if: ${{ failure() }}
name: Upload config.log output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: config-log-${{ matrix.arch }}
path: config.log
Expand All @@ -404,9 +406,9 @@ jobs:
make install DESTDIR=binaries/${{ matrix.arch }}

- name: Upload binary artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: binaries
name: binaries-macos-${{ matrix.arch }}
path: binaries

binaries_macos_universal:
Expand All @@ -416,7 +418,7 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fix Checkout
run: |
Expand Down Expand Up @@ -444,9 +446,9 @@ jobs:
make install DESTDIR=binaries/universal-apple-darwin

- name: Upload binary artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: binaries
name: binaries-macos-universal
path: binaries

binaries_linux_crosscompile:
Expand All @@ -469,7 +471,7 @@ jobs:
- mipsel-linux-gnu

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fix Checkout
run: |
Expand Down Expand Up @@ -497,9 +499,9 @@ jobs:
make install DESTDIR=binaries/${{ matrix.arch }}

- name: Upload binary artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: binaries
name: binaries-linux-${{ matrix.arch }}
path: binaries

# Given the clearly documented use of annotated tags to signal releases,
Expand All @@ -526,7 +528,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fix Checkout
run: |
Expand All @@ -536,22 +538,23 @@ jobs:
id: get_tagtype
run: |
TYPE=$(git cat-file -t $GITHUB_REF)
echo "::set-output name=TAGTYPE::$TYPE"
echo "TAGTYPE=$TYPE" >> "$GITHUB_OUTPUT"
echo ==========
echo REF=$GITHUB_REF
echo TAGTYPE=$TYPE

- name: Fetch all Artifacts
if: steps.get_tagtype.outputs.TAGTYPE == 'tag'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Upload Assets to Release
if: steps.get_tagtype.outputs.TAGTYPE == 'tag'
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: true
files: |
artifacts/packages-dpkg/*.deb
artifacts/packages-dpkg*/*.deb
artifacts/packages-rpm/*.rpm
4 changes: 2 additions & 2 deletions include/n2n.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
#include <netdb.h>
#endif

#ifndef _MSC_VER
#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <getopt.h>
#endif /* #ifndef _MSC_VER */
#endif

#include <stdio.h>
#include <errno.h>
Expand Down
6 changes: 3 additions & 3 deletions include/n2n_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ enum sn_purge {SN_PURGEABLE = 0, SN_UNPURGEABLE = 1};
#define DEFAULT_MTU 1290

#define HASH_ADD_PEER(head,add) \
HASH_ADD(hh,head,mac_addr,sizeof(n2n_mac_t),add)
HASH_ADD(hh,head,mac_addr,sizeof(n2n_mac_t),add)
#define HASH_FIND_PEER(head,mac,out) \
HASH_FIND(hh,head,mac,sizeof(n2n_mac_t),out)
HASH_FIND(hh,head,mac,sizeof(n2n_mac_t),out)
#define N2N_EDGE_SN_HOST_SIZE 48
#define N2N_EDGE_SUP_ATTEMPTS 3 /* Number of failed attmpts before moving on to next supernode. */
#define N2N_PATHNAME_MAXLEN 256
Expand Down Expand Up @@ -196,7 +196,7 @@ enum skip_add {SN_ADD = 0, SN_ADD_SKIP = 1, SN_ADD_ADDED = 2};
#define N2N_IFNAMSIZ 16 /* 15 chars * NULL */
#endif

#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__MINGW32__)
#define N2N_THREAD_RETURN_DATATYPE DWORD WINAPI
#define N2N_THREAD_PARAMETER_DATATYPE LPVOID
#else
Expand Down
4 changes: 4 additions & 0 deletions include/portable_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#endif

#if defined(__WINDOWS__)
# include <stdlib.h>
#endif

#if defined(__linux__) || defined(__CYGWIN__)
/* Define necessary macros for the header to expose all fields. */
# if !defined(_BSD_SOURCE)
Expand Down
4 changes: 2 additions & 2 deletions scripts/n2n-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class JsonUDP():

# TODO: We assume the first packet we get will be tagged for us
# and be either an "error" or a "begin"
assert(data['_tag'] == tagstr)
assert data['_tag'] == tagstr

if data['_type'] == 'error':
raise ValueError('Error: {}'.format(data['error']))

assert(data['_type'] == 'begin')
assert data['_type'] == 'begin'

# Ideally, we would confirm that this is our "begin", but that
# would need the cmd passed into this method, and that would
Expand Down
Loading
Loading