Skip to content

Commit

Permalink
ipv4, ipv6: Pass net into __ip_local_out and __ip6_local_out
Browse files Browse the repository at this point in the history
Signed-off-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ebiederm authored and davem330 committed Oct 8, 2015
1 parent 57c4bf8 commit cf91a99
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion drivers/net/vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static struct dst_entry *vrf_ip_check(struct dst_entry *dst, u32 cookie)
return dst;
}

static int vrf_ip_local_out(struct sock *sk, struct sk_buff *skb)
static int vrf_ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
return ip_local_out(sk, skb);
}
Expand Down
3 changes: 2 additions & 1 deletion include/net/dst_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct kmem_cachep;
struct net_device;
struct sk_buff;
struct sock;
struct net;

struct dst_ops {
unsigned short family;
Expand All @@ -28,7 +29,7 @@ struct dst_ops {
struct sk_buff *skb, u32 mtu);
void (*redirect)(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb);
int (*local_out)(struct sock *sk, struct sk_buff *skb);
int (*local_out)(struct net *net, struct sock *sk, struct sk_buff *skb);
struct neighbour * (*neigh_lookup)(const struct dst_entry *dst,
struct sk_buff *skb,
const void *daddr);
Expand Down
2 changes: 1 addition & 1 deletion include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int ip_mc_output(struct sock *sk, struct sk_buff *skb);
int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
int (*output)(struct net *, struct sock *, struct sk_buff *));
void ip_send_check(struct iphdr *ip);
int __ip_local_out(struct sock *sk, struct sk_buff *skb);
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
int ip_local_out(struct sock *sk, struct sk_buff *skb);

int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
Expand Down
2 changes: 1 addition & 1 deletion include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ int ip6_forward(struct sk_buff *skb);
int ip6_input(struct sk_buff *skb);
int ip6_mc_input(struct sk_buff *skb);

int __ip6_local_out(struct sock *sk, struct sk_buff *skb);
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
int ip6_local_out(struct sock *sk, struct sk_buff *skb);

/*
Expand Down
5 changes: 2 additions & 3 deletions net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ void ip_send_check(struct iphdr *iph)
}
EXPORT_SYMBOL(ip_send_check);

int __ip_local_out(struct sock *sk, struct sk_buff *skb)
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct net *net = dev_net(skb_dst(skb)->dev);
struct iphdr *iph = ip_hdr(skb);

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

err = __ip_local_out(sk, skb);
err = __ip_local_out(net, sk, skb);
if (likely(err == 1))
err = dst_output(net, sk, skb);

Expand Down
5 changes: 2 additions & 3 deletions net/ipv6/output_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
EXPORT_SYMBOL(ip6_dst_hoplimit);
#endif

int __ip6_local_out(struct sock *sk, struct sk_buff *skb)
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct net *net = dev_net(skb_dst(skb)->dev);
int len;

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

err = __ip6_local_out(sk, skb);
err = __ip6_local_out(net, sk, skb);
if (likely(err == 1))
err = dst_output(net, sk, skb);

Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
while (likely((err = xfrm_output_one(skb, err)) == 0)) {
nf_reset(skb);

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

Expand Down

0 comments on commit cf91a99

Please sign in to comment.