Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
pmacct
> pmacct-0.12.3_nfacct_ip-protocol-version.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File pmacct-0.12.3_nfacct_ip-protocol-version.patch of Package pmacct (Revision 27)
Currently displaying revision
27
,
show latest
--- pmacct-0.12.3/src/nfacctd.c 2010-06-07 03:21:02.000000000 +0200 +++ cvs/pmacct/src/nfacctd.c 2010-07-29 23:16:08.000000000 +0200 @@ -1594,8 +1594,12 @@ if (tpl->tpl[NF9_IN_VLAN].len && *(pptrs->f_data+tpl->tpl[NF9_IN_VLAN].off) > 0) ret += NF9_FTYPE_VLAN; if (tpl->tpl[NF9_MPLS_LABEL_1].len /* check: value > 0 ? */) ret += NF9_FTYPE_MPLS; - if (*(pptrs->f_data+tpl->tpl[NF9_IP_PROTOCOL_VERSION].off) == 4 || tpl->tpl[NF9_IPV4_SRC_ADDR].len > 0); - else if (*(pptrs->f_data+tpl->tpl[NF9_IP_PROTOCOL_VERSION].off) == 6 || tpl->tpl[NF9_IPV6_SRC_ADDR].len > 0) ret += NF9_FTYPE_IPV6; + + /* Explicit IP protocol definition first; a bit of heuristics as fallback */ + if (*(pptrs->f_data+tpl->tpl[NF9_IP_PROTOCOL_VERSION].off) == 4); + else if (*(pptrs->f_data+tpl->tpl[NF9_IP_PROTOCOL_VERSION].off) == 6) ret += NF9_FTYPE_IPV6; + else if (tpl->tpl[NF9_IPV4_SRC_ADDR].len > 0); + else if (tpl->tpl[NF9_IPV6_SRC_ADDR].len > 0) ret += NF9_FTYPE_IPV6; return ret; }