From patchwork Mon Feb 22 18:09:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 8381491 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 115D49F1D4 for ; Mon, 22 Feb 2016 18:09:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5091020511 for ; Mon, 22 Feb 2016 18:09:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CE6C2040F for ; Mon, 22 Feb 2016 18:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbcBVSJO (ORCPT ); Mon, 22 Feb 2016 13:09:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55954 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbcBVSJN (ORCPT ); Mon, 22 Feb 2016 13:09:13 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 0B77B7EBA4 for ; Mon, 22 Feb 2016 18:09:13 +0000 (UTC) Received: from steved.boston.devel.redhat.com (steved.boston.devel.redhat.com [10.19.60.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MI9CIP017897 for ; Mon, 22 Feb 2016 13:09:12 -0500 From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] nfsd: use correct byte order on rdma port. Date: Mon, 22 Feb 2016 13:09:10 -0500 Message-Id: <1456164550-6369-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The returned port from getservbyname() is in network order. Convert the port to host order before writing it to the portlist file. Reported-by: Chuck Lever Signed-off-by: Steve Dickson Reviewed-by: Chuck Lever --- utils/nfsd/nfssvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c index e8efd06..dcb430a 100644 --- a/utils/nfsd/nfssvc.c +++ b/utils/nfsd/nfssvc.c @@ -282,7 +282,7 @@ nfssvc_set_rdmaport(const char *port) int fd; if (sv) - nport = sv->s_port; + nport = ntohs(sv->s_port); else { char *ep; nport = strtol(port, &ep, 10);