summaryrefslogtreecommitdiffstats
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
commitc7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch)
tree3682407a599b8f9f03fc096298134cafba1c9b2f /net/x25/af_x25.c
parent1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff)
o Merge with Linux 2.1.116.
o New Newport console code. o New G364 console code.
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 514f64e1b..60a3581e5 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -174,7 +174,8 @@ static void x25_kill_by_device(struct device *dev)
struct sock *s;
for (s = x25_list; s != NULL; s = s->next)
- if (s->protinfo.x25->neighbour->dev == dev)
+ if (s->protinfo.x25->neighbour &&
+ s->protinfo.x25->neighbour->dev == dev)
x25_disconnect(s, ENETUNREACH, 0, 0);
}
@@ -621,6 +622,9 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len
if ((sk->protinfo.x25->neighbour = x25_get_neigh(dev)) == NULL)
return -ENETUNREACH;
+ x25_limit_facilities(&sk->protinfo.x25->facilities,
+ sk->protinfo.x25->neighbour);
+
if ((sk->protinfo.x25->lci = x25_new_lci(sk->protinfo.x25->neighbour)) == 0)
return -ENETUNREACH;
@@ -787,6 +791,13 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *neigh, unsigned i
}
/*
+ * current neighbour/link might impose additional limits
+ * on certain facilties
+ */
+
+ x25_limit_facilities(&facilities,neigh);
+
+ /*
* Try to create a new socket.
*/
if ((make = x25_make_new(sk)) == NULL) {
@@ -1124,18 +1135,8 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
return -EINVAL;
if (facilities.pacsize_out < X25_PS16 || facilities.pacsize_out > X25_PS4096)
return -EINVAL;
- if (sk->state == TCP_CLOSE || sk->protinfo.x25->neighbour->extended)
- {
- if (facilities.winsize_in < 1 || facilities.winsize_in > 127)
- return -EINVAL;
- if (facilities.winsize_out < 1 || facilities.winsize_out > 127)
- return -EINVAL;
- } else {
- if (facilities.winsize_in < 1 || facilities.winsize_in > 7)
- return -EINVAL;
- if (facilities.winsize_out < 1 || facilities.winsize_out > 7)
- return -EINVAL;
- }
+ if (facilities.winsize_in < 1 || facilities.winsize_in > 127)
+ return -EINVAL;
if (facilities.throughput < 0x03 || facilities.throughput > 0x2C)
return -EINVAL;
if (facilities.reverse != 0 && facilities.reverse != 1)
@@ -1276,6 +1277,16 @@ struct notifier_block x25_dev_notifier = {
0
};
+void x25_kill_by_neigh(struct x25_neigh *neigh)
+{
+ struct sock *s;
+
+ for( s=x25_list; s != NULL; s=s->next){
+ if( s->protinfo.x25->neighbour == neigh )
+ x25_disconnect(s, ENETUNREACH, 0, 0);
+ }
+}
+
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry proc_net_x25 = {
PROC_NET_X25, 3, "x25",