Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #564

Merged
merged 10 commits into from
Nov 12, 2024
Merged

sync #564

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/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r4, bpi-r4-poe, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m]
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r3, bpi-r4, bpi-r4-poe, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m]
OMR_KERNEL: [5.4, 6.6]
runs-on: ubuntu-latest
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions iproute2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=iproute2
PKG_VERSION:=6.9.0
PKG_VERSION:=6.11.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
PKG_HASH:=2f643d09ea11a4a2a043c92e2b469b5f73228cbf241ae806760296ed0ec413d0
PKG_HASH:=1f795398a04aeaacd06a8f6ace2cfd913c33fa5953ca99daae83bb5c534611c3
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0
Expand Down
68 changes: 68 additions & 0 deletions iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From 6a77abab92516e65f07f8657fc4e384c4541ce0e Mon Sep 17 00:00:00 2001
From: Dario Binacchi <[email protected]>
Date: Sun, 22 Sep 2024 16:50:10 +0200
Subject: bridge: mst: fix a musl build issue

This patch fixes a compilation error raised by the bump to version 6.11.0
in Buildroot using musl as the C library for the cross-compilation
toolchain.

After setting the CFLGAS

ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
IPROUTE2_CFLAGS += -D__UAPI_DEF_IN6_ADDR=0 -D__UAPI_DEF_SOCKADDR_IN6=0 \
-D__UAPI_DEF_IPV6_MREQ=0
endif

to fix the following errors:

