Lines 1-5
Link Here
|
1 |
--- src/process_packet.c.orig 2012-04-11 12:08:57.000000000 -0500 |
1 |
--- src/process_packet.c.orig 2005-09-18 10:29:54.000000000 -0400 |
2 |
+++ src/process_packet.c 2012-04-11 12:05:26.000000000 -0500 |
2 |
+++ src/process_packet.c 2013-08-16 14:36:28.000000000 -0400 |
3 |
@@ -43,10 +43,10 @@ |
3 |
@@ -43,10 +43,10 @@ |
4 |
#include <net/if_pflog.h> |
4 |
#include <net/if_pflog.h> |
5 |
#include <net/pfvar.h> |
5 |
#include <net/pfvar.h> |
Lines 12-14
Link Here
|
12 |
#include <errno.h> |
12 |
#include <errno.h> |
13 |
|
13 |
|
14 |
#include <libprelude/prelude.h> |
14 |
#include <libprelude/prelude.h> |
|
|
15 |
@@ -494,12 +494,12 @@ |
16 |
char *dir_str, |
17 |
char *buffer, size_t size) |
18 |
{ |
19 |
- struct { char *name; int n; } ip_proto_table[] = CTL_IPPROTO_NAMES; |
20 |
+ struct protoent *proto; |
21 |
char *proto_name = "unknown"; |
22 |
|
23 |
- if ( packet_info->ip_proto_type < sizeof (ip_proto_table) / sizeof (ip_proto_table[0]) && |
24 |
- ip_proto_table[packet_info->ip_proto_type].name ) |
25 |
- proto_name = ip_proto_table[packet_info->ip_proto_type].name; |
26 |
+ proto = getprotobynumber(packet_info->ip_proto_type); |
27 |
+ if (proto != NULL) |
28 |
+ proto_name = proto->p_name; |
29 |
|
30 |
return snprintf(buffer, size, |
31 |
"OpenBSD PF %s an %s %s packet %s -> %s on interface %s (TTL:%hhu)", |