Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ede2059d authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

dst: Pass net into dst->output



The network namespace is already passed into dst_output pass it into
dst->output lwt->output and friends.

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 33224b16
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -312,10 +312,9 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
	return ret;
	return ret;
}
}


static int vrf_output(struct sock *sk, struct sk_buff *skb)
static int vrf_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
{
	struct net_device *dev = skb_dst(skb)->dev;
	struct net_device *dev = skb_dst(skb)->dev;
	struct net *net = dev_net(dev);


	IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len);
	IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len);


+4 −4
Original line number Original line Diff line number Diff line
@@ -45,7 +45,7 @@ struct dst_entry {
	void			*__pad1;
	void			*__pad1;
#endif
#endif
	int			(*input)(struct sk_buff *);
	int			(*input)(struct sk_buff *);
	int			(*output)(struct sock *sk, struct sk_buff *skb);
	int			(*output)(struct net *net, struct sock *sk, struct sk_buff *skb);


	unsigned short		flags;
	unsigned short		flags;
#define DST_HOST		0x0001
#define DST_HOST		0x0001
@@ -365,10 +365,10 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
	__skb_tunnel_rx(skb, dev, net);
	__skb_tunnel_rx(skb, dev, net);
}
}


int dst_discard_sk(struct sock *sk, struct sk_buff *skb);
int dst_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
static inline int dst_discard(struct sk_buff *skb)
static inline int dst_discard(struct sk_buff *skb)
{
{
	return dst_discard_sk(skb->sk, skb);
	return dst_discard_out(&init_net, skb->sk, skb);
}
}
void *dst_alloc(struct dst_ops *ops, struct net_device *dev, int initial_ref,
void *dst_alloc(struct dst_ops *ops, struct net_device *dev, int initial_ref,
		int initial_obsolete, unsigned short flags);
		int initial_obsolete, unsigned short flags);
@@ -456,7 +456,7 @@ static inline void dst_set_expires(struct dst_entry *dst, int timeout)
/* Output packet to network from transport.  */
/* Output packet to network from transport.  */
static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *skb)
static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
{
	return skb_dst(skb)->output(sk, skb);
	return skb_dst(skb)->output(net, sk, skb);
}
}


/* Input packet from network to transport.  */
/* Input packet from network to transport.  */
+2 −2
Original line number Original line Diff line number Diff line
@@ -107,8 +107,8 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
	   struct net_device *orig_dev);
	   struct net_device *orig_dev);
int ip_local_deliver(struct sk_buff *skb);
int ip_local_deliver(struct sk_buff *skb);
int ip_mr_input(struct sk_buff *skb);
int ip_mr_input(struct sk_buff *skb);
int ip_output(struct sock *sk, struct sk_buff *skb);
int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb);
int ip_mc_output(struct sock *sk, struct sk_buff *skb);
int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb);
int ip_do_fragment(struct net *net, 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 *));
		   int (*output)(struct net *, struct sock *, struct sk_buff *));
void ip_send_check(struct iphdr *ip);
void ip_send_check(struct iphdr *ip);
+1 −1
Original line number Original line Diff line number Diff line
@@ -860,7 +860,7 @@ struct dst_entry *ip6_blackhole_route(struct net *net,
 *	skb processing functions
 *	skb processing functions
 */
 */


int ip6_output(struct sock *sk, struct sk_buff *skb);
int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb);
int ip6_forward(struct sk_buff *skb);
int ip6_forward(struct sk_buff *skb);
int ip6_input(struct sk_buff *skb);
int ip6_input(struct sk_buff *skb);
int ip6_mc_input(struct sk_buff *skb);
int ip6_mc_input(struct sk_buff *skb);
+4 −4
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ struct lwtunnel_state {
	__u16		type;
	__u16		type;
	__u16		flags;
	__u16		flags;
	atomic_t	refcnt;
	atomic_t	refcnt;
	int		(*orig_output)(struct sock *sk, struct sk_buff *skb);
	int		(*orig_output)(struct net *net, struct sock *sk, struct sk_buff *skb);
	int		(*orig_input)(struct sk_buff *);
	int		(*orig_input)(struct sk_buff *);
	int             len;
	int             len;
	__u8            data[0];
	__u8            data[0];
@@ -28,7 +28,7 @@ struct lwtunnel_encap_ops {
	int (*build_state)(struct net_device *dev, struct nlattr *encap,
	int (*build_state)(struct net_device *dev, struct nlattr *encap,
			   unsigned int family, const void *cfg,
			   unsigned int family, const void *cfg,
			   struct lwtunnel_state **ts);
			   struct lwtunnel_state **ts);
	int (*output)(struct sock *sk, struct sk_buff *skb);
	int (*output)(struct net *net, struct sock *sk, struct sk_buff *skb);
	int (*input)(struct sk_buff *skb);
	int (*input)(struct sk_buff *skb);
	int (*fill_encap)(struct sk_buff *skb,
	int (*fill_encap)(struct sk_buff *skb,
			  struct lwtunnel_state *lwtstate);
			  struct lwtunnel_state *lwtstate);
@@ -88,7 +88,7 @@ int lwtunnel_fill_encap(struct sk_buff *skb,
int lwtunnel_get_encap_size(struct lwtunnel_state *lwtstate);
int lwtunnel_get_encap_size(struct lwtunnel_state *lwtstate);
struct lwtunnel_state *lwtunnel_state_alloc(int hdr_len);
struct lwtunnel_state *lwtunnel_state_alloc(int hdr_len);
int lwtunnel_cmp_encap(struct lwtunnel_state *a, struct lwtunnel_state *b);
int lwtunnel_cmp_encap(struct lwtunnel_state *a, struct lwtunnel_state *b);
int lwtunnel_output(struct sock *sk, struct sk_buff *skb);
int lwtunnel_output(struct net *net, struct sock *sk, struct sk_buff *skb);
int lwtunnel_input(struct sk_buff *skb);
int lwtunnel_input(struct sk_buff *skb);


#else
#else
@@ -160,7 +160,7 @@ static inline int lwtunnel_cmp_encap(struct lwtunnel_state *a,
	return 0;
	return 0;
}
}


static inline int lwtunnel_output(struct sock *sk, struct sk_buff *skb)
static inline int lwtunnel_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
{
	return -EOPNOTSUPP;
	return -EOPNOTSUPP;
}
}
Loading