Skip to content

Commit af1c0e4

Browse files
achantaskdavem330
authored andcommitted
llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
When a frame with NULL DSAP is received, llc_station_rcv is called. In turn, llc_stat_ev_rx_null_dsap_xid_c is called to check if it is a NULL XID frame. The return statement of llc_stat_ev_rx_null_dsap_xid_c returns 1 when the incoming frame is not a NULL XID frame and 0 otherwise. Hence, a NULL XID response is returned unexpectedly, e.g. when the incoming frame is a NULL TEST command. To fix the error, simply remove the conditional operator. A similar error in llc_stat_ev_rx_null_dsap_test_c is also fixed. Signed-off-by: Chan Shu Tak, Alex <alexchan@task.com.hk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 90b3b33 commit af1c0e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/llc/llc_station.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static int llc_stat_ev_rx_null_dsap_xid_c(struct sk_buff *skb)
3232
return LLC_PDU_IS_CMD(pdu) && /* command PDU */
3333
LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
3434
LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&
35-
!pdu->dsap ? 0 : 1; /* NULL DSAP value */
35+
!pdu->dsap; /* NULL DSAP value */
3636
}
3737

3838
static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
@@ -42,7 +42,7 @@ static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
4242
return LLC_PDU_IS_CMD(pdu) && /* command PDU */
4343
LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
4444
LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&
45-
!pdu->dsap ? 0 : 1; /* NULL DSAP */
45+
!pdu->dsap; /* NULL DSAP */
4646
}
4747

4848
static int llc_station_ac_send_xid_r(struct sk_buff *skb)

0 commit comments

Comments
 (0)