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

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

ipv4: Make output route lookup return rtable directly.



Instead of on the stack.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 452edd59
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -193,10 +193,11 @@ static int addr4_resolve(struct sockaddr_in *src_in,
	fl.nl_u.ip4_u.saddr = src_ip;
	fl.oif = addr->bound_dev_if;

	ret = ip_route_output_key(&init_net, &rt, &fl);
	if (ret)
	rt = ip_route_output_key(&init_net, &fl);
	if (IS_ERR(rt)) {
		ret = PTR_ERR(rt);
		goto out;

	}
	src_in->sin_family = AF_INET;
	src_in->sin_addr.s_addr = rt->rt_src;

+2 −1
Original line number Diff line number Diff line
@@ -354,7 +354,8 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
			  }
	};

	if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
	rt = ip_route_output_flow(&init_net, &fl, NULL);
	if (IS_ERR(rt))
		return NULL;
	return rt;
}
+2 −1
Original line number Diff line number Diff line
@@ -331,7 +331,8 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
			  }
	};

	if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
	rt = ip_route_output_flow(&init_net, &fl, NULL);
	if (IS_ERR(rt))
		return NULL;
	return rt;
}
+2 −1
Original line number Diff line number Diff line
@@ -1112,7 +1112,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi

	memset(&fl, 0, sizeof fl);
	fl.nl_u.ip4_u.daddr = htonl(dst_ip);
	if (ip_route_output_key(&init_net, &rt, &fl)) {
	rt = ip_route_output_key(&init_net, &fl);
	if (IS_ERR(rt)) {
		printk(KERN_ERR "%s: ip_route_output_key failed for 0x%08X\n",
				__func__, dst_ip);
		return rc;
+3 −3
Original line number Diff line number Diff line
@@ -2681,7 +2681,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_

static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
{
	int i, vlan_id, rv;
	int i, vlan_id;
	__be32 *targets = bond->params.arp_targets;
	struct vlan_entry *vlan;
	struct net_device *vlan_dev;
@@ -2708,8 +2708,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
		fl.fl4_dst = targets[i];
		fl.fl4_tos = RTO_ONLINK;

		rv = ip_route_output_key(dev_net(bond->dev), &rt, &fl);
		if (rv) {
		rt = ip_route_output_key(dev_net(bond->dev), &fl);
		if (IS_ERR(rt)) {
			if (net_ratelimit()) {
				pr_warning("%s: no route to arp_ip_target %pI4\n",
					   bond->dev->name, &fl.fl4_dst);
Loading