1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-19 03:52:17 +00:00
freebsd-ports/net-mgmt/trafd/files/patch-ah
2006-12-13 23:02:52 +00:00

56 lines
1.6 KiB
Plaintext

--- trafd/traffic.c.orig Thu Nov 25 11:31:15 1999
+++ trafd/traffic.c Wed Dec 13 22:59:42 2006
@@ -29,6 +29,7 @@
/* traffic.c - collect network traffic */
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -69,7 +70,7 @@
static int dlen;
typedef struct t_entry *p_entry;
static struct t_entry t;
-static struct timeval begin_time;
+struct timeval begin_time;
static u_char s_port_big[IPPORT_RESERVED];
/*
@@ -214,7 +215,7 @@
t.p_port = tp->th_sport, t.who_srv = 1;
else if (tp->th_sport > tp->th_dport)
t.p_port = tp->th_dport, t.who_srv = 2;
- else if (tp->th_sport = tp->th_dport)
+ else if (tp->th_sport == tp->th_dport)
t.p_port = tp->th_sport, t.who_srv = 3;
if (t.p_port > IPPORT_RESERVED) {
if (s_port_big[tp->th_sport & (IPPORT_RESERVED-1)] & IPPROTO_TCP) {
@@ -224,7 +225,7 @@
t.p_port = tp->th_dport;
t.who_srv = 2;
}
- if (tp->th_sport = tp->th_dport) t.who_srv = 3;
+ if (tp->th_sport == tp->th_dport) t.who_srv = 3;
}
traf_add(insertentry(&t), t.n_bytes, t.n_psize);
@@ -261,7 +262,7 @@
t.p_port = up->uh_sport, t.who_srv = 1;
else if (up->uh_sport > up->uh_dport)
t.p_port = up->uh_dport, t.who_srv = 2;
- else if (up->uh_sport = up->uh_dport)
+ else if (up->uh_sport == up->uh_dport)
t.p_port = up->uh_sport, t.who_srv = 3;
if (t.p_port > IPPORT_RESERVED) {
if (s_port_big[up->uh_sport & (IPPORT_RESERVED-1)] & IPPROTO_UDP) {
@@ -271,7 +272,7 @@
t.p_port = up->uh_dport;
t.who_srv = 2;
}
- if (up->uh_sport = up->uh_dport) t.who_srv = 3;
+ if (up->uh_sport == up->uh_dport) t.who_srv = 3;
}
traf_add(insertentry(&t), t.n_bytes, t.n_psize);