Check-in [49947c3157]
Overview
SHA1:49947c31579dcc17adc77c62276b90ed9d2b1c1f
Date: 2011-03-06 23:30:26
User: rmiller
Comment:remove pbl_set_verdict. It was a waste of code lines.
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2012-01-09
23:12
[d639e0a548] Patch per Matthias Bernhardt. (user: rmiller, tags: trunk)
2011-03-06
23:30
[49947c3157] remove pbl_set_verdict. It was a waste of code lines. (user: rmiller, tags: trunk)
23:20
[371d474ebc] some bugs related to use_cache, etc. also a lot of cleanup. (user: rmiller, tags: trunk)
Changes

Modified packetbl.c from [ac69747424] to [194fb5b236].

   267    267   	}
   268    268   
   269    269   	ret = nfq_get_payload(nfa, &nfdata);
   270    270   	/* what return codes here? */
   271    271   
   272    272   	ret = get_packet_info(nfdata, &ip);	
   273    273   	if (ret == -1) {
   274         -		pbl_set_verdict(qh, id, NF_ACCEPT);
          274  +		SET_VERDICT(qh, id, NF_ACCEPT, 0, NULL);
   275    275   		return;
   276    276   	}
   277    277   
   278    278   	ret = packet_check_ip(ip);
   279    279   	
   280    280   	if (conf.debug >= 2) {
   281    281   	printf ("Got packet from %hhu.%hhu.%hhu.%hhu: %d\n", ip.b1, ip.b2, ip.b3, ip.b4, ret);
   282    282   	}
   283         -	pbl_set_verdict(qh, id, ret);
   284         -}
   285         -/*
   286         - * SYNOPSIS:
   287         - *   static void pbl_set_verdict(
   288         - *                               const struct PBL_HANDLE *h,
   289         - *                               ipq_id_t id,
   290         - *                               unsigned int verdict
   291         - *                              );
   292         - *
   293         - * ARGUMENTS:
   294         - *   struct PBL_HANDLE *h         IP Queue handle, must not be NULL
   295         - *   ipq_id_t id                  XXX: Id ???
   296         - *   unsigned int verdict         Verdict to assign this packet in the queue.
   297         - *
   298         - * RETURN VALUE:
   299         - *   (none)
   300         - *
   301         - * NOTES:
   302         - *   This function calls ipq_set_verdict() to the appropriate "verdict"
   303         - *   It must be able to handle the condition where "conf.dryrun" is set
   304         - *   causing all "verdict" values to be treated as NF_ACCEPT regardless
   305         - *   of their actual value.
   306         - *
   307         - */
   308         -static void pbl_set_verdict(struct PBL_HANDLE *h, PBL_ID_T id,
   309         -	unsigned int verdict) {
   310         -
   311         -	if (conf.dryrun == 1) {
   312         -		SET_VERDICT(h, id, NF_ACCEPT, 0, NULL);
   313         -	} else {
   314         -		SET_VERDICT(h, id, verdict, 0, NULL);
   315         -	}
          283  +	SET_VERDICT(qh, id, conf.dryrun ? NF_ACCEPT : ret, 0, NULL);
   316    284   }
   317    285   
   318    286   /*
   319    287    * SYNOPSIS:
   320    288    *   int main(
   321    289    *            int argc,
   322    290    *            char **argv