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 ...
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.