net: l2: ppp: fix packet length for sending Term-Req and Term-Ack
Each PPP packet sent on wire needs to have at least 4 bytes length. Set that length for outgoing Term-Req and Term-Ack packets. Also update length validation to check for at least 4 bytes instead of at least 1 byte. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
parent
c3308275f6
commit
16542e1642
1 changed files with 2 additions and 1 deletions
|
@ -417,13 +417,14 @@ int ppp_send_pkt(struct ppp_fsm *fsm, struct net_if *iface,
|
|||
|
||||
case PPP_TERMINATE_REQ:
|
||||
case PPP_TERMINATE_ACK:
|
||||
len = sizeof(ppp);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
if (len < sizeof(ppp)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue