summaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c6
-rw-r--r--net/x25/x25_link.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 82b39c1b5..e042ce1d8 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -16,6 +16,7 @@
* X.25 001 Jonathan Naylor Started coding.
* X.25 002 Jonathan Naylor Centralised disconnect handling.
* New timer architecture.
+ * 2000-11-03 Henner Eisen MSG_EOR handling more POSIX compliant.
*/
#include <linux/config.h>
@@ -851,7 +852,7 @@ static int x25_sendmsg(struct socket *sock, struct msghdr *msg, int len, struct
if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_OOB | MSG_EOR))
return -EINVAL;
- /* we currently don't support segments at the user interface */
+ /* we currently don't support segmented records at the user interface */
if (!(msg->msg_flags & MSG_EOR))
return -EINVAL;
@@ -1034,6 +1035,9 @@ static int x25_recvmsg(struct socket *sock, struct msghdr *msg, int size, int fl
msg->msg_flags |= MSG_TRUNC;
}
+ /* Currently, each datagram always contains a complete record */
+ msg->msg_flags |= MSG_EOR;
+
skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
if (sx25 != NULL) {
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c
index be9f7edd3..d33dc63c3 100644
--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -73,18 +73,25 @@ static void x25_stop_t20timer(struct x25_neigh *neigh)
del_timer(&neigh->t20timer);
}
+static int x25_t20timer_pending(struct x25_neigh *neigh)
+{
+ return timer_pending(&neigh->t20timer);
+}
+
/*
* This handles all restart and diagnostic frames.
*/
void x25_link_control(struct sk_buff *skb, struct x25_neigh *neigh, unsigned short frametype)
{
struct sk_buff *skbn;
+ int confirm;
switch (frametype) {
case X25_RESTART_REQUEST:
+ confirm = !x25_t20timer_pending(neigh);
x25_stop_t20timer(neigh);
neigh->state = X25_LINK_STATE_3;
- x25_transmit_restart_confirmation(neigh);
+ if (confirm) x25_transmit_restart_confirmation(neigh);
break;
case X25_RESTART_CONFIRMATION: