@@ -1049,8 +1049,8 @@ static void le_conn_param_rsp(struct bt_l2cap *l2cap, struct net_buf *buf)
1049
1049
{
1050
1050
struct bt_l2cap_conn_param_rsp * rsp = (void * )buf -> data ;
1051
1051
1052
- if (buf -> len < sizeof (* rsp )) {
1053
- LOG_ERR ("Too small LE conn param rsp" );
1052
+ if (buf -> len != sizeof (* rsp )) {
1053
+ LOG_ERR ("Invalid LE conn param rsp size " );
1054
1054
return ;
1055
1055
}
1056
1056
@@ -1066,8 +1066,8 @@ static void le_conn_param_update_req(struct bt_l2cap *l2cap, uint8_t ident,
1066
1066
struct bt_l2cap_conn_param_req * req = (void * )buf -> data ;
1067
1067
bool accepted ;
1068
1068
1069
- if (buf -> len < sizeof (* req )) {
1070
- LOG_ERR ("Too small LE conn update param req" );
1069
+ if (buf -> len != sizeof (* req )) {
1070
+ LOG_ERR ("Invalid LE conn update param req size " );
1071
1071
return ;
1072
1072
}
1073
1073
@@ -1458,8 +1458,8 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident,
1458
1458
uint16_t psm , scid , mtu , mps , credits ;
1459
1459
uint16_t result ;
1460
1460
1461
- if (buf -> len < sizeof (* req )) {
1462
- LOG_ERR ("Too small LE conn req packet size" );
1461
+ if (buf -> len != sizeof (* req )) {
1462
+ LOG_ERR ("Invalid LE conn req packet size" );
1463
1463
return ;
1464
1464
}
1465
1465
@@ -1759,8 +1759,8 @@ static void le_ecred_reconf_rsp(struct bt_l2cap *l2cap, uint8_t ident,
1759
1759
struct bt_l2cap_le_chan * ch ;
1760
1760
uint16_t result ;
1761
1761
1762
- if (buf -> len < sizeof (* rsp )) {
1763
- LOG_ERR ("Too small ecred reconf rsp packet size" );
1762
+ if (buf -> len != sizeof (* rsp )) {
1763
+ LOG_ERR ("Invalid ecred reconf rsp packet size" );
1764
1764
return ;
1765
1765
}
1766
1766
@@ -1820,8 +1820,8 @@ static void le_disconn_req(struct bt_l2cap *l2cap, uint8_t ident,
1820
1820
struct bt_l2cap_disconn_rsp * rsp ;
1821
1821
uint16_t dcid ;
1822
1822
1823
- if (buf -> len < sizeof (* req )) {
1824
- LOG_ERR ("Too small LE conn req packet size" );
1823
+ if (buf -> len != sizeof (* req )) {
1824
+ LOG_ERR ("Invalid LE conn req packet size" );
1825
1825
return ;
1826
1826
}
1827
1827
@@ -2039,8 +2039,8 @@ static void le_conn_rsp(struct bt_l2cap *l2cap, uint8_t ident,
2039
2039
struct bt_l2cap_le_conn_rsp * rsp = (void * )buf -> data ;
2040
2040
uint16_t dcid , mtu , mps , credits , result ;
2041
2041
2042
- if (buf -> len < sizeof (* rsp )) {
2043
- LOG_ERR ("Too small LE conn rsp packet size" );
2042
+ if (buf -> len != sizeof (* rsp )) {
2043
+ LOG_ERR ("Invalid LE conn rsp packet size" );
2044
2044
return ;
2045
2045
}
2046
2046
@@ -2111,8 +2111,8 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident,
2111
2111
struct bt_l2cap_disconn_rsp * rsp = (void * )buf -> data ;
2112
2112
uint16_t scid ;
2113
2113
2114
- if (buf -> len < sizeof (* rsp )) {
2115
- LOG_ERR ("Too small LE disconn rsp packet size" );
2114
+ if (buf -> len != sizeof (* rsp )) {
2115
+ LOG_ERR ("Invalid LE disconn rsp packet size" );
2116
2116
return ;
2117
2117
}
2118
2118
@@ -2137,8 +2137,8 @@ static void le_credits(struct bt_l2cap *l2cap, uint8_t ident,
2137
2137
struct bt_l2cap_le_chan * le_chan ;
2138
2138
uint16_t credits , cid ;
2139
2139
2140
- if (buf -> len < sizeof (* ev )) {
2141
- LOG_ERR ("Too small LE Credits packet size" );
2140
+ if (buf -> len != sizeof (* ev )) {
2141
+ LOG_ERR ("Invalid LE Credits packet size" );
2142
2142
return ;
2143
2143
}
2144
2144
0 commit comments