aboutsummaryrefslogtreecommitdiffstats
path: root/main/libnl/fix-strerror_r.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/libnl/fix-strerror_r.patch')
-rw-r--r--main/libnl/fix-strerror_r.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/libnl/fix-strerror_r.patch b/main/libnl/fix-strerror_r.patch
new file mode 100644
index 0000000000..ff129be721
--- /dev/null
+++ b/main/libnl/fix-strerror_r.patch
@@ -0,0 +1,50 @@
+--- libnl-1.1.4.orig/lib/fib_lookup/lookup.c
++++ libnl-1.1.4/lib/fib_lookup/lookup.c
+@@ -124,7 +124,7 @@
+ static int result_dump_brief(struct nl_object *obj, struct nl_dump_params *p)
+ {
+ struct flnl_result *res = (struct flnl_result *) obj;
+- char buf[256];
++ char buf[256], buf2[256];
+ int line = 1;
+
+ dp_dump(p, "table %s prefixlen %u next-hop-selector %u\n",
+@@ -132,9 +132,10 @@
+ res->fr_prefixlen, res->fr_nh_sel);
+ dp_dump_line(p, line++, "type %s ",
+ nl_rtntype2str(res->fr_type, buf, sizeof(buf)));
++ strerror_r(-res->fr_error, buf2, sizeof(buf2));
+ dp_dump(p, "scope %s error %s (%d)\n",
+ rtnl_scope2str(res->fr_scope, buf, sizeof(buf)),
+- strerror_r(-res->fr_error, buf, sizeof(buf)), res->fr_error);
++ buf2, res->fr_error);
+
+ return line;
+ }
+--- libnl-1.1.4.orig/lib/handlers.c
++++ libnl-1.1.4/lib/handlers.c
+@@ -136,8 +136,8 @@
+ FILE *ofd = arg ? arg : stderr;
+ char buf[256];
+
+- fprintf(ofd, "-- Error received: %s\n-- Original message: ",
+- strerror_r(-e->error, buf, sizeof(buf)));
++ strerror_r(-e->error, buf, sizeof(buf));
++ fprintf(ofd, "-- Error received: %s\n-- Original message: ", buf);
+ print_header_content(ofd, &e->msg);
+ fprintf(ofd, "\n");
+
+--- libnl-1.1.4.orig/lib/msg.c
++++ libnl-1.1.4/lib/msg.c
+@@ -961,9 +961,9 @@
+ struct nlmsgerr *err = nlmsg_data(hdr);
+ char buf[256];
+
++ strerror_r(-err->error, buf, sizeof(buf));
+ fprintf(ofd, " [ERRORMSG] %Zu octets\n", sizeof(*err));
+- fprintf(ofd, " .error = %d \"%s\"\n", err->error,
+- strerror_r(-err->error, buf, sizeof(buf)));
++ fprintf(ofd, " .error = %d \"%s\"\n", err->error, buf);
+ fprintf(ofd, " [ORIGINAL MESSAGE] %Zu octets\n", sizeof(*hdr));
+
+ errmsg = nlmsg_inherit(&err->msg);