Fix an 'ip link' hang (#996537)

This commit is contained in:
Petr Šabata 2013-08-29 16:14:10 +02:00
parent 0bc8ea9d8d
commit f4984bb20b
2 changed files with 21 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Summary: Advanced IP routing and network device configuration tools
Name: iproute
Version: 3.10.0
Release: 4%{?dist}
Release: 5%{?dist}
Group: Applications/System
URL: http://kernel.org/pub/linux/utils/net/%{name}2/
Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.gz
@ -19,6 +19,7 @@ Patch7: iproute2-2.6.39-lnstat-dump-to-stdout.patch
Patch8: iproute2-3.8.0-unused-result.patch
Patch9: iproute2-3.10.0-xfrm-state-overflow.patch
Patch10: iproute2-3.10.0-lnstat-interval.patch
Patch11: iproute2-3.10.0-rtnl_send.patch
License: GPLv2+ and Public Domain
BuildRequires: bison
BuildRequires: flex
@ -74,6 +75,7 @@ The libnetlink static library.
%patch8 -p1 -b .unused-result
%patch9 -p1 -b .xfrm-state
%patch10 -p1 -b .lnstat-interval
%patch11 -p1 -b .rtnl_send
sed -i 's/^LIBDIR=/LIBDIR?=/' Makefile
%build
@ -173,6 +175,9 @@ done
%{_includedir}/libnetlink.h
%changelog
* Thu Aug 29 2013 Petr Šabata <contyk@redhat.com> - 3.10.0-5
- Fix an 'ip link' hang (#996537)
* Tue Aug 13 2013 Petr Šabata <contyk@redhat.com> - 3.10.0-4
- lnstat -i: Run indefinitely if the --count isn't specified (#977845)
- Switch to unversioned %%docdir

View File

@ -0,0 +1,15 @@
diff --git a/ip/iplink.c b/ip/iplink.c
index dc98019..56768bd 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -176,8 +176,8 @@ static int iplink_have_newlink(void)
req.n.nlmsg_type = RTM_NEWLINK;
req.i.ifi_family = AF_UNSPEC;
- rtnl_send(&rth, &req.n, req.n.nlmsg_len);
- rtnl_listen(&rth, accept_msg, NULL);
+ if (rtnl_send(&rth, &req.n, req.n.nlmsg_len) == 0)
+ rtnl_listen(&rth, accept_msg, NULL);
}
return have_rtnl_newlink;
}