• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff -urN libnl/lib/utils.c libnl-libnl3_11_0-new/lib/utils.c
2--- libnl/lib/utils.c	2024-10-30 15:13:01.000000000 +0800
3+++ libnl-libnl3_11_0-new/lib/utils.c	2025-06-18 10:02:10.472222700 +0800
4@@ -279,8 +279,8 @@
5
6 int nl_rate2str(unsigned long long rate, int type, char *buf, size_t len)
7 {
8-	char *unit;
9-	double frac;
10+	char *unit = NULL;
11+	double frac = 0.0;
12
13 	switch (type) {
14 	case NL_BYTE_RATE:
15@@ -427,6 +427,7 @@
16 	}
17
18 	BUG();
19+	return buf;
20 }
21
22 /**
23diff -urN libnl/lib/route/mdb.c libnl-libnl3_11_0-new/lib/route/mdb.c
24--- libnl/lib/route/mdb.c	2024-10-30 15:13:01.000000000 +0800
25+++ libnl-libnl3_11_0-new/lib/route/mdb.c	2025-06-18 10:08:22.230880000 +0800
26@@ -5,7 +5,7 @@
27
28 #include "nl-default.h"
29
30-#include <linux/if_bridge.h>
31+#include <linux-private/linux/if_bridge.h>
32
33 #include <netlink/netlink.h>
34 #include <netlink/route/mdb.h>
35diff -urN libnl/lib/route/neigh.c libnl-libnl3_11_0-new/lib/route/neigh.c
36--- libnl/lib/route/neigh.c	2024-10-30 15:13:01.000000000 +0800
37+++ libnl-libnl3_11_0-new/lib/route/neigh.c	2025-06-18 10:14:10.647307300 +0800
38@@ -461,10 +461,12 @@
39 		neigh->ce_mask |= NEIGH_ATTR_NHID;
40 	}
41
42+#ifdef OPEN_HARMONY_UPDATE_ADAPT_KERNEL_VERSION
43 	if (tb[NDA_FLAGS_EXT]) {
44 		neigh->n_ext_flags = nla_get_u32(tb[NDA_FLAGS_EXT]);
45 		neigh->ce_mask |= NEIGH_ATTR_EXT_FLAGS;
46 	}
47+#endif
48
49 	/*
50 	 * Get the bridge index for AF_BRIDGE family entries
51@@ -777,6 +779,7 @@
52 	if (tmpl->ce_mask & NEIGH_ATTR_NHID)
53 		NLA_PUT_U32(msg, NDA_NH_ID, tmpl->n_nhid);
54
55+#ifdef OPEN_HARMONY_UPDATE_ADAPT_KERNEL_VERSION
56 	if (tmpl->ce_mask & NEIGH_ATTR_EXT_FLAGS) {
57 		/* The kernel does not allow setting the locked flag from
58 		 * userspace, so unset it in the request. */
59@@ -786,6 +789,7 @@
60 		if (ext_flags)
61 			NLA_PUT_U32(msg, NDA_FLAGS_EXT, ext_flags);
62 	}
63+#endif
64
65 	*result = msg;
66 	return 0;
67diff -urN libnl/lib/route/link/bridge.c libnl-libnl3_11_0-new/lib/route/link/bridge.c
68--- libnl/lib/route/link/bridge.c	2024-10-30 15:13:01.000000000 +0800
69+++ libnl-libnl3_11_0-new/lib/route/link/bridge.c	2025-06-18 10:21:45.632085400 +0800
70@@ -13,7 +13,7 @@
71
72 #include "nl-default.h"
73
74-#include <linux/if_bridge.h>
75+#include <linux-private/linux/if_bridge.h>
76 #include <linux/rtnetlink.h>
77
78 #include <netlink/netlink.h>
79@@ -40,6 +40,7 @@
80 #define BRIDGE_ATTR_MST			(1UL << 7)
81
82 #define PRIV_FLAG_NEW_ATTRS		(1UL << 0)
83+#define RTEXT_FILTER_MST	(1 << 7)
84
85 struct bridge_data
86 {
87@@ -248,9 +249,11 @@
88 	[IFLA_BRPORT_BCAST_FLOOD]		= { .type = NLA_U8 },
89 	[IFLA_BRPORT_NEIGH_SUPPRESS]		= { .type = NLA_U8 },
90 	[IFLA_BRPORT_ISOLATED]			= { .type = NLA_U8 },
91+#ifdef OPEN_HARMONY_UPDATE_ADAPT_KERNEL_VERSION
92 	[IFLA_BRPORT_LOCKED]			= { .type = NLA_U8 },
93 	[IFLA_BRPORT_MAB]			= { .type = NLA_U8 },
94 	[IFLA_BRPORT_NEIGH_VLAN_SUPPRESS]	= { .type = NLA_U8 },
95+#endif
96 };
97
98 static void check_flag(struct rtnl_link *link, struct nlattr *attrs[],
99@@ -322,10 +325,12 @@
100 	check_flag(link, br_attrs, IFLA_BRPORT_NEIGH_SUPPRESS,
101 		   RTNL_BRIDGE_NEIGH_SUPPRESS);
102 	check_flag(link, br_attrs, IFLA_BRPORT_ISOLATED, RTNL_BRIDGE_ISOLATED);
103+#ifdef OPEN_HARMONY_UPDATE_ADAPT_KERNEL_VERSION
104 	check_flag(link, br_attrs, IFLA_BRPORT_LOCKED, RTNL_BRIDGE_LOCKED);
105 	check_flag(link, br_attrs, IFLA_BRPORT_MAB, RTNL_BRIDGE_MAB);
106 	check_flag(link, br_attrs, IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
107 		   RTNL_BRIDGE_NEIGH_VLAN_SUPPRESS);
108+#endif
109
110 	return 0;
111 }
112@@ -720,6 +725,7 @@
113 			NLA_PUT_U8(msg, IFLA_BRPORT_ISOLATED,
114 				   !!(bd->b_flags & RTNL_BRIDGE_ISOLATED));
115 		}
116+#ifdef OPEN_HARMONY_UPDATE_ADAPT_KERNEL_VERSION
117 		if (bd->b_flags_mask & RTNL_BRIDGE_LOCKED) {
118 			NLA_PUT_U8(msg, IFLA_BRPORT_LOCKED,
119 				   !!(bd->b_flags & RTNL_BRIDGE_LOCKED));
120@@ -733,6 +739,7 @@
121 				   !!(bd->b_flags &
122 				      RTNL_BRIDGE_NEIGH_VLAN_SUPPRESS));
123 		}
124+#endif
125 	}
126
127 	if (bd->ce_mask & BRIDGE_ATTR_COST)
128diff -urN libnl/include/base/nl-base-utils.h libnl-libnl3_11_0-new/include/base/nl-base-utils.h
129--- libnl/include/base/nl-base-utils.h	2024-10-30 15:13:01.000000000 +0800
130+++ libnl-libnl3_11_0-new/include/base/nl-base-utils.h	2025-06-18 10:32:27.489011600 +0800
131@@ -20,6 +20,11 @@
132 #include <netinet/in.h>
133 #include <arpa/inet.h>
134
135+#define NTF_EXT_MANAGED		(1 << 0)
136+#define NTF_EXT_LOCKED		(1 << 1)
137+
138+#define NDA_MAX (__NDA_MAX - 1)
139+
140 #ifndef DISABLE_PTHREADS
141 #include <pthread.h>
142 #endif
143@@ -162,10 +167,8 @@
144
145 #define _nl_assert_addr_family(addr_family)                       \
146 	do {                                                      \
147-		typeof(addr_family) _addr_family = (addr_family); \
148-                                                                  \
149-		_nl_assert(_addr_family == AF_INET ||             \
150-			   _addr_family == AF_INET6);             \
151+		_nl_assert(addr_family == AF_INET ||             \
152+			   addr_family == AF_INET6);             \
153 	} while (0)
154
155 /*****************************************************************************/
156@@ -185,9 +188,11 @@
157
158 /*****************************************************************************/
159
160+#ifndef ARRAY_SIZE
161 #define _NL_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0]))
162
163 #define ARRAY_SIZE(arr) _NL_N_ELEMENTS(arr)
164+#endif
165
166 /*****************************************************************************/
167
168@@ -258,7 +263,7 @@
169 	return _nl_memcmp(s1, s2, len) == 0;
170 }
171
172-static inline void *_nl_memcpy(void *restrict dest, const void *restrict src,
173+static inline void *_nl_memcpy(void *__restrict dest, const void *__restrict src,
174 			       size_t n)
175 {
176 	/* Workaround undefined behavior in memcpy() with NULL pointers. */
177@@ -703,7 +708,7 @@
178 static inline char *_nl_inet_ntop_dup(int addr_family, const void *addr)
179 {
180 	return (char *)_nl_inet_ntop(addr_family, addr,
181-				     malloc((addr_family == AF_INET) ?
182+				     (char *)malloc((addr_family == AF_INET) ?
183 						    INET_ADDRSTRLEN :
184 						    INET6_ADDRSTRLEN));
185 }
186diff -urN libnl/include/config.h libnl-libnl3_11_0-new/include/config.h
187--- libnl/include/config.h	2024-10-30 15:13:01.000000000 +0800
188+++ libnl-libnl3_11_0-new/include/config.h	2025-06-18 10:32:27.489011600 +0800
189@@ -6,11 +6,11 @@
190
191 /* Define to 1 if you have the declaration of `getprotobyname_r', and to 0 if
192    you don't. */
193-#define HAVE_DECL_GETPROTOBYNAME_R 1
194+#define HAVE_DECL_GETPROTOBYNAME_R 0
195
196 /* Define to 1 if you have the declaration of `getprotobynumber_r', and to 0
197    if you don't. */
198-#define HAVE_DECL_GETPROTOBYNUMBER_R 1
199+#define HAVE_DECL_GETPROTOBYNUMBER_R 0
200
201 /* Define to 1 if you have the <dlfcn.h> header file. */
202 #define HAVE_DLFCN_H 1
203@@ -34,7 +34,7 @@
204 #define HAVE_STDLIB_H 1
205
206 /* Define to 1 if you have the `strerror_l' function. */
207-#define HAVE_STRERROR_L 1
208+#define HAVE_STRERROR_L 0
209
210 /* Define to 1 if you have the <strings.h> header file. */
211 #define HAVE_STRINGS_H 1
212diff -urN libnl/include/nl-priv-dynamic-core/nl-core.h libnl-libnl3_11_0-new/include/nl-priv-dynamic-core/nl-core.h
213--- libnl/include/nl-priv-dynamic-core/nl-core.h	2024-10-30 15:13:01.000000000 +0800
214+++ libnl-libnl3_11_0-new/include/nl-priv-dynamic-core/nl-core.h	2025-06-19 19:37:09.297502900 +0800
215@@ -6,6 +6,8 @@
216 #ifndef __NL_SHARED_CORE_NL_CORE_H__
217 #define __NL_SHARED_CORE_NL_CORE_H__
218
219+#include <base/nl-base-utils.h>
220+
221 #define NL_SOCK_PASSCRED (1 << 1)
222 #define NL_OWN_PORT (1 << 2)
223 #define NL_MSG_PEEK (1 << 3)
224diff -urN libnl/src/lib/utils.c libnl-libnl3_11_0-new/src/lib/utils.c
225--- libnl/src/lib/utils.c	2024-10-30 15:13:01.000000000 +0800
226+++ libnl-libnl3_11_0-new/src/lib/utils.c	2025-09-01 21:06:31.381794800 +0800
227@@ -222,9 +222,6 @@
228 {
229 	char path[FILENAME_MAX+1];
230
231-	snprintf(path, sizeof(path), "%s/%s/%s.so",
232-		 _NL_PKGLIBDIR, prefix, name);
233-
234 #ifdef HAVE_DLFCN_H
235 	{
236 		void *handle;
237