it is hard to combine with IsoCAN support and make no sense if it is needed to confirm transferred package. Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- Documentation/networking/j1939.rst | 6 ------ include/uapi/linux/can/j1939.h | 5 ++--- net/can/j1939/j1939-priv.h | 3 +-- net/can/j1939/socket.c | 12 ++---------- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Documentation/networking/j1939.rst b/Documentation/networking/j1939.rst index ba981ee8d717..814fcc6054ad 100644 --- a/Documentation/networking/j1939.rst +++ b/Documentation/networking/j1939.rst @@ -217,7 +217,6 @@ modified with setsockopt(2) & getsockopt(2). RX path related options: SO_J1939_FILTER - configure array of filters SO_J1939_PROMISC - disable filters set by bind(2) and connect(2) -SO_J1939_RECV_OWN - receive packets that have been sent on this socket By default no broadcast packets can't be send or received. To enable sending or receiving broadcast packets use the socket option SO_BROADCAST: @@ -237,11 +236,6 @@ The following diagram illustrates the RX path: | V +--------------------+ - | SO_J1939_RECV_OWN? | - +--------------------+ - | - v - +--------------------+ | SO_J1939_PROMISC? | +--------------------+ | | diff --git a/include/uapi/linux/can/j1939.h b/include/uapi/linux/can/j1939.h index 603ce1394ebb..c32325342d30 100644 --- a/include/uapi/linux/can/j1939.h +++ b/include/uapi/linux/can/j1939.h @@ -64,9 +64,8 @@ typedef __u64 name_t; enum { SO_J1939_FILTER = 1, /* set filters */ SO_J1939_PROMISC = 2, /* set/clr promiscuous mode */ - SO_J1939_RECV_OWN = 3, - SO_J1939_SEND_PRIO = 4, - SO_J1939_ERRQUEUE = 5, + SO_J1939_SEND_PRIO = 3, + SO_J1939_ERRQUEUE = 4, }; enum { diff --git a/net/can/j1939/j1939-priv.h b/net/can/j1939/j1939-priv.h index 303fd15ca595..f68256aa01f2 100644 --- a/net/can/j1939/j1939-priv.h +++ b/net/can/j1939/j1939-priv.h @@ -282,8 +282,7 @@ struct j1939_sock { #define J1939_SOCK_BOUND BIT(0) #define J1939_SOCK_CONNECTED BIT(1) #define J1939_SOCK_PROMISC BIT(2) -#define J1939_SOCK_RECV_OWN BIT(3) -#define J1939_SOCK_ERRQUEUE BIT(4) +#define J1939_SOCK_ERRQUEUE BIT(3) int state; int ifindex; diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index f29b5613207b..90c4e766e60b 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -275,7 +275,7 @@ static bool j1939_sk_recv_match_one(struct j1939_sock *jsk, if (!(jsk->state & J1939_SOCK_BOUND)) return false; - if (skcb->insock == &jsk->sk && !(jsk->state & J1939_SOCK_RECV_OWN)) + if (skcb->insock == &jsk->sk) /* own message */ return false; @@ -303,11 +303,9 @@ static void j1939_sk_recv_one(struct j1939_sock *jsk, struct sk_buff *oskb) return; } skcb = j1939_skb_to_cb(skb); - skcb->msg_flags &= ~(MSG_DONTROUTE | MSG_CONFIRM); + skcb->msg_flags &= ~(MSG_DONTROUTE); if (skcb->insock) skcb->msg_flags |= MSG_DONTROUTE; - if (skcb->insock == &jsk->sk) - skcb->msg_flags |= MSG_CONFIRM; if (sock_queue_rcv_skb(&jsk->sk, skb) < 0) kfree_skb(skb); @@ -641,9 +639,6 @@ static int j1939_sk_setsockopt(struct socket *sock, int level, int optname, case SO_J1939_PROMISC: return j1939_sk_setsockopt_flag(jsk, optval, optlen, J1939_SOCK_PROMISC); - case SO_J1939_RECV_OWN: - return j1939_sk_setsockopt_flag(jsk, optval, optlen, - J1939_SOCK_RECV_OWN); case SO_J1939_ERRQUEUE: ret = j1939_sk_setsockopt_flag(jsk, optval, optlen, J1939_SOCK_ERRQUEUE); @@ -694,9 +689,6 @@ static int j1939_sk_getsockopt(struct socket *sock, int level, int optname, case SO_J1939_PROMISC: tmp = (jsk->state & J1939_SOCK_PROMISC) ? 1 : 0; break; - case SO_J1939_RECV_OWN: - tmp = (jsk->state & J1939_SOCK_RECV_OWN) ? 1 : 0; - break; case SO_J1939_ERRQUEUE: tmp = (jsk->state & J1939_SOCK_ERRQUEUE) ? 1 : 0; break; -- 2.20.1