O'Reilly logo

VRRP: Increasing Reliability and Failover with the Virtual Router Redundance Protocol by Adnan Adam Onart, Ayikudy Srikanth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C.5. VRRP Header Verification on a Received VRRP Advertisement Packet

 /********************************************************* NAME : vrrp_in_chk *********************************************************/ static int vrrp_in_chk( vrrp_rt *vsrv, struct iphdr *ip ) { int ihl = ip->ihl << 2; vrrp_pkt * hd = (vrrp_pkt *)((char *)ip + ihl); vrrp_if *vif = &vsrv->vif; /* MUST verify that the IP TTL is 255 */ if( ip->ttl != VRRP_IP_TTL ) { VRRP_LOG(("invalid ttl. %d and expect %d", ip>ttl,VRRP_IP_TTL)); return 1; } /* MUST verify the VRRP version */ if( (hd->vers_type >> 4) != VRRP_VERSION ){ VRRP_LOG(("invalid version. %d and expect %d" , (hd->vers_type >> 4), VRRP_VERSION)); return 1; } /* MUST verify that the received packet length is greater than ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required