From owner-cvs-all@FreeBSD.ORG Thu Jan 12 19:14:40 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D053216A41F; Thu, 12 Jan 2006 19:14:40 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C83043D46; Thu, 12 Jan 2006 19:14:40 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0CJEeSX031209; Thu, 12 Jan 2006 19:14:40 GMT (envelope-from glebius@repoman.freebsd.org) Received: (from glebius@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0CJEeEJ031208; Thu, 12 Jan 2006 19:14:40 GMT (envelope-from glebius) Message-Id: <200601121914.k0CJEeEJ031208@repoman.freebsd.org> From: Gleb Smirnoff Date: Thu, 12 Jan 2006 19:14:40 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libnetgraph msg.c src/sys/netgraph ng_message.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2006 19:14:41 -0000 glebius 2006-01-12 19:14:40 UTC FreeBSD src repository Modified files: lib/libnetgraph msg.c sys/netgraph ng_message.h Log: In the splnet(9) times netgraph(4) was synchronous and if a message had been replied, the reply was always delivered to the originator synchronously. With introduction of netgraph item callbacks and a wait channel with mutex in ng_socket(4), we have fixed the problem with ngctl(8) returning earlier than the command has been proceeded by target node. But still ngctl(8) can return prior to the reply has arrived to its node. To fix this: - Introduce a new flag for netgraph(4) messages - NGM_HASREPLY. This flag is or'ed with message like NGM_READONLY. - In netgraph userland library if we have sent a message with NGM_HASREPLY flag, then select(2) until reply comes. - Mark appropriate generic commands with NGM_HASREPLY flag, gathering them into one enum {}. Bump generic cookie. Revision Changes Path 1.12 +16 -0 src/lib/libnetgraph/msg.c 1.28 +31 -17 src/sys/netgraph/ng_message.h