Skip to content

Commit f1b050b

Browse files
dlunevdavem330
authored andcommitted
[NETNS]: Add namespace parameter to ip_route_output_flow.
Needed to propagate it down to the __ip_route_output_key. Signed_off_by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 611c183 commit f1b050b

9 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎drivers/infiniband/hw/cxgb3/iwch_cm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
332332
}
333333
};
334334

335-
if (ip_route_output_flow(&rt, &fl, NULL, 0))
335+
if (ip_route_output_flow(&init_net, &rt, &fl, NULL, 0))
336336
return NULL;
337337
return rt;
338338
}

‎include/net/route.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
112112
extern void rt_cache_flush(int how);
113113
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
114114
extern int ip_route_output_key(struct rtable **, struct flowi *flp);
115-
extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
115+
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
116116
extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
117117
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
118118
extern void ip_rt_send_redirect(struct sk_buff *skb);
@@ -167,7 +167,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
167167
*rp = NULL;
168168
}
169169
security_sk_classify_flow(sk, &fl);
170-
return ip_route_output_flow(rp, &fl, sk, flags);
170+
return ip_route_output_flow(&init_net, rp, &fl, sk, flags);
171171
}
172172

173173
static inline int ip_route_newports(struct rtable **rp, u8 protocol,
@@ -184,7 +184,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
184184
ip_rt_put(*rp);
185185
*rp = NULL;
186186
security_sk_classify_flow(sk, &fl);
187-
return ip_route_output_flow(rp, &fl, sk, 0);
187+
return ip_route_output_flow(&init_net, rp, &fl, sk, 0);
188188
}
189189
return 0;
190190
}

‎net/dccp/ipv4.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
469469
};
470470

471471
security_skb_classify_flow(skb, &fl);
472-
if (ip_route_output_flow(&rt, &fl, sk, 0)) {
472+
if (ip_route_output_flow(&init_net, &rt, &fl, sk, 0)) {
473473
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
474474
return NULL;
475475
}

‎net/ipv4/af_inet.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ int inet_sk_rebuild_header(struct sock *sk)
11131113
};
11141114

11151115
security_sk_classify_flow(sk, &fl);
1116-
err = ip_route_output_flow(&rt, &fl, sk, 0);
1116+
err = ip_route_output_flow(&init_net, &rt, &fl, sk, 0);
11171117
}
11181118
if (!err)
11191119
sk_setup_caps(sk, &rt->u.dst);

‎net/ipv4/inet_connection_sock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct dst_entry* inet_csk_route_req(struct sock *sk,
333333
.dport = ireq->rmt_port } } };
334334

335335
security_req_classify_flow(req, &fl);
336-
if (ip_route_output_flow(&rt, &fl, sk, 0)) {
336+
if (ip_route_output_flow(&init_net, &rt, &fl, sk, 0)) {
337337
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
338338
return NULL;
339339
}

‎net/ipv4/ip_output.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
350350
* itself out.
351351
*/
352352
security_sk_classify_flow(sk, &fl);
353-
if (ip_route_output_flow(&rt, &fl, sk, 0))
353+
if (ip_route_output_flow(&init_net, &rt, &fl, sk, 0))
354354
goto no_route;
355355
}
356356
sk_setup_caps(sk, &rt->u.dst);

‎net/ipv4/raw.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
558558
}
559559

560560
security_sk_classify_flow(sk, &fl);
561-
err = ip_route_output_flow(&rt, &fl, sk, 1);
561+
err = ip_route_output_flow(&init_net, &rt, &fl, sk, 1);
562562
}
563563
if (err)
564564
goto done;

‎net/ipv4/route.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,11 +2533,12 @@ static int ipv4_dst_blackhole(struct rtable **rp, struct flowi *flp, struct sock
25332533
return (rt ? 0 : -ENOMEM);
25342534
}
25352535

2536-
int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags)
2536+
int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
2537+
struct sock *sk, int flags)
25372538
{
25382539
int err;
25392540

2540-
if ((err = __ip_route_output_key(&init_net, rp, flp)) != 0)
2541+
if ((err = __ip_route_output_key(net, rp, flp)) != 0)
25412542
return err;
25422543

25432544
if (flp->proto) {
@@ -2560,7 +2561,7 @@ EXPORT_SYMBOL_GPL(ip_route_output_flow);
25602561

25612562
int ip_route_output_key(struct rtable **rp, struct flowi *flp)
25622563
{
2563-
return ip_route_output_flow(rp, flp, NULL, 0);
2564+
return ip_route_output_flow(&init_net, rp, flp, NULL, 0);
25642565
}
25652566

25662567
static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event,

‎net/ipv4/udp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
660660
{ .sport = inet->sport,
661661
.dport = dport } } };
662662
security_sk_classify_flow(sk, &fl);
663-
err = ip_route_output_flow(&rt, &fl, sk, 1);
663+
err = ip_route_output_flow(&init_net, &rt, &fl, sk, 1);
664664
if (err) {
665665
if (err == -ENETUNREACH)
666666
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);

0 commit comments

Comments
 (0)