Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
:
netflow
>
nfdump
> nfdump-1.6.1-IP_PROTOCOL_VERSION.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nfdump-1.6.1-IP_PROTOCOL_VERSION.patch of Package nfdump (Revision 13)
Currently displaying revision
13
,
show latest
--- ./bin/netflow_v9.h.orig 2010-08-19 16:43:15.351390974 +0200 +++ ./bin/netflow_v9.h 2010-08-19 16:44:22.971142931 +0200 @@ -209,6 +209,8 @@ #define NF9_SRC_VLAN 58 #define NF9_DST_VLAN 59 +#define NF9_IP_PROTOCOL_VERSION 60 + #define NF9_DIRECTION 61 #define NF9_V6_NEXT_HOP 62 #define NF9_BPG_V6_NEXT_HOP 63 --- ./bin/netflow_v9.c.orig 2010-08-19 16:43:19.503387884 +0200 +++ ./bin/netflow_v9.c 2010-08-20 14:43:12.743483886 +0200 @@ -213,8 +213,8 @@ { 2, 2, 13}, // 58 - NF9_SRC_VLAN { 2, 2, 13}, // 59 - NF9_DST_VLAN - // 60 not implemented - { 0, 0, 0}, + // 60 ip protocol version + { 1, 1, 0}, { 1, 1, 8 }, // 61 - NF9_DIRECTION @@ -576,17 +576,17 @@ * This record is expected in the output stream. If not available * in the template, assume empty v4 address. */ - if ( input_template[NF9_IPV4_SRC_ADDR].length ) { - // IPv4 addresses - FillElement( table, NF9_IPV4_SRC_ADDR, &offset); - FillElement( table, NF9_IPV4_DST_ADDR, &offset); - } else if ( input_template[NF9_IPV6_SRC_ADDR].length == 16 ) { + if ( input_template[NF9_IPV6_SRC_ADDR].length == 16 && input_template[NF9_IP_PROTOCOL_VERSION].offset == 6 ) { // IPv6 addresses FillElement( table, NF9_IPV6_SRC_ADDR, &offset); FillElement( table, NF9_IPV6_DST_ADDR, &offset); // mark IPv6 table->flags |= FLAG_IPV6_ADDR; ipv6 = 1; + } else if ( input_template[NF9_IPV4_SRC_ADDR].length && input_template[NF9_IP_PROTOCOL_VERSION].offset == 4 ) { + // IPv4 addresses + FillElement( table, NF9_IPV4_SRC_ADDR, &offset); + FillElement( table, NF9_IPV4_DST_ADDR, &offset); } else { // should not happen, assume empty IPv4 addresses FillElement( table, NF9_IPV4_SRC_ADDR, &offset);