[source] busybox: add upstream patch to fix send_to_from

LEDE Commits lede-commits at lists.infradead.org
Sat Oct 15 10:48:02 PDT 2016


stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/39f8e46bb40df9c7074132b7132ed3f01bd1b815

commit 39f8e46bb40df9c7074132b7132ed3f01bd1b815
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sat Oct 15 19:14:07 2016 +0300

    busybox: add upstream patch to fix send_to_from
    
    This fixes ntpd when queries are sent to secondary IPv4 IP addresses.
    See https://bugs.busybox.net/show_bug.cgi?id=9146
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/utils/busybox/Makefile                     |  2 +-
 ...to_from-do-not-require-that-to-should-hav.patch | 37 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 37b8c14..f602afe 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.25.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch
new file mode 100644
index 0000000..f33c3b2
--- /dev/null
+++ b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch
@@ -0,0 +1,37 @@
+From 7cef4817d6d6d61a1166ed7dfc13537b95c65970 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux at googlemail.com>
+Date: Thu, 15 Sep 2016 13:20:51 +0200
+Subject: [PATCH] libbb:/send_to_from: do not require that "to" should have the
+ same AF. Closes 9146
+
+Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
+---
+ libbb/udp_io.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/libbb/udp_io.c
++++ b/libbb/udp_io.c
+@@ -70,7 +70,13 @@ send_to_from(int fd, void *buf, size_t l
+ 	msg.msg_flags = flags;
+ 
+ 	cmsgptr = CMSG_FIRSTHDR(&msg);
+-	if (to->sa_family == AF_INET && from->sa_family == AF_INET) {
++	/*
++	 * Users report that to->sa_family can be AF_INET6 too,
++	 * if "to" was acquired by recv_from_to(). IOW: recv_from_to()
++	 * was seen showing IPv6 "from" even when the destination
++	 * of received packet (our local address) was IPv4.
++	 */
++	if (/* to->sa_family == AF_INET && */ from->sa_family == AF_INET) {
+ 		struct in_pktinfo *pktptr;
+ 		cmsgptr->cmsg_level = IPPROTO_IP;
+ 		cmsgptr->cmsg_type = IP_PKTINFO;
+@@ -86,7 +92,7 @@ send_to_from(int fd, void *buf, size_t l
+ 		pktptr->ipi_spec_dst = ((struct sockaddr_in*)from)->sin_addr;
+ 	}
+ # if ENABLE_FEATURE_IPV6 && defined(IPV6_PKTINFO)
+-	else if (to->sa_family == AF_INET6 && from->sa_family == AF_INET6) {
++	else if (/* to->sa_family == AF_INET6 && */ from->sa_family == AF_INET6) {
+ 		struct in6_pktinfo *pktptr;
+ 		cmsgptr->cmsg_level = IPPROTO_IPV6;
+ 		cmsgptr->cmsg_type = IPV6_PKTINFO;



More information about the lede-commits mailing list