[quagga-dev 8892] Re: LSA checksum error - diff

Paul Jakma paul at jakma.org
Thu Oct 6 12:25:10 BST 2011


On Mon, 3 Oct 2011, Jaroslav Fojtik wrote:

> here is it. If you like it, I can improve it a little bit.

>  	{
> ! 	struct timeval clock;
> !
> !         gettimeofday(&clock, NULL);
> ! 	LSA_CHECKSUM_ERR_COUNT++;
> !
> ! 	if(LSA_CHECKSUM_ERR_COUNT==1)
> ! 	  {
> ! 	  zlog_warn("Link State Update: LSA checksum error %x, %x.",
>  		     sum, lsah->checksum);
> +   	  LSA_CHECKSUM_ERR_SEC = clock.tv_sec;
> + 	  }
> + 	else
> + 	  {
> + 	    if(labs(clock.tv_sec-LSA_CHECKSUM_ERR_SEC)>60)

It'd probably be better to add rate-limiting support generally to the 
logging code, along with a log message to say "your daemon is hammering at 
the logging sub-system at the moment".

Or, as Denis pointed out on the bugzilla comment, you can use syslog and 
the existing support in syslog daemons for this.

regards,
-- 
Paul Jakma  paul at jakma.org  twitter: @pjakma  PGP: 64A2FF6A
Fortune:
If you lose your temper at a newspaper columnist, he'll get rich,
or famous or both.



More information about the Quagga-dev mailing list