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

netfilter: Pass net into okfn



This is immediately motivated by the bridge code that chains functions that
call into netfilter.  Without passing net into the okfns the bridge code would
need to guess about the best expression for the network namespace to process
packets in.

As net is frequently one of the first things computed in continuation functions
after netfilter has done it's job passing in the desired network namespace is in
many cases a code simplification.

To support this change the function dst_output_okfn is introduced to
simplify passing dst_output as an okfn.  For the moment dst_output_okfn
just silently drops the struct net.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9dff2c96
...@@ -253,7 +253,7 @@ static netdev_tx_t vrf_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -253,7 +253,7 @@ static netdev_tx_t vrf_xmit(struct sk_buff *skb, struct net_device *dev)
} }
/* modelled after ip_finish_output2 */ /* modelled after ip_finish_output2 */
static int vrf_finish_output(struct sock *sk, struct sk_buff *skb) static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct dst_entry *dst = skb_dst(skb); struct dst_entry *dst = skb_dst(skb);
struct rtable *rt = (struct rtable *)dst; struct rtable *rt = (struct rtable *)dst;
......
...@@ -2212,7 +2212,7 @@ int dev_open(struct net_device *dev); ...@@ -2212,7 +2212,7 @@ int dev_open(struct net_device *dev);
int dev_close(struct net_device *dev); int dev_close(struct net_device *dev);
int dev_close_many(struct list_head *head, bool unlink); int dev_close_many(struct list_head *head, bool unlink);
void dev_disable_lro(struct net_device *dev); void dev_disable_lro(struct net_device *dev);
int dev_loopback_xmit(struct sock *sk, struct sk_buff *newskb); int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
int dev_queue_xmit(struct sk_buff *skb); int dev_queue_xmit(struct sk_buff *skb);
int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);
int register_netdevice(struct net_device *dev); int register_netdevice(struct net_device *dev);
......
...@@ -56,7 +56,7 @@ struct nf_hook_state { ...@@ -56,7 +56,7 @@ struct nf_hook_state {
struct sock *sk; struct sock *sk;
struct net *net; struct net *net;
struct list_head *hook_list; struct list_head *hook_list;
int (*okfn)(struct sock *, struct sk_buff *); int (*okfn)(struct net *, struct sock *, struct sk_buff *);
}; };
static inline void nf_hook_state_init(struct nf_hook_state *p, static inline void nf_hook_state_init(struct nf_hook_state *p,
...@@ -67,7 +67,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p, ...@@ -67,7 +67,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p,
struct net_device *outdev, struct net_device *outdev,
struct sock *sk, struct sock *sk,
struct net *net, struct net *net,
int (*okfn)(struct sock *, struct sk_buff *)) int (*okfn)(struct net *, struct sock *, struct sk_buff *))
{ {
p->hook = hook; p->hook = hook;
p->thresh = thresh; p->thresh = thresh;
...@@ -175,7 +175,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, ...@@ -175,7 +175,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
struct sk_buff *skb, struct sk_buff *skb,
struct net_device *indev, struct net_device *indev,
struct net_device *outdev, struct net_device *outdev,
int (*okfn)(struct sock *, struct sk_buff *), int (*okfn)(struct net *, struct sock *, struct sk_buff *),
int thresh) int thresh)
{ {
struct list_head *hook_list = &net->nf.hooks[pf][hook]; struct list_head *hook_list = &net->nf.hooks[pf][hook];
...@@ -193,7 +193,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, ...@@ -193,7 +193,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net,
struct sock *sk, struct sk_buff *skb, struct sock *sk, struct sk_buff *skb,
struct net_device *indev, struct net_device *outdev, struct net_device *indev, struct net_device *outdev,
int (*okfn)(struct sock *, struct sk_buff *)) int (*okfn)(struct net *, struct sock *, struct sk_buff *))
{ {
return nf_hook_thresh(pf, hook, net, sk, skb, indev, outdev, okfn, INT_MIN); return nf_hook_thresh(pf, hook, net, sk, skb, indev, outdev, okfn, INT_MIN);
} }
...@@ -219,31 +219,33 @@ static inline int ...@@ -219,31 +219,33 @@ static inline int
NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk,
struct sk_buff *skb, struct net_device *in, struct sk_buff *skb, struct net_device *in,
struct net_device *out, struct net_device *out,
int (*okfn)(struct sock *, struct sk_buff *), int thresh) int (*okfn)(struct net *, struct sock *, struct sk_buff *),
int thresh)
{ {
int ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, thresh); int ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, thresh);
if (ret == 1) if (ret == 1)
ret = okfn(sk, skb); ret = okfn(net, sk, skb);
return ret; return ret;
} }
static inline int static inline int
NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk,
struct sk_buff *skb, struct net_device *in, struct net_device *out, struct sk_buff *skb, struct net_device *in, struct net_device *out,
int (*okfn)(struct sock *, struct sk_buff *), bool cond) int (*okfn)(struct net *, struct sock *, struct sk_buff *),
bool cond)
{ {
int ret; int ret;
if (!cond || if (!cond ||
((ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, INT_MIN)) == 1)) ((ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, INT_MIN)) == 1))
ret = okfn(sk, skb); ret = okfn(net, sk, skb);
return ret; return ret;
} }
static inline int static inline int
NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb,
struct net_device *in, struct net_device *out, struct net_device *in, struct net_device *out,
int (*okfn)(struct sock *, struct sk_buff *)) int (*okfn)(struct net *, struct sock *, struct sk_buff *))
{ {
return NF_HOOK_THRESH(pf, hook, net, sk, skb, in, out, okfn, INT_MIN); return NF_HOOK_THRESH(pf, hook, net, sk, skb, in, out, okfn, INT_MIN);
} }
...@@ -345,12 +347,12 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) ...@@ -345,12 +347,12 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
} }
#else /* !CONFIG_NETFILTER */ #else /* !CONFIG_NETFILTER */
#define NF_HOOK(pf, hook, net, sk, skb, indev, outdev, okfn) (okfn)(sk, skb) #define NF_HOOK(pf, hook, net, sk, skb, indev, outdev, okfn) (okfn)(net, sk, skb)
#define NF_HOOK_COND(pf, hook, net, sk, skb, indev, outdev, okfn, cond) (okfn)(sk, skb) #define NF_HOOK_COND(pf, hook, net, sk, skb, indev, outdev, okfn, cond) (okfn)(net, sk, skb)
static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net,
struct sock *sk, struct sk_buff *skb, struct sock *sk, struct sk_buff *skb,
struct net_device *indev, struct net_device *outdev, struct net_device *indev, struct net_device *outdev,
int (*okfn)(struct sock *, struct sk_buff *)) int (*okfn)(struct net *, struct sock *, struct sk_buff *))
{ {
return 1; return 1;
} }
......
...@@ -17,7 +17,7 @@ enum nf_br_hook_priorities { ...@@ -17,7 +17,7 @@ enum nf_br_hook_priorities {
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb); int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
static inline void br_drop_fake_rtable(struct sk_buff *skb) static inline void br_drop_fake_rtable(struct sk_buff *skb)
{ {
......
...@@ -18,11 +18,11 @@ struct dn_neigh { ...@@ -18,11 +18,11 @@ struct dn_neigh {
void dn_neigh_init(void); void dn_neigh_init(void);
void dn_neigh_cleanup(void); void dn_neigh_cleanup(void);
int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb); int dn_neigh_router_hello(struct net *net, struct sock *sk, struct sk_buff *skb);
int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb); int dn_neigh_endnode_hello(struct net *net, struct sock *sk, struct sk_buff *skb);
void dn_neigh_pointopoint_hello(struct sk_buff *skb); void dn_neigh_pointopoint_hello(struct sk_buff *skb);
int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n);
int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb); int dn_to_neigh_output(struct net *net, struct sock *sk, struct sk_buff *skb);
extern struct neigh_table dn_neigh_table; extern struct neigh_table dn_neigh_table;
......
...@@ -458,6 +458,10 @@ static inline int dst_output(struct sock *sk, struct sk_buff *skb) ...@@ -458,6 +458,10 @@ static inline int dst_output(struct sock *sk, struct sk_buff *skb)
{ {
return skb_dst(skb)->output(sk, skb); return skb_dst(skb)->output(sk, skb);
} }
static inline int dst_output_okfn(struct net *net, struct sock *sk, struct sk_buff *skb)
{
return dst_output(sk, skb);
}
/* Input packet from network to transport. */ /* Input packet from network to transport. */
static inline int dst_input(struct sk_buff *skb) static inline int dst_input(struct sk_buff *skb)
......
...@@ -807,7 +807,7 @@ static inline u8 ip6_tclass(__be32 flowinfo) ...@@ -807,7 +807,7 @@ static inline u8 ip6_tclass(__be32 flowinfo)
int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, int ipv6_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev); struct packet_type *pt, struct net_device *orig_dev);
int ip6_rcv_finish(struct sock *sk, struct sk_buff *skb); int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
/* /*
* upper-layer output functions * upper-layer output functions
......
...@@ -31,7 +31,7 @@ static inline void nf_bridge_push_encap_header(struct sk_buff *skb) ...@@ -31,7 +31,7 @@ static inline void nf_bridge_push_encap_header(struct sk_buff *skb)
skb->network_header -= len; skb->network_header -= len;
} }
int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb); int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_buff *skb);
static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
{ {
......
...@@ -35,7 +35,7 @@ static inline int should_deliver(const struct net_bridge_port *p, ...@@ -35,7 +35,7 @@ static inline int should_deliver(const struct net_bridge_port *p,
p->state == BR_STATE_FORWARDING; p->state == BR_STATE_FORWARDING;
} }
int br_dev_queue_push_xmit(struct sock *sk, struct sk_buff *skb) int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
if (!is_skb_forwardable(skb->dev, skb)) if (!is_skb_forwardable(skb->dev, skb))
goto drop; goto drop;
...@@ -65,9 +65,8 @@ drop: ...@@ -65,9 +65,8 @@ drop:
} }
EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit); EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit);
int br_forward_finish(struct sock *sk, struct sk_buff *skb) int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct net *net = dev_net(skb->dev);
return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING,
net, sk, skb, NULL, skb->dev, net, sk, skb, NULL, skb->dev,
br_dev_queue_push_xmit); br_dev_queue_push_xmit);
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
br_should_route_hook_t __rcu *br_should_route_hook __read_mostly; br_should_route_hook_t __rcu *br_should_route_hook __read_mostly;
EXPORT_SYMBOL(br_should_route_hook); EXPORT_SYMBOL(br_should_route_hook);
static int br_netif_receive_skb(struct sock *sk, struct sk_buff *skb) static int
br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
return netif_receive_skb(skb); return netif_receive_skb(skb);
} }
...@@ -125,7 +126,7 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br, ...@@ -125,7 +126,7 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
} }
/* note: already called with rcu_read_lock */ /* note: already called with rcu_read_lock */
int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb) int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
const unsigned char *dest = eth_hdr(skb)->h_dest; const unsigned char *dest = eth_hdr(skb)->h_dest;
struct net_bridge_port *p = br_port_get_rcu(skb->dev); struct net_bridge_port *p = br_port_get_rcu(skb->dev);
...@@ -213,7 +214,7 @@ drop: ...@@ -213,7 +214,7 @@ drop:
EXPORT_SYMBOL_GPL(br_handle_frame_finish); EXPORT_SYMBOL_GPL(br_handle_frame_finish);
/* note: already called with rcu_read_lock */ /* note: already called with rcu_read_lock */
static int br_handle_local_finish(struct sock *sk, struct sk_buff *skb) static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct net_bridge_port *p = br_port_get_rcu(skb->dev); struct net_bridge_port *p = br_port_get_rcu(skb->dev);
u16 vid = 0; u16 vid = 0;
......
...@@ -256,7 +256,7 @@ void nf_bridge_update_protocol(struct sk_buff *skb) ...@@ -256,7 +256,7 @@ void nf_bridge_update_protocol(struct sk_buff *skb)
* don't, we use the neighbour framework to find out. In both cases, we make * don't, we use the neighbour framework to find out. In both cases, we make
* sure that br_handle_frame_finish() is called afterwards. * sure that br_handle_frame_finish() is called afterwards.
*/ */
int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb) int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct neighbour *neigh; struct neighbour *neigh;
struct dst_entry *dst; struct dst_entry *dst;
...@@ -273,7 +273,7 @@ int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb) ...@@ -273,7 +273,7 @@ int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb)
if (neigh->hh.hh_len) { if (neigh->hh.hh_len) {
neigh_hh_bridge(&neigh->hh, skb); neigh_hh_bridge(&neigh->hh, skb);
skb->dev = nf_bridge->physindev; skb->dev = nf_bridge->physindev;
ret = br_handle_frame_finish(sk, skb); ret = br_handle_frame_finish(net, sk, skb);
} else { } else {
/* the neighbour function below overwrites the complete /* the neighbour function below overwrites the complete
* MAC header, so we save the Ethernet source address and * MAC header, so we save the Ethernet source address and
...@@ -342,11 +342,10 @@ br_nf_ipv4_daddr_was_changed(const struct sk_buff *skb, ...@@ -342,11 +342,10 @@ br_nf_ipv4_daddr_was_changed(const struct sk_buff *skb,
* device, we proceed as if ip_route_input() succeeded. If it differs from the * device, we proceed as if ip_route_input() succeeded. If it differs from the
* logical bridge port or if ip_route_output_key() fails we drop the packet. * logical bridge port or if ip_route_output_key() fails we drop the packet.
*/ */
static int br_nf_pre_routing_finish(struct sock *sk, struct sk_buff *skb) static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
struct net *net = dev_net(dev);
struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
struct rtable *rt; struct rtable *rt;
int err; int err;
...@@ -536,10 +535,9 @@ static unsigned int br_nf_local_in(const struct nf_hook_ops *ops, ...@@ -536,10 +535,9 @@ static unsigned int br_nf_local_in(const struct nf_hook_ops *ops,
} }
/* PF_BRIDGE/FORWARD *************************************************/ /* PF_BRIDGE/FORWARD *************************************************/
static int br_nf_forward_finish(struct sock *sk, struct sk_buff *skb) static int br_nf_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
struct net *net = dev_net(skb->dev);
struct net_device *in; struct net_device *in;
if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) { if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
...@@ -692,7 +690,7 @@ static int br_nf_push_frag_xmit(struct net *net, struct sock *sk, struct sk_buff ...@@ -692,7 +690,7 @@ static int br_nf_push_frag_xmit(struct net *net, struct sock *sk, struct sk_buff
__skb_push(skb, data->encap_size); __skb_push(skb, data->encap_size);
nf_bridge_info_free(skb); nf_bridge_info_free(skb);
return br_dev_queue_push_xmit(sk, skb); return br_dev_queue_push_xmit(net, sk, skb);
} }
static int br_nf_push_frag_xmit_sk(struct sock *sk, struct sk_buff *skb) static int br_nf_push_frag_xmit_sk(struct sock *sk, struct sk_buff *skb)
{ {
...@@ -728,17 +726,16 @@ static unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb) ...@@ -728,17 +726,16 @@ static unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb)
return 0; return 0;
} }
static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb) static int br_nf_dev_queue_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct nf_bridge_info *nf_bridge; struct nf_bridge_info *nf_bridge;
unsigned int mtu_reserved; unsigned int mtu_reserved;
struct net *net = dev_net(skb_dst(skb)->dev);
mtu_reserved = nf_bridge_mtu_reduction(skb); mtu_reserved = nf_bridge_mtu_reduction(skb);
if (skb_is_gso(skb) || skb->len + mtu_reserved <= skb->dev->mtu) { if (skb_is_gso(skb) || skb->len + mtu_reserved <= skb->dev->mtu) {
nf_bridge_info_free(skb); nf_bridge_info_free(skb);
return br_dev_queue_push_xmit(sk, skb); return br_dev_queue_push_xmit(net, sk, skb);
} }
nf_bridge = nf_bridge_info_get(skb); nf_bridge = nf_bridge_info_get(skb);
...@@ -797,7 +794,7 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb) ...@@ -797,7 +794,7 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb)
} }
#endif #endif
nf_bridge_info_free(skb); nf_bridge_info_free(skb);
return br_dev_queue_push_xmit(sk, skb); return br_dev_queue_push_xmit(net, sk, skb);
drop: drop:
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
...@@ -887,7 +884,7 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb) ...@@ -887,7 +884,7 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
skb->dev = nf_bridge->physindev; skb->dev = nf_bridge->physindev;
nf_bridge->physoutdev = NULL; nf_bridge->physoutdev = NULL;
br_handle_frame_finish(NULL, skb); br_handle_frame_finish(dev_net(skb->dev), NULL, skb);
} }
static int br_nf_dev_xmit(struct sk_buff *skb) static int br_nf_dev_xmit(struct sk_buff *skb)
......
...@@ -161,12 +161,11 @@ br_nf_ipv6_daddr_was_changed(const struct sk_buff *skb, ...@@ -161,12 +161,11 @@ br_nf_ipv6_daddr_was_changed(const struct sk_buff *skb,
* for br_nf_pre_routing_finish(), same logic is used here but * for br_nf_pre_routing_finish(), same logic is used here but
* equivalent IPv6 function ip6_route_input() called indirectly. * equivalent IPv6 function ip6_route_input() called indirectly.
*/ */
static int br_nf_pre_routing_finish_ipv6(struct sock *sk, struct sk_buff *skb) static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
struct rtable *rt; struct rtable *rt;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct net *net = dev_net(dev);
const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops(); const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops();
nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size; nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size;
......
...@@ -413,10 +413,10 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p, ...@@ -413,10 +413,10 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
/* br_forward.c */ /* br_forward.c */
void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb); void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb);
int br_dev_queue_push_xmit(struct sock *sk, struct sk_buff *skb); int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb);
void br_forward(const struct net_bridge_port *to, void br_forward(const struct net_bridge_port *to,
struct sk_buff *skb, struct sk_buff *skb0); struct sk_buff *skb, struct sk_buff *skb0);
int br_forward_finish(struct sock *sk, struct sk_buff *skb); int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, bool unicast); void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, bool unicast);
void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, void br_flood_forward(struct net_bridge *br, struct sk_buff *skb,
struct sk_buff *skb2, bool unicast); struct sk_buff *skb2, bool unicast);
...@@ -434,7 +434,7 @@ void br_port_flags_change(struct net_bridge_port *port, unsigned long mask); ...@@ -434,7 +434,7 @@ void br_port_flags_change(struct net_bridge_port *port, unsigned long mask);
void br_manage_promisc(struct net_bridge *br); void br_manage_promisc(struct net_bridge *br);
/* br_input.c */ /* br_input.c */
int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb); int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
rx_handler_result_t br_handle_frame(struct sk_buff **pskb); rx_handler_result_t br_handle_frame(struct sk_buff **pskb);
static inline bool br_rx_handler_check_rcu(const struct net_device *dev) static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
#define LLC_RESERVE sizeof(struct llc_pdu_un) #define LLC_RESERVE sizeof(struct llc_pdu_un)
static int br_send_bpdu_finish(struct sock *sk, struct sk_buff *skb) static int br_send_bpdu_finish(struct net *net, struct sock *sk,
struct sk_buff *skb)
{ {
return dev_queue_xmit(skb); return dev_queue_xmit(skb);
} }
......
...@@ -2915,9 +2915,11 @@ EXPORT_SYMBOL(xmit_recursion); ...@@ -2915,9 +2915,11 @@ EXPORT_SYMBOL(xmit_recursion);
/** /**
* dev_loopback_xmit - loop back @skb * dev_loopback_xmit - loop back @skb
* @net: network namespace this loopback is happening in
* @sk: sk needed to be a netfilter okfn
* @skb: buffer to transmit * @skb: buffer to transmit
*/ */
int dev_loopback_xmit(struct sock *sk, struct sk_buff *skb) int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
__skb_pull(skb, skb_network_offset(skb)); __skb_pull(skb, skb_network_offset(skb));
......
...@@ -194,7 +194,7 @@ static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb) ...@@ -194,7 +194,7 @@ static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb)
return err; return err;
} }
static int dn_neigh_output_packet(struct sock *sk, struct sk_buff *skb) static int dn_neigh_output_packet(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct dst_entry *dst = skb_dst(skb); struct dst_entry *dst = skb_dst(skb);
struct dn_route *rt = (struct dn_route *)dst; struct dn_route *rt = (struct dn_route *)dst;
...@@ -334,7 +334,7 @@ static int dn_phase3_output(struct neighbour *neigh, struct sock *sk, ...@@ -334,7 +334,7 @@ static int dn_phase3_output(struct neighbour *neigh, struct sock *sk,
dn_neigh_output_packet); dn_neigh_output_packet);
} }
int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb) int dn_to_neigh_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct dst_entry *dst = skb_dst(skb); struct dst_entry *dst = skb_dst(skb);
struct dn_route *rt = (struct dn_route *) dst; struct dn_route *rt = (struct dn_route *) dst;
...@@ -378,7 +378,7 @@ void dn_neigh_pointopoint_hello(struct sk_buff *skb) ...@@ -378,7 +378,7 @@ void dn_neigh_pointopoint_hello(struct sk_buff *skb)
/* /*
* Ethernet router hello message received * Ethernet router hello message received
*/ */
int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb) int dn_neigh_router_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data; struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data;