Index: ripd.c =================================================================== RCS file: /var/cvsroot/zebra/zebra-pj/ripd/ripd.c,v retrieving revision 1.4 diff -u -r1.4 ripd.c --- ripd.c 13 Dec 2002 21:07:42 -0000 1.4 +++ ripd.c 14 May 2003 00:49:03 -0000 @@ -1481,7 +1481,7 @@ { int ret; int sock; - char buf[RIP_PACKET_MAXSIZ]; + char buf[RIP_PACKET_MAXSIZ_IOS]; struct sockaddr_in from; unsigned int ifindex; @@ -1490,7 +1490,7 @@ rip_event (RIP_READ, sock); /* Read RIP packet. */ - ret = rip_recvmsg (sock, buf, RIP_PACKET_MAXSIZ, &from, (int *)&ifindex); + ret = rip_recvmsg (sock, buf, RIP_PACKET_MAXSIZ_IOS, &from, (int *)&ifindex); if (ret < 0) { zlog_warn ("Can't read RIP packet: %s", strerror (errno)); @@ -1526,7 +1526,15 @@ memset (&from, 0, sizeof (struct sockaddr_in)); fromlen = sizeof (struct sockaddr_in); - len = recvfrom (sock, (char *)&rip_buf.buf, sizeof (rip_buf.buf), 0, + /* IOS apparently sends authentication info as an extra entry, ie IOS still + * will send 25 routing entries, for a total of 26, rather than counting + * the auth info entry towards the 25 allowed entries. See RFC2453 + * Section 4.1, paragraph 1. See also [zebra 19024]. + * To cope with this the input buffer needs to be one entry bigger than + * RFC mandated size. + */ + len = recvfrom (sock, (char *)&rip_buf.buf_ios_bug, + sizeof (rip_buf.buf_ios_bug), 0, (struct sockaddr *) &from, &fromlen); if (len < 0) { @@ -1566,10 +1574,10 @@ rip_peer_bad_packet (&from); return len; } - if (len > RIP_PACKET_MAXSIZ) + if ( (len > RIP_PACKET_MAXSIZ) && (len != RIP_PACKET_MAXSIZ_IOS) ) { - zlog_warn ("packet size %d is larger than max size %d", - len, RIP_PACKET_MAXSIZ); + zlog_warn ("packet size %d is > max size %d and != IOS bug size %d", + len, RIP_PACKET_MAXSIZ, RIP_PACKET_MAXSIZ_IOS); rip_peer_bad_packet (&from); return len; } Index: ripd.h =================================================================== RCS file: /var/cvsroot/zebra/zebra-pj/ripd/ripd.h,v retrieving revision 1.3 diff -u -r1.3 ripd.h --- ripd.h 7 Apr 2003 06:11:09 -0000 1.3 +++ ripd.h 14 May 2003 00:49:03 -0000 @@ -41,6 +41,10 @@ /* Normal RIP packet min and max size. */ #define RIP_PACKET_MINSIZ 4 #define RIP_PACKET_MAXSIZ 512 +/* IOS apparently will send 26 entry packets when auth is used + * see [zebra 19024] + */ +#define RIP_PACKET_MAXSIZ_IOS 524 #define RIP_HEADER_SIZE 4 #define RIP_RTE_SIZE 20 @@ -162,6 +166,7 @@ { struct rip_packet rip_packet; char buf[RIP_PACKET_MAXSIZ]; + char buf_ios_bug[RIP_PACKET_MAXSIZ_IOS]; }; /* RIP route information. */