Re: Cannot get the correct IP version from packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> 在 2024年3月17日,02:51,Alessandro Vesely <vesely@xxxxxxx> 写道:
> 
> On Sat 16/Mar/2024 19:11:58 +0100 Alessandro Vesely wrote:
>>     char *payload = mnl_attr_get_payload(attr[NFQA_PAYLOAD]);
>>     if (payload)
>>     {
>>         int const af = (payload[0] & 0xf);
> 
> Heck, should be af = (payload[0] &0xf0)>>4 = 0x6
> 
> third time I change it...
> 
> 
> Best
> Ale
> 

char *payload = mnl_attr_get_payload(attr[NFQA_PAYLOAD]);

 before this line, you must check if attr[NFQA_PAYLOAD] is NULL pointer,may be it is NULL pointer







[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux