--- quagga-0.99.7-orig/bgpd/bgp_dump.c 2007-07-22 16:13:53.000000000 +0200 +++ quagga-0.99.7/bgpd/bgp_dump.c 2007-07-22 16:33:45.762097562 +0200 @@ -198,6 +198,7 @@ struct listnode *node; uint16_t peerno = 0; struct stream *obuf; + struct in_addr localhost = { htonl(INADDR_LOOPBACK) }; obuf = bgp_dump_obuf; stream_reset (obuf); @@ -220,8 +221,15 @@ } /* Peer count */ - stream_putw (obuf, listcount(bgp->peer)); + stream_putw (obuf, listcount(bgp->peer) + 1); + /* Peer #0 entry reflects locally originated routes */ + stream_putc (obuf, TABLE_DUMP_V2_PEER_INDEX_TABLE_AS4+TABLE_DUMP_V2_PEER_INDEX_TABLE_IP); + stream_put_in_addr (obuf, &bgp->router_id); + stream_put_in_addr (obuf, &localhost); + stream_putl (obuf, bgp->as); + + peerno++; /* Walk down all peers */ for(ALL_LIST_ELEMENTS_RO (bgp->peer, node, peer)) {