From owner-freebsd-net@FreeBSD.ORG Tue Feb 1 06:25:37 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D352C106566B for ; Tue, 1 Feb 2011 06:25:37 +0000 (UTC) (envelope-from lijimlee@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 66A628FC0C for ; Tue, 1 Feb 2011 06:25:36 +0000 (UTC) Received: by eyf6 with SMTP id 6so3084619eyf.13 for ; Mon, 31 Jan 2011 22:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=vaI/+LOAd9CipPy4AFDpyJXc/1sZTuuvR0BePGQ7fS0=; b=ock+V+z0duvRxePEnKgpa2B/nvbWM2Gib+GES18p85yggzLjkU1VulglodhJpymszf JoRgorVgqOSVAS4XrECCb4OsO+5/je5GrwgAiJYl+6KLxUnv2qZH51ncjVW6+tozWY3u DiyOLMbC74DdGpPajgdSQAsNX7V255hXIPSEg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=JGVe7GA/RW2yC7GFngIfLiftdVKqNruAT0fwgUULP/tCIoAKAj+lQpx0hiC6DRoHt6 wJYgcBeC2e7ijt+GOJNRWi2WfMuLhPX0udIVyL22NtJjIV/ymOrMpI9AnCD+aw5OrKGE 9nzpNAtNXqt/fzQSDlh4uI7PT7ZWMxOYPiehA= MIME-Version: 1.0 Received: by 10.14.127.137 with SMTP id d9mr915267eei.2.1296539673188; Mon, 31 Jan 2011 21:54:33 -0800 (PST) Sender: lijimlee@gmail.com Received: by 10.14.53.72 with HTTP; Mon, 31 Jan 2011 21:54:33 -0800 (PST) Date: Mon, 31 Jan 2011 21:54:33 -0800 X-Google-Sender-Auth: CNwyy3Wi34Vs4RI2l67iCcBacjA Message-ID: From: Jim To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: why use INP_WLOCK instead of INP_RLOCK X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 06:25:37 -0000 Hi All, I am not sure if anybody has asked it before. I could not find answer by doing rough search on Internet, if it is duplicate question, sorry in advance. My question is that, for getting socket options in tcp_ctloutput() in tcp_usrreq.c, why do we need to do lock with INP_WLOCK(inp) as setting socket options does. Why do we just use INP_RLOCK(inp), as it looks not changing anything in tcp control block? Thank you for your kindly answer. Jim