bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #6851] fix a bug in BPF


From: Zheng Da
Subject: [patch #6851] fix a bug in BPF
Date: Wed, 29 Jul 2009 08:15:11 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.12) Gecko/2009070609 Firefox/3.0.12

Follow-up Comment #2, patch #6851 (project hurd):

The packet delivered from gnumach should have the packet header. NPF returns
the packet_header and pfinet always assumes that the packet from gnumach has
the packet_header.

For your first question, the return value of net_do_filter is boolean, i.e.,
it can only be passed or not passed, but bpf_do_filter returns the size of the
data that passes the filter.

bpf_do_filter(infp, net_kmsg(kmsg)->packet + sizeof(struct packet_header),
count, net_kmsg(kmsg)->header, ifp->if_header_size, &hash_headp, &entp) is
simply wrong because the length of the packet data passed to bpf_do_filter
isn't 'count' any more.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?6851>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]