Skip to content

Commit 9981be3

Browse files
committed
libteam: add new package
libteam is a userspace tool to configure Linux network teaming. Signed-off-by: Qingfang Deng <[email protected]>
1 parent 0ca33e7 commit 9981be3

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed

net/libteam/Makefile

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=libteam
4+
PKG_VERSION:=1.32
5+
PKG_RELEASE:=1
6+
7+
PKG_SOURCE_URL:=https://codeload.github.com/jpirko/libteam/tar.gz/refs/tags/v$(PKG_VERSION)?
8+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
9+
PKG_HASH:=7ad90555db8aecdcaf002f543d330408501600edf7065e0ca398fce9b1e64820
10+
11+
PKG_FIXUP:=autoreconf
12+
PKG_INSTALL:=1
13+
PKG_BUILD_PARALLEL:=1
14+
PKG_BUILD_FLAGS:=lto
15+
16+
PKG_LICENSE:=LGPL-2.1-only
17+
PKG_LICENSE_FILES:=COPYING
18+
19+
PKG_MAINTAINER:=Qingfang Deng <[email protected]>
20+
21+
include $(INCLUDE_DIR)/package.mk
22+
23+
CONFIGURE_ARGS+=--disable-static
24+
25+
define Package/libteam/default
26+
SECTION:=libs
27+
CATEGORY:=Libraries
28+
URL:=https://github.com/jpirko/libteam
29+
endef
30+
31+
define Package/libteam
32+
$(Package/libteam/default)
33+
TITLE:=Team common library
34+
DEPENDS:=+kmod-team +libnl-cli
35+
ABI_VERSION:=5
36+
endef
37+
38+
define Package/libteam/description
39+
Libteam lib is a userspace wrapper of Team Netlink communication.
40+
endef
41+
42+
define Package/libteamdctl
43+
$(Package/libteam/default)
44+
TITLE:=Team daemon control library
45+
ABI_VERSION:=0
46+
endef
47+
48+
define Package/libteamdctl/description
49+
Common library for teamdctl.
50+
endef
51+
52+
define Package/teamd/default
53+
SECTION:=net
54+
CATEGORY:=Network
55+
URL:=https://github.com/jpirko/libteam
56+
endef
57+
58+
define Package/teamd
59+
$(Package/teamd/default)
60+
TITLE:=Team daemon
61+
DEPENDS:=+libteam +libdaemon +jansson
62+
endef
63+
64+
define Package/teamd/description
65+
teamd is a daemon to control a given team network device, during runtime,
66+
as a puppeteer controls a puppet. It uses libteam to communicate with the
67+
kernel team device instance via Netlink sockets. The behaviour depends on
68+
the selected runner and its configuration.
69+
endef
70+
71+
define Package/teamdctl
72+
$(Package/teamd/default)
73+
TITLE:=Team daemon control tool
74+
DEPENDS:=+teamd +libteamdctl
75+
endef
76+
77+
define Package/teamdctl/description
78+
teamdctl is a tool that allows a user to interact with a running teamd instance.
79+
endef
80+
81+
define Package/teamnl
82+
$(Package/teamd/default)
83+
TITLE:=Team Netlink interface tool
84+
DEPENDS:=+libteam
85+
endef
86+
87+
define Package/teamnl/description
88+
teamnl is a tool enabling interaction with a team device via the team driver
89+
Netlink interface. This tools serves mainly for debugging purposes. Note that
90+
it makes no sense to use this tool to change options on team device controlled
91+
by a teamd instance.
92+
endef
93+
94+
define Build/InstallDev
95+
$(INSTALL_DIR) $(1)/usr
96+
$(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr
97+
$(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr
98+
endef
99+
100+
define Package/libteam/install
101+
$(INSTALL_DIR) $(1)/usr/lib
102+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libteam.so* $(1)/usr/lib/
103+
endef
104+
105+
define Package/libteamdctl/install
106+
$(INSTALL_DIR) $(1)/usr/lib
107+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libteamdctl.so* $(1)/usr/lib/
108+
endef
109+
110+
define Package/teamd/install
111+
$(INSTALL_DIR) $(1)/usr/bin
112+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamd $(1)/usr/bin/
113+
endef
114+
115+
define Package/teamdctl/install
116+
$(INSTALL_DIR) $(1)/usr/bin
117+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamdctl $(1)/usr/bin/
118+
endef
119+
120+
define Package/teamnl/install
121+
$(INSTALL_DIR) $(1)/usr/bin
122+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamnl $(1)/usr/bin/
123+
endef
124+
125+
$(eval $(call BuildPackage,libteam))
126+
$(eval $(call BuildPackage,libteamdctl))
127+
$(eval $(call BuildPackage,teamd))
128+
$(eval $(call BuildPackage,teamdctl))
129+
$(eval $(call BuildPackage,teamnl))
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 4eb54a811bef43da2be9cc84009567e5d6ca9741 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Sat, 11 May 2024 23:15:59 -0700
4+
Subject: [PATCH] teamd: Pass correct parameter type to accept API
5+
6+
accept() expects sockaddr as second parameter
7+
8+
int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
9+
10+
Fixes build with gcc-16 on musl systems
11+
| ../../git/teamd/teamd_usock.c: In function 'callback_usock':
12+
| ../../git/teamd/teamd_usock.c:280:40: error: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
13+
| 280 | sock = accept(ctx->usock.sock, &addr, &alen);
14+
| | ^~~~~
15+
| | |
16+
| | struct sockaddr_un *
17+
18+
Signed-off-by: Khem Raj <[email protected]>
19+
Signed-off-by: Jiri Pirko <[email protected]>
20+
---
21+
teamd/teamd_usock.c | 2 +-
22+
1 file changed, 1 insertion(+), 1 deletion(-)
23+
24+
--- a/teamd/teamd_usock.c
25+
+++ b/teamd/teamd_usock.c
26+
@@ -277,7 +277,7 @@ static int callback_usock(struct teamd_c
27+
int err;
28+
29+
alen = sizeof(addr);
30+
- sock = accept(ctx->usock.sock, &addr, &alen);
31+
+ sock = accept(ctx->usock.sock, (struct sockaddr *)&addr, &alen);
32+
if (sock == -1) {
33+
teamd_log_err("usock: Failed to accept connection.");
34+
return -errno;

0 commit comments

Comments
 (0)