Date: Thu, 14 Dec 2006 08:21:36 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111679 for review Message-ID: <200612140821.kBE8LarY014914@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612140821.kBE8LarY014914>