All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Thomas Graf <tgraf@suug.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 52/72] ip6mr: fix mfc notification flags
Date: Fri, 18 Apr 2014 11:22:25 +0200	[thread overview]
Message-ID: <5d0d91da73f727eda31b8600e6f6d7b8579cbe20.1397812482.git.jslaby@suse.cz> (raw)
In-Reply-To: <3389f243c528afc7c7300c83b8f296290cd3656d.1397812482.git.jslaby@suse.cz>
In-Reply-To: <cover.1397812482.git.jslaby@suse.cz>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

[ Upstream commit f518338b16038beeb73e155e60d0f70beb9379f4 ]

Commit 812e44dd1829 ("ip6mr: advertise new mfc entries via rtnl") reuses the
function ip6mr_fill_mroute() to notify mfc events.
But this function was used only for dump and thus was always setting the
flag NLM_F_MULTI, which is wrong in case of a single notification.

Libraries like libnl will wait forever for NLMSG_DONE.

CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ipv6/ip6mr.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0eb4038a4d63..8737400af0a0 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -2349,13 +2349,14 @@ int ip6mr_get_route(struct net *net,
 }
 
 static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
-			     u32 portid, u32 seq, struct mfc6_cache *c, int cmd)
+			     u32 portid, u32 seq, struct mfc6_cache *c, int cmd,
+			     int flags)
 {
 	struct nlmsghdr *nlh;
 	struct rtmsg *rtm;
 	int err;
 
-	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI);
+	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags);
 	if (nlh == NULL)
 		return -EMSGSIZE;
 
@@ -2423,7 +2424,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc,
 	if (skb == NULL)
 		goto errout;
 
-	err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd);
+	err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0);
 	if (err < 0)
 		goto errout;
 
@@ -2462,7 +2463,8 @@ static int ip6mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
 				if (ip6mr_fill_mroute(mrt, skb,
 						      NETLINK_CB(cb->skb).portid,
 						      cb->nlh->nlmsg_seq,
-						      mfc, RTM_NEWROUTE) < 0)
+						      mfc, RTM_NEWROUTE,
+						      NLM_F_MULTI) < 0)
 					goto done;
 next_entry:
 				e++;
@@ -2476,7 +2478,8 @@ next_entry:
 			if (ip6mr_fill_mroute(mrt, skb,
 					      NETLINK_CB(cb->skb).portid,
 					      cb->nlh->nlmsg_seq,
-					      mfc, RTM_NEWROUTE) < 0) {
+					      mfc, RTM_NEWROUTE,
+					      NLM_F_MULTI) < 0) {
 				spin_unlock_bh(&mfc_unres_lock);
 				goto done;
 			}
-- 
1.9.2


  parent reply	other threads:[~2014-04-18  9:31 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18  9:21 [PATCH 3.12 00/72] 3.12.18-stable review Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 01/72] powernow-k6: disable cache when changing frequency Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 02/72] powernow-k6: correctly initialize default parameters Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 03/72] powernow-k6: reorder frequencies Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 04/72] PCI: mvebu: move clock enable before register access Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 05/72] selinux: correctly label /proc inodes in use before the policy is loaded Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 06/72] futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 07/72] m68k: Skip " Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 08/72] Char: ipmi_bt_sm, fix infinite loop Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 09/72] nfs: initialize the ACL support bits to zero Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 10/72] NFSv3: Fix return value of nfs3_proc_setacls Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 11/72] SUNRPC: Fix potential memory scribble in xprt_free_bc_request() Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 12/72] ext4: Speedup WB_SYNC_ALL pass called from sync(2) Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 13/72] floppy: bail out in open() if drive is not responding to block0 read Jiri Slaby
