Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rootless-containers/slirp4netns
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca1aee3a5594086274f4400a27eab94d40a81f3a
Choose a base ref
..
head repository: rootless-containers/slirp4netns
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 57c3ee990e871cca376398e110c0730c993b1b93
Choose a head ref
Showing with 24 additions and 2 deletions.
  1. +1 −1 Vagrantfile
  2. +3 −1 main.c
  3. +5 −0 tests/test-slirp4netns-hostfwd.sh
  4. +5 −0 tests/test-slirp4netns-hostfwd4.sh
  5. +5 −0 tests/test-slirp4netns-hostfwd6.sh
  6. +5 −0 tests/test-slirp4netns-ipv6.sh
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Vagrant.configure("2") do |config|
autoconf automake make gcc gperf libtool \
git-core meson ninja-build \
glib2-devel libcap-devel openssl-devel \
git-core libtool iproute iputils iperf3 nmap jq
git-core libtool iproute iputils iperf3 nmap jq socat
# TODO: install udhcpc (required by test-slirp4netns-dhcp.sh)
4 changes: 3 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
@@ -992,6 +992,8 @@ static int parse_cidr6(struct in6_addr *network, struct in6_addr *netmask,
sprefix[INET6_ADDRSTRLEN];
int prefix;
const char *random;
int i;

rc = regcomp(&r, cidr_regex, REG_EXTENDED);
if (rc != 0) {
fprintf(stderr, "internal regex error\n");
@@ -1034,7 +1036,7 @@ static int parse_cidr6(struct in6_addr *network, struct in6_addr *netmask,
goto finish;
}

for (int i = 0; i < 4; i++, prefix -= 32) {
for (i = 0; i < 4; i++, prefix -= 32) {
if (prefix >= 32) {
netmask->s6_addr32[i] = 0xffffffff;
} else if (prefix > 0) {
5 changes: 5 additions & 0 deletions tests/test-slirp4netns-hostfwd.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ if [ "${SLIRP_CONFIG_VERSION_MAX:-0}" -lt 3 ]; then
exit "$TEST_EXIT_CODE_SKIP"
fi

if ! ip a | grep inet6 > /dev/null; then
printf "forwarding test requires ipv6 enabled on host. Test skipped..."
exit "$TEST_EXIT_CODE_SKIP"
fi

host_port=8080
guest_port=1080
cidr=fd00:a1e1:1724:1a
5 changes: 5 additions & 0 deletions tests/test-slirp4netns-hostfwd4.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ if [ "${SLIRP_CONFIG_VERSION_MAX:-0}" -lt 3 ]; then
exit "$TEST_EXIT_CODE_SKIP"
fi

if ! ip a | grep inet6 > /dev/null; then
printf "forwarding test requires ipv6 enabled on host. Test skipped..."
exit "$TEST_EXIT_CODE_SKIP"
fi

host_port=8080
guest_port=1080

5 changes: 5 additions & 0 deletions tests/test-slirp4netns-hostfwd6.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ if [ "${SLIRP_CONFIG_VERSION_MAX:-0}" -lt 3 ]; then
exit "$TEST_EXIT_CODE_SKIP"
fi

if ! ip a | grep inet6 > /dev/null; then
printf "forwarding test requires ipv6 enabled on host. Test skipped..."
exit "$TEST_EXIT_CODE_SKIP"
fi

host_port=8080
guest_port=1080
cidr=fd00:a1e1:1724:1a
5 changes: 5 additions & 0 deletions tests/test-slirp4netns-ipv6.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ if [ "${SLIRP_CONFIG_VERSION_MAX:-0}" -lt 3 ]; then
exit "$TEST_EXIT_CODE_SKIP"
fi

if ! ip a | grep inet6 > /dev/null; then
printf "ipv6 test requires ipv6 enabled on host. Test skipped..."
exit "$TEST_EXIT_CODE_SKIP"
fi

host_port=8080
guest_port=80
cidr=fd00:a1e1:1724:1a