Skip to content

Commit

Permalink
[NETNS][DCCPV4]: Use proper net to route the reset packet.
Browse files Browse the repository at this point in the history
The dccp_v4_route_skb used in dccp_v4_ctl_send_reset, currently
works with init_net's routing tables - fix it.

Signed-off-by: Pavel Emelyanov <[email protected]>
Acked-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xemul authored and davem330 committed Apr 14, 2008
1 parent b76c4b2 commit f548739
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
return sk;
}

static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
struct sk_buff *skb)
{
struct rtable *rt;
Expand All @@ -462,7 +462,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
};

security_skb_classify_flow(skb, &fl);
if (ip_route_output_flow(&init_net, &rt, &fl, sk, 0)) {
if (ip_route_output_flow(net, &rt, &fl, sk, 0)) {
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return NULL;
}
Expand Down Expand Up @@ -515,7 +515,7 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
if (rxskb->rtable->rt_type != RTN_LOCAL)
return;

dst = dccp_v4_route_skb(ctl_sk, rxskb);
dst = dccp_v4_route_skb(net, ctl_sk, rxskb);
if (dst == NULL)
return;

Expand Down

0 comments on commit f548739

Please sign in to comment.