From patchwork Thu Mar 20 04:54:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 331992 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F19A22C0099 for ; Thu, 20 Mar 2014 16:20:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbaCTFUT (ORCPT ); Thu, 20 Mar 2014 01:20:19 -0400 Received: from mx0b-000f0801.pphosted.com ([67.231.152.113]:35462 "EHLO mx0b-000f0801.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750963AbaCTFUR (ORCPT ); Thu, 20 Mar 2014 01:20:17 -0400 X-Greylist: delayed 1544 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Mar 2014 01:20:17 EDT Received: from pps.filterd (m0048192 [127.0.0.1]) by mx0b-000f0801.pphosted.com (8.14.5/8.14.5) with SMTP id s2K4S7oQ021936; Wed, 19 Mar 2014 21:54:28 -0700 Received: from hq1wp-exchub02.corp.brocade.com ([144.49.131.13]) by mx0b-000f0801.pphosted.com with ESMTP id 1jpesh9sbp-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 19 Mar 2014 21:54:27 -0700 Received: from HQ1WP-EXHUB01.corp.brocade.com (10.70.36.14) by hq1wp-exchub02.corp.brocade.com (10.70.38.99) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 19 Mar 2014 21:54:26 -0700 Received: from nehalam.linuxnetplumber.net (172.16.180.50) by imap.brocade.com (10.70.36.22) with Microsoft SMTP Server (TLS) id 8.3.298.1; Wed, 19 Mar 2014 21:54:24 -0700 Date: Wed, 19 Mar 2014 21:54:20 -0700 From: Stephen Hemminger To: David Miller , Patrick McHardy CC: Subject: [PATCH net] netlink: fix setsockopt in mmap examples in documentation Message-ID: <20140319215420.49a6408d@nehalam.linuxnetplumber.net> Organization: Brocade X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2014-03-20_01:2014-03-19, 2014-03-20, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1403190184 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The documentation for how to use netlink mmap interface is incorrect. The calls to setsockopt() require an additional argument. Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/Documentation/networking/netlink_mmap.txt 2013-11-21 17:22:02.719654412 -0800 +++ b/Documentation/networking/netlink_mmap.txt 2014-03-19 21:13:51.994890229 -0700 @@ -226,9 +226,9 @@ Ring setup: void *rx_ring, *tx_ring; /* Configure ring parameters */ - if (setsockopt(fd, NETLINK_RX_RING, &req, sizeof(req)) < 0) + if (setsockopt(fd, SOL_NETLINK, NETLINK_RX_RING, &req, sizeof(req)) < 0) exit(1); - if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0) + if (setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, &req, sizeof(req)) < 0) exit(1) /* Calculate size of each individual ring */