diff options
author | maxim <maxim@FreeBSD.org> | 2002-11-13 11:31:44 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2002-11-13 11:31:44 +0000 |
commit | 809d2262282c5a95d5a161debae28e4c277989fb (patch) | |
tree | 55139548c5b707835a3e834665ec44f34bd71deb /sys/netinet | |
parent | 69fdcfb8834201dcf4edf10fd2aef462662415e0 (diff) | |
download | FreeBSD-src-809d2262282c5a95d5a161debae28e4c277989fb.zip FreeBSD-src-809d2262282c5a95d5a161debae28e4c277989fb.tar.gz |
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 <oleg@rinet.ru>
Reviewed by: luigi
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_dummynet.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 0d3baa6..16ad64b 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 */ |