From owner-p4-projects@FreeBSD.ORG Thu Dec 14 08:21:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EC06916A40F; Thu, 14 Dec 2006 08:21:36 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2E2316A403 for ; Thu, 14 Dec 2006 08:21:36 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C32843CAF for ; Thu, 14 Dec 2006 08:20:02 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBE8La9q014917 for ; Thu, 14 Dec 2006 08:21:36 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBE8LarY014914 for perforce@freebsd.org; Thu, 14 Dec 2006 08:21:36 GMT (envelope-from piso@freebsd.org) Date: Thu, 14 Dec 2006 08:21:36 GMT Message-Id: <200612140821.kBE8LarY014914@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 111679 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2006 08:21:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=111679 Change 111679 by piso@piso_newluxor on 2006/12/14 08:21:29 LibAliasOutTry() is a public function, so wrap it around LibAliasTryLocked(). Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#28 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#28 (text+ko) ==== @@ -1214,7 +1214,7 @@ /* Local prototypes */ static int LibAliasOutLocked(struct libalias *la, char *ptr, - int maxpacketsize); + int maxpacketsize, int create); static int LibAliasInLocked(struct libalias *la, char *ptr, int maxpacketsize); @@ -1239,7 +1239,7 @@ if (la->packetAliasMode & PKT_ALIAS_REVERSE) { la->packetAliasMode &= ~PKT_ALIAS_REVERSE; - iresult = LibAliasOutLocked(la, ptr, maxpacketsize); + iresult = LibAliasOutLocked(la, ptr, maxpacketsize, 1); la->packetAliasMode |= PKT_ALIAS_REVERSE; goto getout; } @@ -1333,23 +1333,33 @@ int res; LIBALIAS_LOCK(la); - res = LibAliasOutLocked(la, ptr, maxpacketsize); + res = LibAliasOutLocked(la, ptr, maxpacketsize, 1); + LIBALIAS_UNLOCK(la); + return (res); +} + +int +LibAliasOutTry(struct libalias *la, char *ptr, int maxpacketsize, int create) +{ + int res; + + LIBALIAS_LOCK(la); + res = LibAliasOutLocked(la, ptr, maxpacketsize, create); LIBALIAS_UNLOCK(la); return (res); } static int LibAliasOutLocked(struct libalias *la, char *ptr, /* valid IP packet */ - int maxpacketsize /* How much the packet data may grow (FTP + int maxpacketsize, /* How much the packet data may grow (FTP * and IRC inline changes) */ + int create /* Create new entries ? */ ) { int iresult; - int create; /* Create new entries ? */ struct in_addr addr_save; struct ip *pip; - create = 1; if (la->packetAliasMode & PKT_ALIAS_REVERSE) { la->packetAliasMode &= ~PKT_ALIAS_REVERSE; iresult = LibAliasInLocked(la, ptr, maxpacketsize);