diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-16 23:19:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-16 23:19:08 -0400 |
commit | 84a3aa000eacbaf841d745b07ef3a3280899056b (patch) | |
tree | 013d13bb51e1046f6864ae634edaf0dad30da2e7 /net/ipv4/udp.c | |
parent | 78ed11a56bd8679aa6d51eb36b448342c59a7824 (diff) |
ipv4: prepare net initialization for IP accounting
Some places, that deal with IP statistics already have where to
get a struct net from, but use it directly, without declaring
a separate variable on the stack.
So, save this net on the stack for future IP_XXX_STATS macros.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index fdd4faa1f120..048ef57edc1d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -656,8 +656,10 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
656 | .uli_u = { .ports = | 656 | .uli_u = { .ports = |
657 | { .sport = inet->sport, | 657 | { .sport = inet->sport, |
658 | .dport = dport } } }; | 658 | .dport = dport } } }; |
659 | struct net *net = sock_net(sk); | ||
660 | |||
659 | security_sk_classify_flow(sk, &fl); | 661 | security_sk_classify_flow(sk, &fl); |
660 | err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 1); | 662 | err = ip_route_output_flow(net, &rt, &fl, sk, 1); |
661 | if (err) { | 663 | if (err) { |
662 | if (err == -ENETUNREACH) | 664 | if (err == -ENETUNREACH) |
663 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); | 665 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); |