Re: [PATCH net-next] pppoe: drop PFC frames
From: Paolo Abeni
Date: Tue Apr 07 2026 - 07:05:28 EST
On 4/7/26 5:19 AM, qingfang.deng@xxxxxxxxx wrote:
> April 6, 2026 at 10:48 PM, Simon Horman wrote:
>> I think it would be best to add/use a #define rather than
>> open coding the magic value 0x01. And perhaps expanding
>> the comment to note that skb->data[0] is the first byte
>> of the PPP protocol would be nice too.
>
> The field does not have a canonical name. As per RFC1661, the LSB of the
> first octet is used to test if the protocol field is compressed, and the
> same code snippet is used in ppp_generic.c.
>
> I could instead add a helper function:
>
> static inline bool ppp_skb_is_compressed_proto(const struct sk_buff *skb)
> {
> return skb->data[0] & 0x01;
> }
>
> What do you think?
The helper LGTM, and could be re-used in ppp_generic.c, too.
/P