aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrew Hendry <andrew.hendry@gmail.com>2007-02-08 16:34:36 -0500
committerDavid S. Miller <davem@davemloft.net>2007-02-08 16:34:36 -0500
commit39e21c0d34fe769d06839679fa920217359a58b0 (patch)
tree954c04db643a0f4d9fb7e4dc686981a6b207ed57 /net
parent95a9dc4390c8215d922e0ca2ebb95279261fe795 (diff)
[X.25]: Adds /proc/sys/net/x25/x25_forward to control forwarding.
echo "1" > /proc/sys/net/x25/x25_forward To turn on x25_forwarding, defaults to off Requires the previous patch. Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/x25/af_x25.c4
-rw-r--r--net/x25/sysctl_net_x25.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 0872025821c5..b37d894358ec 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -63,6 +63,7 @@ int sysctl_x25_call_request_timeout = X25_DEFAULT_T21;
63int sysctl_x25_reset_request_timeout = X25_DEFAULT_T22; 63int sysctl_x25_reset_request_timeout = X25_DEFAULT_T22;
64int sysctl_x25_clear_request_timeout = X25_DEFAULT_T23; 64int sysctl_x25_clear_request_timeout = X25_DEFAULT_T23;
65int sysctl_x25_ack_holdback_timeout = X25_DEFAULT_T2; 65int sysctl_x25_ack_holdback_timeout = X25_DEFAULT_T2;
66int sysctl_x25_forward = 0;
66 67
67HLIST_HEAD(x25_list); 68HLIST_HEAD(x25_list);
68DEFINE_RWLOCK(x25_list_lock); 69DEFINE_RWLOCK(x25_list_lock);
@@ -884,7 +885,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
884 */ 885 */
885 if (sk == NULL) { 886 if (sk == NULL) {
886 skb_push(skb, addr_len + X25_STD_MIN_LEN); 887 skb_push(skb, addr_len + X25_STD_MIN_LEN);
887 if (x25_forward_call(&dest_addr, nb, skb, lci) > 0) 888 if (sysctl_x25_forward &&
889 x25_forward_call(&dest_addr, nb, skb, lci) > 0)
888 { 890 {
889 /* Call was forwarded, dont process it any more */ 891 /* Call was forwarded, dont process it any more */
890 kfree_skb(skb); 892 kfree_skb(skb);
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c
index aabda59c824e..2b2e7fd689f3 100644
--- a/net/x25/sysctl_net_x25.c
+++ b/net/x25/sysctl_net_x25.c
@@ -73,6 +73,14 @@ static struct ctl_table x25_table[] = {
73 .extra1 = &min_timer, 73 .extra1 = &min_timer,
74 .extra2 = &max_timer, 74 .extra2 = &max_timer,
75 }, 75 },
76 {
77 .ctl_name = NET_X25_FORWARD,
78 .procname = "x25_forward",
79 .data = &sysctl_x25_forward,
80 .maxlen = sizeof(int),
81 .mode = 0644,
82 .proc_handler = &proc_dointvec,
83 },
76 { 0, }, 84 { 0, },
77}; 85};
78 86