From patchwork Tue Jun 3 10:05:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken-ichirou MATSUZAWA X-Patchwork-Id: 355288 X-Patchwork-Delegate: regit@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0DA1A1400A6 for ; Tue, 3 Jun 2014 20:05:45 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbaFCKFn (ORCPT ); Tue, 3 Jun 2014 06:05:43 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:55123 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbaFCKFm (ORCPT ); Tue, 3 Jun 2014 06:05:42 -0400 Received: by mail-pd0-f174.google.com with SMTP id r10so4477623pdi.19 for ; Tue, 03 Jun 2014 03:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1hGfNbJeKe3sPAMZ2sI81YPUcvSatrCYJjJioivQgZY=; b=IIN9O9UC7MB/2KM4mZK8N9kdQc5Hf+mc2Kxla/1beNaP5wP5cm0yHnHmwfgkoqE1I6 zT3iVr78lt/lkuR4yFE3a+4RQUut0xJi0kFoUAFMbxyu7LaraiIsroT+3dP4BII+sdUf Uqjycgp/f4du6wkVuqY2U4PUc7n/+TQpa9pO4mXiffdl1jvm/XrVNGc51ee8wv5Xwrg9 kGEsXzq6xRV+CC3A04tiQMnXICzCT9Uxes+AanUsUyxJmf/huajKQyaAGxTKOAl923nn nJc1mTB6+g7BrNkNSDfEZlI1h9f/LQsebf7g8jJGHtlbqq0DrP9n13ZTiKqL+LQUlto5 i5qg== X-Received: by 10.68.125.164 with SMTP id mr4mr48214150pbb.27.1401789942513; Tue, 03 Jun 2014 03:05:42 -0700 (PDT) Received: from gmail.com (softbank220009032006.bbtec.net. [220.9.32.6]) by mx.google.com with ESMTPSA id mt1sm26029235pbb.31.2014.06.03.03.05.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Jun 2014 03:05:41 -0700 (PDT) Date: Tue, 3 Jun 2014 19:05:36 +0900 From: Ken-ichirou MATSUZAWA To: The netfilter developer mailinglist Cc: Eric Leblond Subject: [PATCH v3 ulogd 02/12] ipfix: fix enterprise bit handling Message-ID: <20140603100536.GC24668@gmail.com> References: <20140603100130.GA24668@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140603100130.GA24668@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org If this bit is zero, the Information Element identifier identifies an Information Element in IANA-IPFIX, and the four-octet Enterprise Number field MUST NOT be present. Signed-off-by Ken-ichirou MATSUZAWA --- output/ulogd_output_IPFIX.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/ulogd_output_IPFIX.c b/output/ulogd_output_IPFIX.c index 01ac9a0..333d532 100644 --- a/output/ulogd_output_IPFIX.c +++ b/output/ulogd_output_IPFIX.c @@ -182,15 +182,15 @@ build_template_for_bitmask(struct ulogd_pluginstance *upi, struct ipfix_ietf_field *field = (struct ipfix_ietf_field *) tmpl->tmpl_cur; - field->type = htons(key->ipfix.field_id | 0x8000000); + field->type = htons(key->ipfix.field_id); field->length = htons(length); tmpl->tmpl_cur += sizeof(*field); } else { struct ipfix_vendor_field *field = (struct ipfix_vendor_field *) tmpl->tmpl_cur; + field->type = htons(key->ipfix.field_id | 0x8000); field->enterprise_num = htonl(key->ipfix.vendor); - field->type = htons(key->ipfix.field_id); field->length = htons(length); tmpl->tmpl_cur += sizeof(*field); }