Skip to content

Commit cf91a99

Browse files
ebiedermdavem330
authored andcommitted
ipv4, ipv6: Pass net into __ip_local_out and __ip6_local_out
Signed-off-by: "Eric W. Biederman" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 57c4bf8 commit cf91a99

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

drivers/net/vrf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static struct dst_entry *vrf_ip_check(struct dst_entry *dst, u32 cookie)
7474
return dst;
7575
}
7676

77-
static int vrf_ip_local_out(struct sock *sk, struct sk_buff *skb)
77+
static int vrf_ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
7878
{
7979
return ip_local_out(sk, skb);
8080
}

include/net/dst_ops.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct kmem_cachep;
99
struct net_device;
1010
struct sk_buff;
1111
struct sock;
12+
struct net;
1213

1314
struct dst_ops {
1415
unsigned short family;
@@ -28,7 +29,7 @@ struct dst_ops {
2829
struct sk_buff *skb, u32 mtu);
2930
void (*redirect)(struct dst_entry *dst, struct sock *sk,
3031
struct sk_buff *skb);
31-
int (*local_out)(struct sock *sk, struct sk_buff *skb);
32+
int (*local_out)(struct net *net, struct sock *sk, struct sk_buff *skb);
3233
struct neighbour * (*neigh_lookup)(const struct dst_entry *dst,
3334
struct sk_buff *skb,
3435
const void *daddr);

include/net/ip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int ip_mc_output(struct sock *sk, struct sk_buff *skb);
112112
int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
113113
int (*output)(struct net *, struct sock *, struct sk_buff *));
114114
void ip_send_check(struct iphdr *ip);
115-
int __ip_local_out(struct sock *sk, struct sk_buff *skb);
115+
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
116116
int ip_local_out(struct sock *sk, struct sk_buff *skb);
117117

118118
int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);

include/net/ipv6.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ int ip6_forward(struct sk_buff *skb);
865865
int ip6_input(struct sk_buff *skb);
866866
int ip6_mc_input(struct sk_buff *skb);
867867

868-
int __ip6_local_out(struct sock *sk, struct sk_buff *skb);
868+
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
869869
int ip6_local_out(struct sock *sk, struct sk_buff *skb);
870870

871871
/*

net/ipv4/ip_output.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ void ip_send_check(struct iphdr *iph)
9696
}
9797
EXPORT_SYMBOL(ip_send_check);
9898

99-
int __ip_local_out(struct sock *sk, struct sk_buff *skb)
99+
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
100100
{
101-
struct net *net = dev_net(skb_dst(skb)->dev);
102101
struct iphdr *iph = ip_hdr(skb);
103102

104103
iph->tot_len = htons(skb->len);
@@ -113,7 +112,7 @@ int ip_local_out(struct sock *sk, struct sk_buff *skb)
113112
struct net *net = dev_net(skb_dst(skb)->dev);
114113
int err;
115114

116-
err = __ip_local_out(sk, skb);
115+
err = __ip_local_out(net, sk, skb);
117116
if (likely(err == 1))
118117
err = dst_output(net, sk, skb);
119118

net/ipv6/output_core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
138138
EXPORT_SYMBOL(ip6_dst_hoplimit);
139139
#endif
140140

141-
int __ip6_local_out(struct sock *sk, struct sk_buff *skb)
141+
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
142142
{
143-
struct net *net = dev_net(skb_dst(skb)->dev);
144143
int len;
145144

146145
len = skb->len - sizeof(struct ipv6hdr);
@@ -160,7 +159,7 @@ int ip6_local_out(struct sock *sk, struct sk_buff *skb)
160159
struct net *net = dev_net(skb_dst(skb)->dev);
161160
int err;
162161

163-
err = __ip6_local_out(sk, skb);
162+
err = __ip6_local_out(net, sk, skb);
164163
if (likely(err == 1))
165164
err = dst_output(net, sk, skb);
166165

net/xfrm/xfrm_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
136136
while (likely((err = xfrm_output_one(skb, err)) == 0)) {
137137
nf_reset(skb);
138138

139-
err = skb_dst(skb)->ops->local_out(skb->sk, skb);
139+
err = skb_dst(skb)->ops->local_out(net, skb->sk, skb);
140140
if (unlikely(err != 1))
141141
goto out;
142142

0 commit comments

Comments
 (0)