2014-07-03 10:12   ` Olaf Hering
2014-07-04 21:22     ` Jiri Kosina
2014-04-18  9:21 ` [PATCH 3.12 14/72] drm/i915: Undo the PIPEA quirk for i845 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 15/72] drm/cirrus: Fix cirrus drm driver for fbdev + qemu Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 16/72] drm/radeon: change audio enable logic Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 17/72] drm/radeon: enable speaker allocation setup on dce3.2 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 18/72] drm: Prefer noninterlace cmdline mode unless explicitly specified Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 19/72] fb: reorder the lock sequence to fix potential dead lock Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 20/72] video/fb: Propagate error code from failing to unregister conflicting fb Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 21/72] fbdev: Make the switch from generic to native driver less alarming Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 22/72] drm: add drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 23/72] drm/cirrus: use drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 24/72] net: fix for a race condition in the inet frag code Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 25/72] net: sctp: fix skb leakage in COOKIE ECHO path of chunk->auth_chunk Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 26/72] bridge: multicast: add sanity check for query source addresses Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 27/72] tipc: allow connection shutdown callback to be invoked in advance Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 28/72] tipc: fix connection refcount leak Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 29/72] tipc: drop subscriber connection id invalidation Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 30/72] tipc: fix memory leak during module removal Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 31/72] tipc: don't log disabled tasklet handler errors Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 32/72] inet: frag: make sure forced eviction removes all frags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 33/72] net: unix: non blocking recvmsg() should not return -EINTR Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 34/72] ipv6: Fix exthdrs offload registration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 35/72] ipv6: don't set DST_NOCOUNT for remotely added routes Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 36/72] bnx2: Fix shutdown sequence Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 37/72] pkt_sched: fq: do not hold qdisc lock while allocating memory Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 38/72] vlan: Set correct source MAC address with TX VLAN offload enabled Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 39/72] tcp: tcp_release_cb() should release socket ownership Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 40/72] bridge: multicast: add sanity check for general query destination Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 41/72] bridge: multicast: enable snooping on general queries only Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 42/72] net: socket: error on a negative msg_namelen Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 43/72] bonding: set correct vlan id for alb xmit path Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 44/72] eth: fec: Fix lost promiscuous mode after reconnecting cable Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 45/72] ipv6: Avoid unnecessary temporary addresses being generated Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 46/72] ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 47/72] vxlan: fix potential NULL dereference in arp_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 48/72] vxlan: fix nonfunctional neigh_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 49/72] tcp: syncookies: do not use getnstimeofday() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 50/72] rtnetlink: fix fdb notification flags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 51/72] ipmr: fix mfc " Jiri Slaby
2014-04-18  9:22 ` Jiri Slaby [this message]
2014-04-18  9:22 ` [PATCH 3.12 53/72] net: micrel : ks8851-ml: add vdd-supply support Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 54/72] netpoll: fix the skb check in pkt_is_ns Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 55/72] tipc: fix spinlock recursion bug for failed subscriptions Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 56/72] ip_tunnel: Fix dst ref-count Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 57/72] tg3: Do not include vlan acceleration features in vlan_features Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 58/72] usbnet: include wait queue head in device structure Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 59/72] vlan: Set hard_header_len according to available acceleration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 60/72] vhost: fix total length when packets are too short Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 61/72] vhost: validate vhost_get_vq_desc return value Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 62/72] xen-netback: remove pointless clause from if statement Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 63/72] ipv6: some ipv6 statistic counters failed to disable bh Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 64/72] netlink: don't compare the nul-termination in nla_strcmp Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 65/72] xen-netback: disable rogue vif in kthread context Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 66/72] net: vxlan: fix crash when interface is created with no group Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 67/72] isdnloop: Validate NUL-terminated strings from user Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 68/72] isdnloop: several buffer overflows Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 69/72] rds: prevent dereference of a NULL device in rds_iw_laddr_check Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 70/72] ARC: [nsimosci] Change .dts to use generic 8250 UART Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 71/72] ARC: [nsimosci] Unbork console Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 72/72] crypto: ghash-clmulni-intel - use C implementation for setkey() Jiri Slaby
2014-04-18 19:18 ` [PATCH 3.12 00/72] 3.12.18-stable review Guenter Roeck
2014-04-18 22:12 ` Shuah Khan
2014-04-24  7:46   ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d0d91da73f727eda31b8600e6f6d7b8579cbe20.1397812482.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=stable@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.