aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-06-16 20:12:11 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-16 20:12:11 -0400
commite31634931d00081c75e3fb3f3ec51a50dbf108bb (patch)
treece1ef0eacc371bab82a604a9d42ae0b854a33031 /net/ipv4/udp.c
parentd6266281f8175e3ad68c28b20a609b278b47ade5 (diff)
udp: provide a struct net pointer for __udp[46]_lib_mcast_deliver
They both calculate the hash chain, but currently do not have a struct net pointer, so pass one there via additional argument, all the more so their callers already have such. 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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index d8f527d15701..6b0acb438f34 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1059,7 +1059,7 @@ drop:
1059 * Note: called only from the BH handler context, 1059 * Note: called only from the BH handler context,
1060 * so we don't need to lock the hashes. 1060 * so we don't need to lock the hashes.
1061 */ 1061 */
1062static int __udp4_lib_mcast_deliver(struct sk_buff *skb, 1062static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
1063 struct udphdr *uh, 1063 struct udphdr *uh,
1064 __be32 saddr, __be32 daddr, 1064 __be32 saddr, __be32 daddr,
1065 struct hlist_head udptable[]) 1065 struct hlist_head udptable[])
@@ -1156,6 +1156,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1156 struct rtable *rt = (struct rtable*)skb->dst; 1156 struct rtable *rt = (struct rtable*)skb->dst;
1157 __be32 saddr = ip_hdr(skb)->saddr; 1157 __be32 saddr = ip_hdr(skb)->saddr;
1158 __be32 daddr = ip_hdr(skb)->daddr; 1158 __be32 daddr = ip_hdr(skb)->daddr;
1159 struct net *net;
1159 1160
1160 /* 1161 /*
1161 * Validate the packet. 1162 * Validate the packet.
@@ -1177,10 +1178,12 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1177 if (udp4_csum_init(skb, uh, proto)) 1178 if (udp4_csum_init(skb, uh, proto))
1178 goto csum_error; 1179 goto csum_error;
1179 1180
1181 net = dev_net(skb->dev);
1180 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST)) 1182 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
1181 return __udp4_lib_mcast_deliver(skb, uh, saddr, daddr, udptable); 1183 return __udp4_lib_mcast_deliver(net, skb, uh,
1184 saddr, daddr, udptable);
1182 1185
1183 sk = __udp4_lib_lookup(dev_net(skb->dev), saddr, uh->source, daddr, 1186 sk = __udp4_lib_lookup(net, saddr, uh->source, daddr,
1184 uh->dest, inet_iif(skb), udptable); 1187 uh->dest, inet_iif(skb), udptable);
1185 1188
1186 if (sk != NULL) { 1189 if (sk != NULL) {