net: Initialize every fl_net member in struct flowi
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
drivers/infiniband/core/addr.c | 2 ++
drivers/infiniband/hw/cxgb3/iwch_cm.c | 3 ++-
drivers/net/bonding/bond_main.c | 1 +
include/net/route.h | 4 +++-
net/atm/clip.c | 5 ++++-
net/bridge/br_netfilter.c | 1 +
net/dccp/ipv4.c | 3 ++-
net/dccp/ipv6.c | 5 +++++
net/decnet/af_decnet.c | 1 +
net/decnet/dn_fib.c | 1 +
net/decnet/dn_nsp_out.c | 1 +
net/decnet/dn_route.c | 7 +++++--
net/decnet/dn_rules.c | 5 ++++-
net/ipv4/af_inet.c | 1 +
net/ipv4/arp.c | 18 ++++++++++++------
net/ipv4/fib_frontend.c | 16 ++++++++++++----
net/ipv4/fib_semantics.c | 1 +
net/ipv4/icmp.c | 4 +++-
net/ipv4/igmp.c | 12 ++++++++----
net/ipv4/inet_connection_sock.c | 3 ++-
net/ipv4/ip_gre.c | 10 +++++++---
net/ipv4/ip_output.c | 6 ++++--
net/ipv4/ipip.c | 7 +++++--
net/ipv4/ipmr.c | 6 ++++--
net/ipv4/ipvs/ip_vs_xmit.c | 3 +++
net/ipv4/netfilter.c | 1 +
net/ipv4/netfilter/nf_nat_rule.c | 5 ++++-
net/ipv4/raw.c | 3 ++-
net/ipv4/route.c | 7 +++++--
net/ipv4/syncookies.c | 3 ++-
net/ipv4/udp.c | 3 ++-
net/ipv4/xfrm4_policy.c | 2 ++
net/ipv6/af_inet6.c | 1 +
net/ipv6/datagram.c | 1 +
net/ipv6/icmp.c | 2 ++
net/ipv6/inet6_connection_sock.c | 1 +
net/ipv6/ip6_flowlabel.c | 1 +
net/ipv6/ip6_tunnel.c | 1 +
net/ipv6/ipv6_sockglue.c | 1 +
net/ipv6/ndisc.c | 1 +
net/ipv6/netfilter.c | 1 +
net/ipv6/netfilter/ip6t_REJECT.c | 1 +
net/ipv6/raw.c | 1 +
net/ipv6/route.c | 4 ++++
net/ipv6/sit.c | 7 +++++--
net/ipv6/tcp_ipv6.c | 6 ++++++
net/ipv6/udp.c | 1 +
net/ipv6/xfrm6_policy.c | 5 ++++-
net/netfilter/nf_conntrack_h323_main.c | 2 ++
net/rxrpc/ar-peer.c | 1 +
net/sctp/ipv6.c | 2 ++
net/sctp/protocol.c | 1 +
net/xfrm/xfrm_policy.c | 1 +
53 files changed, 151 insertions(+), 41 deletions(-)
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 5381c80..3b22bdb 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -157,6 +157,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
u32 dst_ip = dst_in->sin_addr.s_addr;
memset(&fl, 0, sizeof fl);
+ fl.fl_net = &init_net;
fl.nl_u.ip4_u.daddr = dst_ip;
if (ip_route_output_key(&rt, &fl))
return;
@@ -177,6 +178,7 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
int ret;
memset(&fl, 0, sizeof fl);
+ fl.fl_net = &init_net;
fl.nl_u.ip4_u.daddr = dst_ip;
fl.nl_u.ip4_u.saddr = src_ip;
ret = ip_route_output_key(&rt, &fl);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 20ba372..b4d5c2b 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -329,7 +329,8 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
.ports = {
.sport = local_port,
.dport = peer_port}
- }
+ },
+ .fl_net = &init_net,
};
if (ip_route_output_flow(&rt, &fl, NULL, 0))
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 423298c..f59aae1 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2508,6 +2508,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
* can tag the ARP with the proper VLAN tag.
*/
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.fl4_dst = targets[i];
fl.fl4_tos = RTO_ONLINK;
diff --git a/include/net/route.h b/include/net/route.h
index f7ce625..7079e2a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -147,7 +147,8 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
__be16 sport, __be16 dport, struct sock *sk,
int flags)
{
- struct flowi fl = { .oif = oif,
+ struct flowi fl = { .fl_net = &init_net,
+ .oif = oif,
.nl_u = { .ip4_u = { .daddr = dst,
.saddr = src,
.tos = tos } },
@@ -178,6 +179,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
struct flowi fl;
memcpy(&fl, &(*rp)->fl, sizeof(fl));
+ fl.fl_net = &init_net;
fl.fl_ip_sport = sport;
fl.fl_ip_dport = dport;
fl.proto = protocol;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 741742f..b0c39cb 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -517,7 +517,10 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
struct atmarp_entry *entry;
int error;
struct clip_vcc *clip_vcc;
- struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = 1}} };
+ struct flowi fl = {
+ .fl_net = &init_net,
+ .nl_u = { .ip4_u = { .daddr = ip, .tos = 1 }}
+ };
struct rtable *rt;
if (vcc->push != clip_push) {
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 5f5b98a..e90951a 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -310,6 +310,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
struct rtable *rt;
struct flowi fl = {
+ .fl_net = &init_net,
.nl_u = {
.ip4_u = {
.daddr = iph->daddr,
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index db17b83..9cc0f7b 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -456,7 +456,8 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
struct sk_buff *skb)
{
struct rtable *rt;
- struct flowi fl = { .oif = ((struct rtable *)skb->dst)->rt_iif,
+ struct flowi fl = { .fl_net = &init_net,
+ .oif = ((struct rtable *)skb->dst)->rt_iif,
.nl_u = { .ip4_u =
{ .daddr = ip_hdr(skb)->saddr,
.saddr = ip_hdr(skb)->daddr,
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 87c98fb..6abcc35 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -142,6 +142,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
for now.
*/
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.proto = IPPROTO_DCCP;
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
@@ -242,6 +243,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
int err = -1;
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net,
fl.proto = IPPROTO_DCCP;
ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
@@ -320,6 +322,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
&rxip6h->daddr);
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
ipv6_addr_copy(&fl.fl6_dst, &rxip6h->saddr);
ipv6_addr_copy(&fl.fl6_src, &rxip6h->daddr);
@@ -536,6 +539,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
struct flowi fl;
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.proto = IPPROTO_DCCP;
ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
if (opt != NULL && opt->srcrt != NULL) {
@@ -888,6 +892,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
return -EAFNOSUPPORT;
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
if (np->sndflow) {
fl.fl6_flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK;
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 57d5749..55450a1 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -947,6 +947,7 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
err = -EHOSTUNREACH;
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.oif = sk->sk_bound_dev_if;
fl.fld_dst = dn_saddr2dn(&scp->peer);
fl.fld_src = dn_saddr2dn(&scp->addr);
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 4aa9a42..e05acf5 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -221,6 +221,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
}
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.fld_dst = nh->nh_gw;
fl.oif = nh->nh_oif;
fl.fld_scope = r->rtm_scope + 1;
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 7404653..8bdb9f6 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -91,6 +91,7 @@ try_again:
}
memset(&fl, 0, sizeof(fl));
+ fl.fl_net = &init_net;
fl.oif = sk->sk_bound_dev_if;
fl.fld_src = dn_saddr2dn(&scp->addr);
fl.fld_dst = dn_saddr2dn(&scp->peer);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index eb07df9..c353de0 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -866,7 +866,8 @@ static inline __le16 dn_
...