Message ID | 20201203140604.25488-2-socketcan@hartkopp.net |
---|---|
State | Not Applicable |
Headers | show |
Series | can-isotp fix and functional addressing | expand |
diff --git a/net/can/isotp.c b/net/can/isotp.c index d78ab13bd8be..26bdc3c20b7e 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1155,10 +1155,13 @@ static int isotp_setsockopt(struct socket *sock, int level, int optname, int ret = 0; if (level != SOL_CAN_ISOTP) return -EINVAL; + if (so->bound) + return -EISCONN; + switch (optname) { case CAN_ISOTP_OPTS: if (optlen != sizeof(struct can_isotp_options)) return -EINVAL;