[X.25]: Adds /proc/sys/net/x25/x25_forward to control forwarding.
authorAndrew Hendry <andrew.hendry@gmail.com>
Thu, 8 Feb 2007 21:34:36 +0000 (13:34 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Feb 2007 21:34:36 +0000 (13:34 -0800)
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>
include/linux/sysctl.h
include/net/x25.h
net/x25/af_x25.c
net/x25/sysctl_net_x25.c

index 81480e6134674c19030f48336ca718ab40fbb100..665412c4f4b910cdc8c60da3174a1f48ccbbd61d 100644 (file)
@@ -699,7 +699,8 @@ enum {
        NET_X25_CALL_REQUEST_TIMEOUT=2,
        NET_X25_RESET_REQUEST_TIMEOUT=3,
        NET_X25_CLEAR_REQUEST_TIMEOUT=4,
-       NET_X25_ACK_HOLD_BACK_TIMEOUT=5
+       NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
+       NET_X25_FORWARD=6
 };
 
 /* /proc/sys/net/token-ring */
index 3b1190514d922d62925b60b74893bf53a3644ac4..fc3f03d976f8782fc6e4d4d45e18b0775ab1d0e7 100644 (file)
@@ -180,6 +180,7 @@ extern int  sysctl_x25_call_request_timeout;
 extern int  sysctl_x25_reset_request_timeout;
 extern int  sysctl_x25_clear_request_timeout;
 extern int  sysctl_x25_ack_holdback_timeout;
+extern int  sysctl_x25_forward;
 
 extern int  x25_addr_ntoa(unsigned char *, struct x25_address *,
                          struct x25_address *);
index 0872025821c5fd8e3d9e26ea7e70af3e63c0fa85..b37d894358ec28fb68e83d387a79b486024e40a2 100644 (file)
@@ -63,6 +63,7 @@ int sysctl_x25_call_request_timeout    = X25_DEFAULT_T21;
 int sysctl_x25_reset_request_timeout   = X25_DEFAULT_T22;
 int sysctl_x25_clear_request_timeout   = X25_DEFAULT_T23;
 int sysctl_x25_ack_holdback_timeout    = X25_DEFAULT_T2;
+int sysctl_x25_forward                 = 0;
 
 HLIST_HEAD(x25_list);
 DEFINE_RWLOCK(x25_list_lock);
@@ -884,7 +885,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
         */
        if (sk == NULL) {
                skb_push(skb, addr_len + X25_STD_MIN_LEN);
-               if (x25_forward_call(&dest_addr, nb, skb, lci) > 0)
+               if (sysctl_x25_forward &&
+                               x25_forward_call(&dest_addr, nb, skb, lci) > 0)
                {
                        /* Call was forwarded, dont process it any more */
                        kfree_skb(skb);
index aabda59c824e795409f5dec97f5fe9ff78b8ea87..2b2e7fd689f3904342b4bb678043c3d5076a24c7 100644 (file)
@@ -73,6 +73,14 @@ static struct ctl_table x25_table[] = {
                .extra1 =       &min_timer,
                .extra2 =       &max_timer,
        },
+       {
+               .ctl_name =     NET_X25_FORWARD,
+               .procname =     "x25_forward",
+               .data =         &sysctl_x25_forward,
+               .maxlen =       sizeof(int),
+               .mode =         0644,
+               .proc_handler = &proc_dointvec,
+       },
        { 0, },
 };