From 8ef1565d2bc37d6edfbaa30ad173ca177f5abae2 Mon Sep 17 00:00:00 2001 From: Maxim Konovalov Date: Wed, 13 Nov 2002 11:31:44 +0000 Subject: Due to a memory alignment sizeof(struct ipfw_flow_id) is bigger than ipfw_flow_id structure actual size and bcmp(3) may fail to compare them properly. Compare members of these structures instead. PR: kern/44078 Submitted by: Oleg Bulyzhin Reviewed by: luigi MFC after: 2 weeks --- sys/netinet/ip_dummynet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 0d3baa65bc944..16ad64b2e78b4 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -879,7 +879,12 @@ find_queue(struct dn_flow_set *fs, struct ipfw_flow_id *id) searches++ ; for (prev=NULL, q = fs->rq[i] ; q ; ) { search_steps++; - if (bcmp(id, &(q->id), sizeof(q->id) ) == 0) + if (id->dst_ip == q->id.dst_ip && + id->src_ip == q->id.src_ip && + id->dst_port == q->id.dst_port && + id->src_port == q->id.src_port && + id->proto == q->id.proto && + id->flags == q->id.flags) break ; /* found */ else if (pipe_expire && q->head == NULL && q->S == q->F+1 ) { /* entry is idle and not in any heap, expire it */ -- cgit v1.3