Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c43c5f39 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'nf' of git://1984.lsi.us.es/net

parents bb52c7ac 1a31a4a8
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -1358,12 +1358,15 @@ ctnetlink_create_conntrack(struct net *net, u16 zone,
						    nf_ct_protonum(ct));
		if (helper == NULL) {
			rcu_read_unlock();
			spin_unlock_bh(&nf_conntrack_lock);
#ifdef CONFIG_MODULES
			if (request_module("nfct-helper-%s", helpname) < 0) {
				spin_lock_bh(&nf_conntrack_lock);
				err = -EOPNOTSUPP;
				goto err1;
			}

			spin_lock_bh(&nf_conntrack_lock);
			rcu_read_lock();
			helper = __nf_conntrack_helper_find(helpname,
							    nf_ct_l3num(ct),
@@ -1869,25 +1872,30 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,

	err = -ENOMEM;
	skb2 = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
	if (skb2 == NULL)
	if (skb2 == NULL) {
		nf_ct_expect_put(exp);
		goto out;
	}

	rcu_read_lock();
	err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).pid,
				      nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, exp);
	rcu_read_unlock();
	nf_ct_expect_put(exp);
	if (err <= 0)
		goto free;

	nf_ct_expect_put(exp);
	err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT);
	if (err < 0)
		goto out;

	return netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT);
	return 0;

free:
	kfree_skb(skb2);
out:
	nf_ct_expect_put(exp);
	return err;
	/* this avoids a loop in nfnetlink. */
	return err == -EAGAIN ? -ENOBUFS : err;
}

static int