Message ID | 1448447566-14435-1-git-send-email-wenyuz@vmware.com |
---|---|
State | Changes Requested |
Headers | show |
On Wed, Nov 25, 2015 at 02:32:46AM -0800, Wenyu Zhang wrote: > This patch is to skip BFD control packets in ipfix. > BFD control packet should be tunnel packet with 0 tunnel id, > and the inner packet is UDP packet with destination port 3784. > > Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> I can't see how this could work correctly, since there's a missing htons() on BFD_CONTROL_DEST_PORT, as reported by "sparse": ../ofproto/ofproto-dpif-ipfix.c:1721:13: warning: restricted ovs_be16 degrades to integer I don't see any rationale anywhere.
Thanks for your comments. I will correct it. On 11/30/15, 4:05 AM, "Ben Pfaff" <blp@ovn.org> wrote: >On Wed, Nov 25, 2015 at 02:32:46AM -0800, Wenyu Zhang wrote: >> This patch is to skip BFD control packets in ipfix. >> BFD control packet should be tunnel packet with 0 tunnel id, >> and the inner packet is UDP packet with destination port 3784. >> >> Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> > >I can't see how this could work correctly, since there's a missing >htons() on BFD_CONTROL_DEST_PORT, as reported by "sparse": > > ../ofproto/ofproto-dpif-ipfix.c:1721:13: warning: restricted ovs_be16 >degrades to integer > >I don't see any rationale anywhere.
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c index 9ad8fa2..fc9676d 100644 --- a/ofproto/ofproto-dpif-ipfix.c +++ b/ofproto/ofproto-dpif-ipfix.c @@ -43,6 +43,9 @@ static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER; /* Cf. IETF RFC 5101 Section 10.3.4. */ #define IPFIX_DEFAULT_COLLECTOR_PORT 4739 +/* Cf. IETF RFC 5881 Setion 8. */ +#define BFD_CONTROL_DEST_PORT 3784 + /* The standard layer2SegmentId (ID 351) element is included in vDS to send * the VxLAN tunnel's VNI. It is 64-bit long, the most significant byte is * used to indicate the type of tunnel (0x01 = VxLAN, 0x02 = GRE) and the three @@ -1711,6 +1714,15 @@ dpif_ipfix_bridge_sample(struct dpif_ipfix *di, const struct dp_packet *packet, tunnel_port = dpif_ipfix_find_port(di, output_odp_port); } } + + /* Skip BFD control packets */ + if (tunnel_key && tunnel_key->tun_id == 0 && + flow->nw_proto == IPPROTO_UDP && + flow->tp_dst == BFD_CONTROL_DEST_PORT) { + ovs_mutex_unlock(&mutex); + return; + } + dpif_ipfix_sample(&di->bridge_exporter.exporter, packet, flow, packet_delta_count, di->bridge_exporter.options->obs_domain_id,
This patch is to skip BFD control packets in ipfix. BFD control packet should be tunnel packet with 0 tunnel id, and the inner packet is UDP packet with destination port 3784. Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> --- ofproto/ofproto-dpif-ipfix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)