Skip to content

Commit dadeb61

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
bonding: 3ad: remove bond_3ad_rx_indication's length argument
Since the received lacpdu is accessed via skb_header_pointer() in bond_3ad_lacpdu_recv() we no longer need to check for skb->len's length. If the returned lacpdu pointer is not null that should be enough. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3d02171 commit dadeb61

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/net/bonding/bond_3ad.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,22 +2348,17 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
23482348
* bond_3ad_rx_indication - handle a received frame
23492349
* @lacpdu: received lacpdu
23502350
* @slave: slave struct to work on
2351-
* @length: length of the data received
23522351
*
23532352
* It is assumed that frames that were sent on this NIC don't returned as new
23542353
* received frames (loopback). Since only the payload is given to this
23552354
* function, it check for loopback.
23562355
*/
2357-
static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
2358-
u16 length)
2356+
static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
23592357
{
23602358
int ret = RX_HANDLER_ANOTHER;
23612359
struct bond_marker *marker;
23622360
struct port *port;
23632361

2364-
if (length < sizeof(struct lacpdu))
2365-
return ret;
2366-
23672362
port = &(SLAVE_AD_INFO(slave)->port);
23682363
if (!port->slave) {
23692364
net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n",
@@ -2643,7 +2638,7 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
26432638
if (!lacpdu)
26442639
return RX_HANDLER_ANOTHER;
26452640

2646-
return bond_3ad_rx_indication(lacpdu, slave, skb->len);
2641+
return bond_3ad_rx_indication(lacpdu, slave);
26472642
}
26482643

26492644
/**

0 commit comments

Comments
 (0)