C.11. Receiving a VRRP Advertisement

 /********************************************************* NAME : vrrp_read *********************************************************/ static int vrrp_read( vrrp_rt *vsrv, char *buf, int buflen ) { fd_set readfds; struct timeval timeout; uint32_t next = 0xFFFFFFFF; int len = 0; /* cpu the next timer */ if( VRRP_TIMER_IS_RUNNING( vsrv->adver_timer ) ){ int32_t delta = VRRP_TIMER_DELTA (vsrv->adver_timer); if( delta < 0 ) delta = 0; next = VRRP_MIN( next, delta ); }else{ /* here vsrv->ms_down_timer is assumed running */ int32_t delta = VRRP_TIMER_DELTA(vsrv->ms_down_timer); assert( VRRP_TIMER_IS_RUNNING( vsrv->ms_down_timer ) ); if( delta < 0 ) delta = 0; next = VRRP_MIN( next, delta ); } /* setup the select() ...

Get VRRP: Increasing Reliability and Failover with the Virtual Router Redundance Protocol now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.