blob: 8b8400baa387cd9c3a6063413d30039e4512f3bb [file] [log] [blame]
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2023 MediaTek Inc. All Rights Reserved.
*
* Author: Frank-zj Lin <rank-zj.lin@mediatek.com>
* Ren-Ting Wang <ren-ting.wang@mediatek.com>
*/
#include "tops/protocol/mac/ppp.h"
bool mtk_tops_ppp_valid(struct sk_buff *skb)
{
struct ppp_hdr *ppp;
struct ppp_hdr ppph;
ppp = skb_header_pointer(skb, 0, sizeof(struct ppp_hdr), &ppph);
if (unlikely(!ppp))
return false;
return (ppp->addr == PPP_ALLSTATIONS &&
ppp->ctrl == PPP_UI && ntohs(ppp->proto) == PPP_IP);
}