summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
AgeCommit message (Collapse)Author
2005-02-082005-02-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_interface.h: Improve passive_interface comment. Add new multicast_memberships bitmask to struct ospf_interface to track active multicast subscriptions. Declare new function ospf_if_set_multicast. * ospf_interface.c: (ospf_if_set_multicast) New function to configure multicast memberships properly based on the current multicast_memberships status and the current values of the ospf_interface state, type, and passive_interface status. (ospf_if_up) Remove call to ospf_if_add_allspfrouters (this is now handled by ism_change_state's call to ospf_if_set_multicast). (ospf_if_down) Remove call to ospf_if_drop_allspfrouters (now handled by ism_change_state). * ospf_ism.c: (ospf_dr_election) Remove logic to join or leave the DRouters multicast group (now handled by ism_change_state's call to ospf_if_set_multicast). (ism_change_state) Add call to ospf_if_set_multicast to change multicast memberships as necessary to reflect the new interface state. * ospf_packet.c: (ospf_hello) When a Hello packet is received on a passive interface: 1. Increase the severity of the error message from LOG_INFO to LOG_WARNING; 2. Add more information to the error message (packet destination address and interface address); and 3. If the packet was sent to ospf-all-routers, then try to fix the multicast group memberships. (ospf_read) When a packet is received on an interface whose state is ISM_Down, enhance the warning message to show the packet destination address, and try to update/fix the multicast group memberships if the packet was sent to a multicast address. When a packet is received for ospf-designated-routers, but the current interface state is not DR or BDR, then increase the severity level of the error message from LOG_INFO to LOG_WARNING, and try to fix the multicast group memberships. * ospf_vty.c: (ospf_passive_interface) Call ospf_if_set_multicast for any ospf interface that may have changed from active to passive. (no_ospf_passive_interface) Call ospf_if_set_multicast for any ospf interface that may have changed from passive to active. (show_ip_ospf_interface_sub) Show multicast group memberships.
2005-02-082005-02-08 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (various) Remove unneeded stream_set_putp abuse.
2005-02-022005-02-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_read) Fix bug: must check for state ISM_Down, not for event ISM_InterfaceDown. And improve the message by adding the interface flags. * if.h: Declare if_flag_dump. [backport candidate]
2005-01-292005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_packet_add) If oi->obuf is NULL, print an error message and return. (ospf_read) If the interface state is ISM_InterfaceDown, issue a warning message and ignore the packet.
2005-01-102005-01-10 Greg Troxel <gdt@fnord.ir.bbn.com>gdt
* ospf_packet.h: Remove commented out definition of OSPF_MAX_PACKET; neither it or the uncommented one are used any more. * ospf_packet.c (ospf_make_ls_upd): Leave room for authentication when deciding if an update will fit. (ospf_packet_authspace): Factor out calculation of size required for authentication. (ospf_make_db_desc): Use ospf_max_packet, not OSPF_MAX_PACKET. Don't confuse readers that there is a macro.
2004-12-292004-12-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_db_desc) Reduce severity of "Negotiation done" messages from LOG_WARNING to LOG_INFO, since this seems to be normal.
2004-12-292004-12-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_read) Always look up the interface if ospf_recv_packet returns NULL ifp, since some platforms such as Solaris 8 appear to support ifindex retrieval but don't.
2004-12-29add XXX comment that perhaps we need to recover from short headers.gdt
2004-12-112004-12-11 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_db_desc) Should be static, not global. (ospf_hello,ospf_db_desc,ospf_ls_upd,ospf_ls_ack) Improve warning messages to include identifying information (e.g. router id). * ospf_nsm.c: (nsm_change_state) Improve info message to include router id and state names.
2004-12-082004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* *.c: Change level of debug messages to LOG_DEBUG.
2004-12-032004-12-03 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_db_desc) Reduce priority on a debug message from LOG_NOTICE to LOG_DEBUG.
2004-11-302004-11-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_packet.c: (ospf_db_desc_proc) Fix spelling of packet in warning message and in comment. (ospf_db_desc) Warning message that a packet is being discarded should give the router id of the packet source. Fix spelling of packet in two warning messages. (ospf_ls_req) Warning message that a link state request is being discarded should give the router id of the neighbor that sent it.
2004-11-202004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
2004-11-15Rationalize CMSG_SPACE usage:gdt
in lib/zebra.h, ensure that RFC3542-required CMSG_SPACE and CMSG_LEN are defined. Warn if alignment assumptions are made, since they are i386-centric. in lib/sockopt.h, declare that sockopt sizes are without CMSG_SPACE-required padding - just simple sizeof. in ospfd/ospf_packet.c, simply use CMSG_SPACE This should remove all instances of CMSG_ALIGN from the source code. This is a nonstandard, though rational, construct; quagga should use only those defines in RFC3542.
2004-11-022004-11-02 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_write_frags) remove iov arg, msg already points to it. Add convenience pointer to msg->msg_iov[1], and use this, fixing the unfortunate borkenness introduced in moving of this code to a function. (ospf_write) remove iovp and fix up call to previous. (ospf_ls_upd_packet_new) cast size to long int - unfortunately glibc's size_t format modifier is not portable.
2004-10-312004-10-31 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_ls_upd_packet_new) Format for size_t should be ld. * ospf_zebra.c: (ospf_distribute_list_update_timer) Ugly misuse of THREAD_ARG to store an integer, but it should at least use same same type to retrieve the value. Assert value is sane.
2004-10-312004-10-31 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_write_frags) Add debug output (ospf_write) set type early, so we can pass it to ospf_write_frags. (ospf_ls_upd_packet_new) print size in debug output when too large packet is encountered.
2004-10-222004-10-22 Paul Jakma <paul@dishone.st>paul
* ospfd/ospf_packet.c: setsockopt_pktinfo -> setsockopt_ifindex * zebra/irdp_main.c: ditto
2004-10-222004-10-22 Paul Jakma <paul@dishone.st>paul
* ospf_network.c: (ospf_sock_init) call neutral setsock_ifindex() function. * ospf_packet.c: (ospf_read) manually look up ifindex if system could not have returned one, eg openbsd.
2004-10-112004-10-11 Paul Jakma <paul@dishone.st>paul
* (global) Const char update and signed/unsigned fixes. * (various headers) size defines should be unsigned. * ospf_interface.h: remove duplicated defines, include the authoritative header - though, these defines should probably be moved to a dedicated header, or ospfd.h. * ospf_lsa.h: (struct lsa) ls_seqnum should be unsigned. * ospf_packet.c: (ospf_write) cast result of shift to unsigned.
2004-10-112004-10-11 Paul Jakma <paul@dishone.st>paul
* ospf_dump.c: (ospf_ip_header_dump) Assume header is in host order remove ntohs that should have dissappeared. Take struct ip as argument, caller has to know there's an IP header at start of stream anyway. * ospf_dump.h: update declaration of ospf_ip_header_dump. * ospf_packet.c: (ospf_write) correct call to sockopt_iphdrincl_swab_htosys which was munging the header. (ospf_recv_packet) ip_len is needed for old OpenBSD fixup. (ospf_read) sockopt_iphdrincl_swab_systoh ip header as soon as we have it.
2004-10-08Compiler warnings fixes round 1.hasso
2004-10-052004-10-05 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: replace ospf_swap_iph_to... with sockopt_iphdrincl_swab_...
2004-09-272004-09-27 Paul Jakma <paul@dishone.st>paul
* ospf_dump.c: (ospf_ip_header_dump) Use HAVE_IP_HDRINCL_BSD_ORDER Apply to offset too. Print ip_cksum, lets not worry about possible 2.0.37 compile problems. * ospf_packet.c: (ospf_swap_iph_to{n,h}) Use HAVE_IP_HDRINCL_BSD_ORDER. (ospf_recv_packet) ditto. (ospf_write) Fixup iov argument to ospf_write_frags.
2004-09-272004-09-27 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_write) (struct msghdr).msg_name is caddr_t on most platforms. (ospf_recv_packet) ditto. And msg_flags is not always there memset struct then set fields we care about rather than initialise all fields individually.
2004-09-26Compiler warnings fixes.hasso
2004-09-242004-09-24 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_write) ifdef fragmentation support. move actual fragmentation out to a new, similarly ifdefed, function. (ospf_write_frags) fragmented write support, moved from previous.
2004-09-242004-09-24 Paul Jakma <paul@dishone.st>paul
* ospf_apiserver.{c,h}: lists typedef removal cleanup. update some list loops to LIST_LOOP. some miscellaneous indent fixups. (ospf_apiserver_unregister_opaque_type) fix listnode_delete of referenced node in loop. * ospf_interface.h: lists typedef removal cleanup. * ospf_opaque.{c,h}: lists typedef removal cleanup. update some list loops to LIST_LOOP. miscellaneous style and indent fixups. * ospf_te.{c,h}: ditto * ospf_packet.c: lists typedef removal cleanup.
2004-09-23Remove usage of evil list and listnode typedefs.hasso
2004-09-122004-09-12 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: Fix bugzilla #107 (ospf_packet_max) get rid of the magic 88 constant (ospf_swab_iph_ton) new function. set ip header to network order, taking BSDisms into account. (ospf_swab_iph_toh) the inverse. (ospf_write) Add support for IP fragmentation, will only work on linux though, other kernels make it impossible. get rid of the magic 4 constant. (ospf_make_ls_upd) Bound check to end of stream, not to interface mtu. (ospf_ls_upd_packet_new) New function, allocate upd packet taking oversized LSAs into account. (ospf_ls_upd_queue_send) use ospf_ls_upd_packet_new to allocate, rather than statically allocating mtu sized packet buffer, which actually was wrong - it didnt take ip header into account, which should not be included in packet buffer. (ospf_ls_upd_send_queue_event) minor tweaks and remove TODO comment.
2004-08-31Assorted changes from work at BBN. Most are minor, and several are ingdt
support of more significant changes not in this commit. The last item in the ChangeLog below may be needed for p2mp to work correctly. 2004-08-31 David Wiggins <dwiggins@bbn.com> * hash.c (hash_iterate): Save next pointer before calling procedure, so that iteration works even if the called procedure deletes the hash backet. * linklist.h (listtail): new macro, not yet used. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.c (ospf_spf_calculate): Many more comments and debug print statements. New function ospf_vertex_dump used in debugging. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.h (struct vertex): Comments for flags and structure members. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_route.c: When finding an alternate route, log cost as well. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_interface.c (ospf_lookup_if_params): Initialize af in struct prefix allocated on stack. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_packet.c (ospf_ls_ack_send_delayed): In p2mp mode, send acks to AllSPFRouters, rather than All-DR.
2004-08-26fix typo in previous commitgdt
2004-08-262004-08-26 Greg Troxel <gdt@fnord.ir.bbn.com>gdt
* ospf_packet.c (ospf_recv_packet): adjust size declaration of buffer used to get interface index so that it compiles on other than Linux and includes the required alignment space. Probably this was only working on sparc/sparc64 because most of sockaddr_dl was not being written.
2004-08-192004-08-19 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: update to match sockopt renames.
2004-07-272004-07-27 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_ls_upd_send_queue_event) fix thinko from last fix for ospfd wedging due to oversize LSAs: dont list loop on ospf_ls_upd_queue_send() - guaranteed segfault.
2004-07-232004-07-23 Paul Jakma <paul@dishone.st>paul
* ospf_network.c: Replace PKTINFO/RECVIF with call to setsockopt_pktinfo * ospf_packet.c: Use getsockopt_pktinfo_ifindex and SOPT_SIZE_CMSG_PKTINFO_IPV4.
2004-07-142004-07-14 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_ls_upd_send_queue_event) Partial fix for problem reported by Peter Frost amongst others, where function will spin indefinitely if update list contains LSAs greater than MTU-headers or other condition leading to update list never being cleared. Problem of what to do with these LSAs remains. (ospf_make_ls_upd) add comment about large LSA problem, indentation cleanup.
2004-06-20Remove ifdef's HAVE_NSSA. NSSA support is stable enough.hasso
2004-05-052004-05-05 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_associate_packet_vl) cleanup, move some of the checks up to ospf_read, return either a virtual link oi, or NULL. (ospf_read) Cleanup, make it responsible for checks. Remove the nbr lookup - moved to ospf_neighbor. Adjust all nbr lookups to use new wrappers exported by ospf_neighbor. * ospf_neighbor.h: Add ospf_neigbour_get and ospf_nbr_lookup. * ospf_neighbor.c: (ospf_neigbour_get) Index ospf_interface neighbour table by router-id for virtual-link ospf_interfaces, not by peer_addr (which breaks for asymmetric vlinks) (ospf_nbr_lookup) add a wrapper for nbr lookups to deal with above.
2004-04-04[quagga-dev 1005] bugzilla #86: ospf_recv_packet will fail on Solaris/x86hasso
2004-02-11Fix by Vadim Suraev - [zebra 14710] #6.hasso
2003-12-082003-12-08 Mattias Amnefelt <mattiasa@kth.se?paul
* ospf_packet.c: (ospf_recv_packet) OpenBSD now leaves iph.ip_len network byte order. (bugzilla #67).
2003-09-292003-09-29 Paul Jakma <paul@dishone.st>paul
* ospfd/ospf_packet.c: Add debug output for some of the previously completely silent drops of 'bad' packets.
2003-09-232003-09-24 Thomas Giger TGC <thomas.giger@tgc.de>paul
* ospf_packet.c (ospf_associate_packet_vl): pass NULL struct interface to ospf_if_lookup_by_local_addr() rather than the receiving interface ifp, packets for VL's could come in any interface. See quagga-dev 250.
2003-07-242003-07-25 kamatchi soundaram <kamatchi@tdd.sj.nec.com>paul
* ospf_packet.c (ospf_ls_upd_send_queue_event): get next route node in body of the loop to avoid chance that route node is unlocked and deleted before the next iteration tries to get next route node.
2003-06-302003-06-30 Paul Jakma <paul@dishone.st>paul
* ospf_packet.c: (ospf_ls_upd_send_queue_event) undo fix suggested Mikael Lonnroth. As per Kamatchi Soundaram / [zebra 19590], original behaviour is correct.
2003-06-272003-06-27 Paul Jakma <paul@dishone.st>paul
* ospf_vty.c: (global) add, unused, description array for lsa flags. (show_ip_ospf_database_header): pretty print options, printf hex numbers as 0x, print lsa flags and note if it is a translated LSA. (show_lsa_detail_proc): print out OSPF_LSA_LOCAL_XLT LSAs. * ospf_packet.c: (ospf_write) print out destination IP in debug info if write fails.
2003-06-262003-06-26: Mikael Lonnroth <gml@advancevpn.com>paul
* ospf_packet.c: (ospf_ls_upd_send_queue_event) clean up list node and unlock lsa if we break early. (eg packet size too large).
2003-06-192003-06-19 Paul Jakma <paul@dishone.st>paul
* ospfd/ospf_packet.c: Fix typos, extra squiggly bracket. Note to self: in future make sure that when you test compile a change you actually have the relevant configure options enabled.
2003-06-192003-06-19 Paul Jakma <paul@dishone.st>paul
* ospfd/ospf_packet.c: Update Hasso's hack slightly, add comment elaborating on Hasso's, use the SET/CHECK_FLAG macros.