[NETROM]: Implement G8PZT Circuit reset for NET/ROM

NET/ROM is lacking a connection reset like TCP's RST flag which at times
may result in a connecting having to slowly timing out instead of just being
reset.  An earlier attempt to reset the connection by sending a
NR_CONNACK | NR_CHOKE_FLAG transport was inacceptable as it did result in
crashes of BPQ systems.  An alternative approach of introducing a new
transport type 7 (NR_RESET) has be implemented several years ago in
Paula Jayne Dowie G8PZT's Xrouter.

Implement NR_RESET for Linux's NET/ROM but like any messing with the state
engine consider this experimental for now and thus control it by a sysctl
(net.netrom.reset) which for the time being defaults to off.

Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ralf Baechle
2005-09-12 14:27:37 -07:00
committed by David S. Miller
parent d2ce4bc340
commit e21ce8c7c0
6 changed files with 69 additions and 16 deletions

View File

@@ -210,10 +210,9 @@ void nr_write_internal(struct sock *sk, int frametype)
}
/*
* This routine is called when a Connect Acknowledge with the Choke Flag
* set is needed to refuse a connection.
* This routine is called to send an error reply.
*/
void nr_transmit_refusal(struct sk_buff *skb, int mine)
void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags)
{
struct sk_buff *skbn;
unsigned char *dptr;
@@ -254,7 +253,7 @@ void nr_transmit_refusal(struct sk_buff *skb, int mine)
*dptr++ = 0;
}
*dptr++ = NR_CONNACK | NR_CHOKE_FLAG;
*dptr++ = cmdflags;
*dptr++ = 0;
if (!nr_route_frame(skbn, NULL))