Skip to content

Commit

Permalink
inc: fix unknown protocol srcip->src and dstip->dst foo
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Apr 5, 2015
1 parent c37d77b commit 81abe4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/etc/inc/filter_log.inc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ function parse_filter_line($line)
}

list($all, $flent['time'], $host, $rule) = $log_split;

$rule_data = explode(',', $rule);
$field = 0;

Expand Down Expand Up @@ -192,7 +191,7 @@ function parse_filter_line($line)
$flent['urg'] = $rule_data[$field++];
$flent['options'] = explode(";",$rule_data[$field++]);
}
} else if ($flent['protoid'] == '1') { // ICMP
} elseif ($flent['protoid'] == '1') { // ICMP
$flent['src'] = $flent['srcip'];
$flent['dst'] = $flent['dstip'];

Expand Down Expand Up @@ -239,13 +238,16 @@ function parse_filter_line($line)
$flent['icmp_descr'] = $rule_data[$field++];
break;
}
} else if ($flent['protoid'] == '112') { // CARP
} elseif ($flent['protoid'] == '112') { // CARP
$flent['type'] = $rule_data[$field++];
$flent['ttl'] = $rule_data[$field++];
$flent['vhid'] = $rule_data[$field++];
$flent['version'] = $rule_data[$field++];
$flent['advskew'] = $rule_data[$field++];
$flent['advbase'] = $rule_data[$field++];
} else { // e.g. IGMP, simply write src/dst as we are IP
$flent['src'] = $flent['srcip'];
$flent['dst'] = $flent['dstip'];
}

/* If there isn't a src, a dst, or a time, then the line is unusable/bad */
Expand Down

0 comments on commit 81abe4d

Please sign in to comment.