Re: [PATCH net-next v6 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-31 Thread Xie He
On Fri, Oct 30, 2020 at 5:49 PM Xie He wrote: > > Add an fh->ea2 check to the initial checks in fr_rx. fh->ea2 == 1 means > the second address byte is the final address byte. We only support the > case where the address length is 2 bytes. If the address length is not > 2 bytes, the control field a

Re: [PATCH net-next v6 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-31 Thread Willem de Bruijn
On Fri, Oct 30, 2020 at 8:49 PM Xie He wrote: > > 1. > Change the skb->len check from "<= 4" to "< 4". > At first we only need to ensure a 4-byte header is present. We indeed > normally need the 5th byte, too, but it'd be more logical and cleaner > to check its existence when we actually need it.

[PATCH net-next v6 4/5] net: hdlc_fr: Improve the initial checks when we receive an skb

2020-10-30 Thread Xie He
1. Change the skb->len check from "<= 4" to "< 4". At first we only need to ensure a 4-byte header is present. We indeed normally need the 5th byte, too, but it'd be more logical and cleaner to check its existence when we actually need it. 2. Add an fh->ea2 check to the initial checks in fr_rx. fh