@@ -10,7 +10,7 @@
#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-19 21:16:30.209187216 +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
@@ -22,17 +22,26 @@
{ 1, 1, 8 }, // 61 - NF9_DIRECTION
-@@ -576,11 +576,11 @@
+@@ -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 ) {
-+ 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);
+- // 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 ) {
-+ } else if ( input_template[NF9_IPV6_SRC_ADDR].length == 16 && input_template[NF9_IP_PROTOCOL_VERSION].offset == 6 ) {
++ 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);
|