zeek / zeek-af_packet-plugin

Plugin providing native AF_Packet support for Zeek.
Other
33 stars 30 forks source link

centos-7: TP_STATUS_CSUM_VALID was not declared in this scope #42

Closed awelzel closed 2 years ago

awelzel commented 2 years ago

Compilation fails on centos-7 since merge of #30 :

The TP_STATUS_CSUM_VALID flag isn't included in centos-7 version if if_packet.h

../../../../auxil/zeek-af_packet-plugin/src/AF_Packet.cc: In member function ‘virtual bool zeek::iosource::pktsrc::AF_PacketSource::ExtractNextPacket(zeek::Packet*)’:
../../../../auxil/zeek-af_packet-plugin/src/AF_Packet.cc:271:33: error: ‘TP_STATUS_CSUM_VALID’ was not declared in this scope
     if ( ( (packet->tp_status & TP_STATUS_CSUM_VALID) != 0 ) ||
                                 ^~~~~~~~~~~~~~~~~~~~
../../../../auxil/zeek-af_packet-plugin/src/AF_Packet.cc:271:33: note: suggested alternative: ‘TP_STATUS_VLAN_VALID’
     if ( ( (packet->tp_status & TP_STATUS_CSUM_VALID) != 0 ) ||
                                 ^~~~~~~~~~~~~~~~~~~~
                                 TP_STATUS_VLAN_VALID

The Suricata folks define it if it's not there and I think we could just do the same:

https://github.com/OISF/suricata/blob/2158dbf3baf1e519b28569e57999a0e6d81279a4/src/source-af-packet.c#L199-L201

awelzel commented 2 years ago

Reference to CI job from zeek/zeek: https://cirrus-ci.com/task/6224900917559296?logs=build#L2017

J-Gras commented 2 years ago

Fixed by #43.