net: lapbether: Consider it successful if (dis)connecting when already (dis)connected
authorXie He <xie.he.0141@gmail.com>
Tue, 8 Dec 2020 22:50:44 +0000 (14:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 21:18:28 +0000 (13:18 -0800)
commit3b0c860f872da622a39707bda11064395199836f
tree7205a80fcdcb9902a8cdc1897f3d40bdc3141e4a
parentbfa5e98c9de466bfe25a9b4bf6ef9122aee2d06a
net: lapbether: Consider it successful if (dis)connecting when already (dis)connected

When the upper layer instruct us to connect (or disconnect), but we have
already connected (or disconnected), consider this operation successful
rather than failed.

This can help the upper layer to correct its record about whether we are
connected or not here in layer 2.

The upper layer may not have the correct information about whether we are
connected or not. This can happen if this driver has already been running
for some time when the "x25" module gets loaded.

Another X.25 driver (hdlc_x25) is already doing this, so we make this
driver do this, too.

Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Acked-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/lapbether.c