Skip to content

Commit 2ccc394

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 2ccc394

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed

net/libteam/Makefile

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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/libteamdctl
39+
$(Package/libteam/default)
40+
TITLE:=Team daemon control library
41+
ABI_VERSION:=0
42+
endef
43+
44+
define Package/teamd/default
45+
SECTION:=net
46+
CATEGORY:=Network
47+
URL:=https://github.com/jpirko/libteam
48+
endef
49+
50+
define Package/teamd
51+
$(Package/teamd/default)
52+
TITLE:=Team daemon
53+
DEPENDS:=+libteam +libdaemon +jansson
54+
endef
55+
56+
define Package/teamdctl
57+
$(Package/teamd/default)
58+
TITLE:=Team daemon control tool
59+
DEPENDS:=+teamd +libteamdctl
60+
endef
61+
62+
define Package/teamnl
63+
$(Package/teamd/default)
64+
TITLE:=Team Netlink interface tool
65+
DEPENDS:=+libteam
66+
endef
67+
68+
define Build/InstallDev
69+
$(INSTALL_DIR) $(1)/usr
70+
$(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr
71+
$(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr
72+
endef
73+
74+
define Package/libteam/install
75+
$(INSTALL_DIR) $(1)/usr/lib
76+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libteam.so* $(1)/usr/lib/
77+
endef
78+
79+
define Package/libteamdctl/install
80+
$(INSTALL_DIR) $(1)/usr/lib
81+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libteamdctl.so* $(1)/usr/lib/
82+
endef
83+
84+
define Package/teamd/install
85+
$(INSTALL_DIR) $(1)/usr/bin
86+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamd $(1)/usr/bin/
87+
endef
88+
89+
define Package/teamdctl/install
90+
$(INSTALL_DIR) $(1)/usr/bin
91+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamdctl $(1)/usr/bin/
92+
endef
93+
94+
define Package/teamnl/install
95+
$(INSTALL_DIR) $(1)/usr/bin
96+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamnl $(1)/usr/bin/
97+
endef
98+
99+
$(eval $(call BuildPackage,libteam))
100+
$(eval $(call BuildPackage,libteamdctl))
101+
$(eval $(call BuildPackage,teamd))
102+
$(eval $(call BuildPackage,teamdctl))
103+
$(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)