From patchwork Tue Sep 5 01:03:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishwanath Pai X-Patchwork-Id: 809881 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=akamai.com header.i=@akamai.com header.b="UDlW0yda"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xmT4c0fHqz9s3T for ; Tue, 5 Sep 2017 11:04:00 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbdIEBD5 (ORCPT ); Mon, 4 Sep 2017 21:03:57 -0400 Received: from mx0a-00190b01.pphosted.com ([67.231.149.131]:50724 "EHLO mx0a-00190b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbdIEBDy (ORCPT ); Mon, 4 Sep 2017 21:03:54 -0400 Received: from pps.filterd (m0122333.ppops.net [127.0.0.1]) by mx0a-00190b01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v85131jI025935; Tue, 5 Sep 2017 02:03:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id; s=jan2016.eng; bh=l9K87dhWHpAB+XBNZFodOo2WGR1RmSrez/hpI8qxVLE=; b=UDlW0ydabtIpxPVzVdmKbdqXfabureN20OkSW/3nq6xigf40EkhYnL3umEDVdqNlTugp kHyDCyXp0eD/T0Rds+aI7IBl9dLgiuU+iS0Hl+Ab/bz+oi09m6HThgvjABTsSHDv067F i8zsx3slTavFzawDVcuwc0GzAhZd1MhuGc8R/K3vAn5gneZwnisgFzDAI+cSx/R56OOn HoubiQPPN5c8yZLXgtxLqSHWcZLFZt/8yGZW9Qsu2OixN95ftf084ptivWuujOn9a9FR abs4S7K5Z5C/erSv41ozZ1dTC94fCaR5PTwHCwN8EKxBAALoD5+0HJrUCzhkOPghh3z6 6A== Received: from prod-mail-ppoint3 ([96.6.114.86]) by mx0a-00190b01.pphosted.com with ESMTP id 2cqkw4ndpg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Sep 2017 02:03:29 +0100 Received: from pps.filterd (prod-mail-ppoint3.akamai.com [127.0.0.1]) by prod-mail-ppoint3.akamai.com (8.16.0.17/8.16.0.17) with SMTP id v8510qlf003358; Mon, 4 Sep 2017 21:03:28 -0400 Received: from prod-mail-relay14.akamai.com ([172.27.17.39]) by prod-mail-ppoint3.akamai.com with ESMTP id 2cqqyv9j54-1; Mon, 04 Sep 2017 21:03:28 -0400 Received: from bos-lpqrs.kendall.corp.akamai.com (bos-lpqrs.kendall.corp.akamai.com [172.28.13.81]) by prod-mail-relay14.akamai.com (Postfix) with ESMTP id 1FF3080059; Mon, 4 Sep 2017 19:03:28 -0600 (MDT) Received: from vpai by bos-lpqrs.kendall.corp.akamai.com with local (Exim 4.82) (envelope-from ) id 1dp2H1-0006qe-LD; Mon, 04 Sep 2017 21:03:27 -0400 From: Vishwanath Pai To: pablo@netfilter.org, kadlec@blackhole.kfki.hu, netfilter-devel@vger.kernel.org Cc: johunt@akamai.com, fw@strlen.de, netdev@vger.kernel.org, pai.vishwain@gmail.com Subject: [PATCH] netfilter: xt_hashlimit: fix 64 bit division compile error Date: Mon, 4 Sep 2017 21:03:27 -0400 Message-Id: <1504573407-26293-1-git-send-email-vpai@akamai.com> X-Mailer: git-send-email 1.9.1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-04_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709050014 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-04_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709050015 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org commit bea74641e378 ("netfilter: xt_hashlimit: add rate match mode") introduced a line where we divide two 64bit unsigned integers. This breaks on ARM processors with the error: ERROR: "__aeabi_uldivmod" [net/netfilter/xt_hashlimit.ko] undefined! We can fix it by using div64_u64 instead. Fixes: bea74641e378 ("netfilter: xt_hashlimit: add rate match mode") Signed-off-by: Vishwanath Pai --- net/netfilter/xt_hashlimit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 10d4823..fece7c2 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -531,7 +531,7 @@ static u64 user2rate_bytes(u64 user) { u64 r; - r = user ? 0xFFFFFFFFULL / user : 0xFFFFFFFFULL; + r = user ? div64_u64(0xFFFFFFFFULL, user) : 0xFFFFFFFFULL; r = (r - 1) << 4; return r; }