aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-09-15 21:04:18 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-17 20:18:37 -0400
commit0c4b51f0054ce85c0ec578ab818f0631834573eb (patch)
tree73e729f58fbaf6420e0f390e36aa936ddaa219ef /net/decnet
parent9dff2c966a0a79a4222553a851f17e679fc28a43 (diff)
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: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/dn_neigh.c8
-rw-r--r--net/decnet/dn_nsp_in.c3
-rw-r--r--net/decnet/dn_route.c6
3 files changed, 9 insertions, 8 deletions
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 305ab2fe25cd..482730cd8a56 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -194,7 +194,7 @@ static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb)
194 return err; 194 return err;
195} 195}
196 196
197static int dn_neigh_output_packet(struct sock *sk, struct sk_buff *skb) 197static int dn_neigh_output_packet(struct net *net, struct sock *sk, struct sk_buff *skb)
198{ 198{
199 struct dst_entry *dst = skb_dst(skb); 199 struct dst_entry *dst = skb_dst(skb);
200 struct dn_route *rt = (struct dn_route *)dst; 200 struct dn_route *rt = (struct dn_route *)dst;
@@ -334,7 +334,7 @@ static int dn_phase3_output(struct neighbour *neigh, struct sock *sk,
334 dn_neigh_output_packet); 334 dn_neigh_output_packet);
335} 335}
336 336
337int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb) 337int dn_to_neigh_output(struct net *net, struct sock *sk, struct sk_buff *skb)
338{ 338{
339 struct dst_entry *dst = skb_dst(skb); 339 struct dst_entry *dst = skb_dst(skb);
340 struct dn_route *rt = (struct dn_route *) dst; 340 struct dn_route *rt = (struct dn_route *) dst;
@@ -378,7 +378,7 @@ void dn_neigh_pointopoint_hello(struct sk_buff *skb)
378/* 378/*
379 * Ethernet router hello message received 379 * Ethernet router hello message received
380 */ 380 */
381int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb) 381int dn_neigh_router_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
382{ 382{
383 struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data; 383 struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data;
384 384
@@ -440,7 +440,7 @@ int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb)
440/* 440/*
441 * Endnode hello message received 441 * Endnode hello message received
442 */ 442 */
443int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb) 443int dn_neigh_endnode_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
444{ 444{
445 struct endnode_hello_message *msg = (struct endnode_hello_message *)skb->data; 445 struct endnode_hello_message *msg = (struct endnode_hello_message *)skb->data;
446 struct neighbour *neigh; 446 struct neighbour *neigh;
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index e7b0605ca34a..7ac086d5c0c0 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -714,7 +714,8 @@ out:
714 return ret; 714 return ret;
715} 715}
716 716
717static int dn_nsp_rx_packet(struct sock *sk2, struct sk_buff *skb) 717static int dn_nsp_rx_packet(struct net *net, struct sock *sk2,
718 struct sk_buff *skb)
718{ 719{
719 struct dn_skb_cb *cb = DN_SKB_CB(skb); 720 struct dn_skb_cb *cb = DN_SKB_CB(skb);
720 struct sock *sk = NULL; 721 struct sock *sk = NULL;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index fefcd2e85ef9..e930321e2c1d 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -512,7 +512,7 @@ static int dn_return_long(struct sk_buff *skb)
512 * 512 *
513 * Returns: result of input function if route is found, error code otherwise 513 * Returns: result of input function if route is found, error code otherwise
514 */ 514 */
515static int dn_route_rx_packet(struct sock *sk, struct sk_buff *skb) 515static int dn_route_rx_packet(struct net *net, struct sock *sk, struct sk_buff *skb)
516{ 516{
517 struct dn_skb_cb *cb; 517 struct dn_skb_cb *cb;
518 int err; 518 int err;
@@ -610,7 +610,7 @@ drop_it:
610 return NET_RX_DROP; 610 return NET_RX_DROP;
611} 611}
612 612
613static int dn_route_discard(struct sock *sk, struct sk_buff *skb) 613static int dn_route_discard(struct net *net, struct sock *sk, struct sk_buff *skb)
614{ 614{
615 /* 615 /*
616 * I know we drop the packet here, but thats considered success in 616 * I know we drop the packet here, but thats considered success in
@@ -620,7 +620,7 @@ static int dn_route_discard(struct sock *sk, struct sk_buff *skb)
620 return NET_RX_SUCCESS; 620 return NET_RX_SUCCESS;
621} 621}
622 622
623static int dn_route_ptp_hello(struct sock *sk, struct sk_buff *skb) 623static int dn_route_ptp_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
624{ 624{
625 dn_dev_hello(skb); 625 dn_dev_hello(skb);
626 dn_neigh_pointopoint_hello(skb); 626 dn_neigh_pointopoint_hello(skb);