In file included from ../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/arpa/inet.h:9,
from ../include/libnetlink.h:14,
from mst.c:10:
../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:23:8: error: redefinition of 'struct in6_addr'
23 | struct in6_addr {
| ^~~~~~~~
In file included from ../include/uapi/linux/if_bridge.h:19,
from mst.c:7:
../include/uapi/linux/in6.h:33:8: note: originally defined here
33 | struct in6_addr {
| ^~~~~~~~
../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:34:8: error: redefinition of 'struct sockaddr_in6'
34 | struct sockaddr_in6 {
| ^~~~~~~~~~~~
../include/uapi/linux/in6.h:50:8: note: originally defined here
50 | struct sockaddr_in6 {
| ^~~~~~~~~~~~
../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:42:8: error: redefinition of 'struct ipv6_mreq'
42 | struct ipv6_mreq {
| ^~~~~~~~~
../include/uapi/linux/in6.h:60:8: note: originally defined here
60 | struct ipv6_mreq {

I got this further errors

../include/uapi/linux/in6.h:72:25: error: field 'flr_dst' has incomplete type
72 | struct in6_addr flr_dst;
| ^~~~~~~
../include/uapi/linux/if_bridge.h:711:41: error: field 'ip6' has incomplete type
711 | struct in6_addr ip6;
| ^~~

fixed by including the netinet/in.h header.

Signed-off-by: Dario Binacchi <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
---
bridge/mst.c | 1 +
1 file changed, 1 insertion(+)

--- a/bridge/mst.c
+++ b/bridge/mst.c
@@ -4,6 +4,7 @@
*/

#include <stdio.h>
+#include <netinet/in.h>
#include <linux/if_bridge.h>
#include <net/if.h>

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 043ef90e2fa94397eb5c85330889ca4146a6d58a Mon Sep 17 00:00:00 2001
From: Dario Binacchi <[email protected]>
Date: Sun, 22 Sep 2024 16:50:11 +0200
Subject: bridge: mst: fix a further musl build issue

This patch fixes the following build errors:

In file included from mst.c:11:
../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
80 | _PRINT_FUNC(tv, const struct timeval *)
| ^~~~~~~
../include/json_print.h:50:37: note: in definition of macro '_PRINT_FUNC'
50 | type value); \
| ^~~~
../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
80 | _PRINT_FUNC(tv, const struct timeval *)
| ^~~~~~~
../include/json_print.h:55:45: note: in definition of macro '_PRINT_FUNC'
55 | type value) \
| ^~~~
../include/json_print.h: In function 'print_tv':
../include/json_print.h:58:48: error: passing argument 5 of 'print_color_tv' from incompatible pointer type [-Wincompatible-pointer-types]
58 | value); \
| ^~~~~
| |
| const struct timeval *
../include/json_print.h:80:1: note: in expansion of macro '_PRINT_FUNC'
80 | _PRINT_FUNC(tv, const struct timeval *)
| ^~~~~~~~~~~
../include/json_print.h:50:42: note: expected 'const struct timeval *' but argument is of type 'const struct timeval *'
50 | type value); \
| ^
../include/json_print.h:80:1: note: in expansion of macro '_PRINT_FUNC'
80 | _PRINT_FUNC(tv, const struct timeval *)

Signed-off-by: Dario Binacchi <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
---
bridge/mst.c | 1 +
1 file changed, 1 insertion(+)

--- a/bridge/mst.c
+++ b/bridge/mst.c
@@ -4,6 +4,7 @@
*/

#include <stdio.h>
+#include <sys/time.h>
#include <netinet/in.h>
#include <linux/if_bridge.h>
#include <net/if.h>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Natanael Copa <[email protected]>
Date: Thu, 8 Aug 2024 09:19:01 +0200
Subject: libnetlink: fix build with musl and gcc 14

Fixes compilation error with musl libc and gcc 14:

../include/libnetlink.h: In function 'rta_getattr_be64':
../include/libnetlink.h:280:16: error: implicit declaration of function 'htobe64' [-Wimplicit-function-declaration]
280 | return htobe64(rta_getattr_u64(rta));
| ^~~~~~~

Reference: https://man7.org/linux/man-pages/man3/endian.3.html
Signed-off-by: Natanael Copa <[email protected]>
---
include/libnetlink.h | 1 +
1 file changed, 1 insertion(+)

--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -2,6 +2,7 @@
#ifndef __LIBNETLINK_H__
#define __LIBNETLINK_H__ 1

+#include <endian.h>
#include <stdio.h>
#include <string.h>
#include <asm/types.h>
8 changes: 4 additions & 4 deletions iproute2/patches/110-darwin_fixes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/netem/maketable.c
+++ b/netem/maketable.c
@@ -10,7 +10,9 @@
@@ -11,7 +11,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Expand All @@ -12,7 +12,7 @@
#include <sys/stat.h>
--- a/netem/normal.c
+++ b/netem/normal.c
@@ -8,8 +8,12 @@
@@ -9,8 +9,12 @@
#include <string.h>
#include <limits.h>

Expand All @@ -27,7 +27,7 @@
#define TABLEFACTOR NETEM_DIST_SCALE
--- a/netem/pareto.c
+++ b/netem/pareto.c
@@ -7,8 +7,12 @@
@@ -8,8 +8,12 @@
#include <math.h>
#include <limits.h>

Expand All @@ -42,7 +42,7 @@
#define TABLESIZE 16384
--- a/netem/paretonormal.c
+++ b/netem/paretonormal.c
@@ -14,10 +14,13 @@
@@ -15,10 +15,13 @@
#include <string.h>
#include <math.h>
#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/115-add-config-xtlibdir.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -128,6 +128,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
@@ -107,6 +107,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
ifneq ($(IPT_LIB_DIR),)
CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
endif
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -65,9 +65,9 @@ WFLAGS += -Wmissing-declarations -Wold-s
@@ -69,9 +69,9 @@ WFLAGS += -Wmissing-declarations -Wold-s
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
YACCFLAGS = -d -t -v

Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/140-allow_pfifo_fast.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -95,5 +95,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
@@ -90,5 +90,6 @@ struct qdisc_util pfifo_head_drop_qdisc_

struct qdisc_util pfifo_fast_qdisc_util = {
.id = "pfifo_fast",
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/140-keep_libmnl_optional.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -387,7 +387,7 @@ check_selinux()
@@ -368,7 +368,7 @@ check_tirpc()

check_mnl()
{
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/145-keep_libelf_optional.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -255,7 +255,7 @@ EOF
@@ -217,7 +217,7 @@ EOF

check_elf()
{
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/150-keep_libcap_optional.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -445,7 +445,7 @@ EOF
@@ -427,7 +427,7 @@ EOF

check_cap()
{
Expand Down
2 changes: 1 addition & 1 deletion iproute2/patches/155-keep_tirpc_optional.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -398,7 +398,7 @@ check_selinux()
@@ -355,7 +355,7 @@ check_selinux()

check_tirpc()
{
Expand Down
108 changes: 108 additions & 0 deletions iproute2/patches/170-ip_tiny.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -19,6 +19,13 @@ RTMONOBJ=rtmon.o

include ../config.mk

+STATIC_SYM_FILTER:=
+ifeq ($(IP_CONFIG_TINY),y)
+ STATIC_SYM_FILTER:=iplink_can.c iplink_ipoib.c iplink_vxlan.c
+ CFLAGS += -DIPROUTE2_TINY
+endif
+STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c))
+
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
SCRIPTS=routel
TARGETS=ip rtmon
@@ -48,7 +55,7 @@ else

ip: static-syms.o
static-syms.o: static-syms.h
-static-syms.h: $(wildcard *.c)
+static-syms.h: $(STATIC_SYM_SOURCES)
files="$^" ; \
for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -61,11 +61,17 @@ static void usage(void)
fprintf(stderr,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
" ip [ -force ] -batch filename\n"
+#ifndef IPROUTE2_TINY
"where OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp | link |\n"
" macsec | maddress | monitor | mptcp | mroute | mrule |\n"
" neighbor | neighbour | netconf | netns | nexthop | ntable |\n"
" ntbl | route | rule | sr | stats | tap | tcpmetrics |\n"
" token | tunnel | tuntap | vrf | xfrm }\n"
+#else
+ "where OBJECT := { address | help | link | maddress | monitor |\n"
+ " neighbor | neighbour | netns | route |\n"
+ " rule | stats | token | tunnel }\n"
+#endif
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
@@ -88,37 +94,49 @@ static const struct cmd {
int (*func)(int argc, char **argv);
} cmds[] = {
{ "address", do_ipaddr },
+#ifndef IPROUTE2_TINY
{ "addrlabel", do_ipaddrlabel },
+#endif
{ "maddress", do_multiaddr },
{ "route", do_iproute },
{ "rule", do_iprule },
{ "neighbor", do_ipneigh },
{ "neighbour", do_ipneigh },
+#ifndef IPROUTE2_TINY
{ "ntable", do_ipntable },
{ "ntbl", do_ipntable },
+#endif
{ "link", do_iplink },
+#ifndef IPROUTE2_TINY
{ "l2tp", do_ipl2tp },
{ "fou", do_ipfou },
{ "ila", do_ipila },
{ "macsec", do_ipmacsec },
+#endif
{ "tunnel", do_iptunnel },
{ "tunl", do_iptunnel },
+#ifndef IPROUTE2_TINY
{ "tuntap", do_iptuntap },
{ "tap", do_iptuntap },
{ "token", do_iptoken },
{ "tcpmetrics", do_tcp_metrics },
{ "tcp_metrics", do_tcp_metrics },
+#endif
{ "monitor", do_ipmonitor },
+#ifndef IPROUTE2_TINY
{ "xfrm", do_xfrm },
{ "mroute", do_multiroute },
{ "mrule", do_multirule },
+#endif
{ "netns", do_netns },
+#ifndef IPROUTE2_TINY
{ "netconf", do_ipnetconf },
{ "vrf", do_ipvrf},
{ "sr", do_seg6 },
{ "nexthop", do_ipnh },
{ "mptcp", do_mptcp },
{ "ioam", do_ioam6 },
+#endif
{ "help", do_help },
{ "stats", do_ipstats },
{ 0 }
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -3,6 +3,10 @@ include ../config.mk

CFLAGS += $(FPIC)

+ifeq ($(IP_CONFIG_TINY),y)
+ CFLAGS += -DIPROUTE2_TINY
+endif
+
UTILOBJ = utils.o utils_math.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
inet_proto.o namespace.o json_writer.o json_print.o json_print_math.o \
names.o color.o bpf_legacy.o bpf_glue.o exec.o fs.o cg_map.o ppp_proto.o
Loading