Commit graph

99 commits

Author SHA1 Message Date
Renato Westphal 6aec4b4176 ripd: add "none" option to the "ip rip receive version" command
RFC 2453 says (section 5.1):
"(...) For completeness, routers should also implement a receive control
switch which would determine whether to accept, RIP-1 only, RIP-2 only,
both, or none.  It should also be configurable on a per-interface basis".

For the "ip rip send version" command, we don't need to implement the
"none" option because there's already the "passive-interface" command
for that.

Fixes IxANVL RIP test 16.8.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-25 11:45:39 -02:00
Renato Westphal f90310cfe8 ripd: implement the "ip rip v2-broadcast" CLI command
This command allows ripd to send v2 updates as broadcast packets instead
of multicast packets. Useful as a technique to help with RIPv1/v2
interop issues.

Fixes IxANVL RIP test 16.2

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-25 11:34:39 -02:00
Renato Westphal 4e0548665d ripd: ignore request for RTEs from unknown address-families
Fixes IxANVL RIP test 6.5.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-25 11:34:39 -02:00
Renato Westphal 1cfaf93c5e ripd: reject authentication strings with zeros in the middle
RFC 2453 says:
"If the password is under 16 octets, it must be left-justified and padded
to the right with nulls (0x00)".

Fixes IxANVL RIP test 10.3.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-25 11:34:39 -02:00
Christian Franke 58093a7917 ripd: print md5 auth digest correctly
The dump of the md5 hash was missing one byte of the hash.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-20 20:28:26 -04:00
Donald Sharp 0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Christian Franke 9471675f21 ripd: add support for route tags
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-10-07 21:05:05 -04:00
Christian Franke dc9ffce878 *: Consistently support 32-bit route tags
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.

It is based on the following patch:

    commit d25764028829a3a30cdbabe85f32408a63cccadf
    Author: Paul Jakma <paul.jakma@hpe.com>
    Date:   Fri Jul 1 14:23:45 2016 +0100

    *: Widen width of Zserv routing tag field.

But also contains the changes which make this actually useful for all
the daemons.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-10-07 21:05:05 -04:00
Matthieu Boutier fb23cf4abe lib: Make distribute.c accepts both v4 and v6.
distribute.c doesn't allow to manage both v4 and v6 distribute lists.  This
patch fix this problem by having 4 DISTRIBUTE* values in the enumeration instead
of two. The code in all daemons using distribute.c is adapted.
2016-09-26 10:52:41 -04:00
Matthieu Boutier 7c989d74b5 ripd: code simplification for redistribution.
Use loops and variables instead of doing each cases by hand.
Use boolean instead of having 2 almost identical functions.
2016-09-26 10:52:41 -04:00
Paul Jakma 1dec2166de ripd: split-horizon default differed between rip_interface_new and _reset
* rip_interface.c: Default for split_horizon_default differed between
  rip_interface_new and rip_interface_reset, causing at least some issues
  after interface events. See patchwork #604. Fix, and consolidate code.

  (rip_interface_{reset,clean}) rename these to 'interface', as that's more
  appropriate.  Spin the ri specific bodies of these functions out to
  rip_interface_{reset,clean} helpers.  Factor out the overlaps, so
  rip_interface_reset uses rip_interface_clean.

  (rip_interface_new) just use rip_interface_reset.

* ripd.h: Update for (rip_interface_{reset,clean})

Reported by xufeng zhang, with a suggested fix on which this commit expands.
See patchwork #604.  This commit addresses only the split-horizon
discrepency, issue #2.  The other issue they reported, #1, is not addressed,
though suggested fix seems inappropriate.

Cc: xufeng.zhang@windriver.com
2016-09-23 12:12:16 -04:00
Paul Jakma b892f1ddfe *: use an ifindex_t type, defined in lib/if.h, for ifindex values
(cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
2016-08-18 07:35:38 -04:00
Donald Sharp b06fd12526 Quagga: Fix code to use srandom/random
Quagga was using a mix of srand/rand and srandom/random.
Consolidate to use srandom/random which are the POSIX
versions of random number generators

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-05-29 20:24:55 -04:00
Lu Feng 8478ae7ef3 ripd: allow to enable/disable the ECMP feature
Introduce a new command "[no] allow-ecmp" to enable/disable the
ECMP feature in RIP. By default, ECMP is not allowed.

Once ECMP is disabled, only one route entry can exist in the list.

* rip_zebra.c: adjust a debugging information, which shows the number
               of nexthops according to whether ECMP is enabled.
* ripd.c: rip_ecmp_add() will reject the new route if ECMP is not
          allowed and some entry already exists.
          A new configurable command "allow-ecmp" is added to control
          whether ECMP is allowed.
          When ECMP is disabled, rip_ecmp_disable() is called to
          remove the multiple nexthops.
* ripd.h: Add a new member "ecmp" to "struct rip", indicating whether
          ECMP is allowed or not.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 0b74a0a5db7bcf65bf68c44b547b02b1310b5cdb)
2016-05-26 17:12:05 +00:00
Lu Feng bce8e8681a ripd: add ECMP support
* Each node in the routing table is changed into a list, holding
  the multiple equal-cost paths.

* If one of the multiple entries gets less-preferred (greater
  metric or greater distance), it will be directly deleted instead
  of starting a garbage-collection timer for it.
  The garbage-collection timer is started only when the last entry
  in the list gets INFINITY.

* Some new functions are used to maintain the ECMP list. And hence
  rip_rte_process(), rip_redistribute_add() and rip_timeout() are
  significantly simplified.

* rip_zebra_ipv4_add() and rip_zebra_ipv4_delete() now can share
  the common code. The common part is moved to rip_zebra_ipv4_send().

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b397cf4f0fc484c5ebfc8a680090055c8e6cbe32)

Conflicts:
	ripd/rip_zebra.c
2016-05-26 17:11:05 +00:00
Lu Feng 6a7cff75c6 ripd: use only one constant for derivation
RIP_MAX_RTE is defined in ripd.h as 25 but is in fact the
result of a formula. More over it is not used in the code:
the code itself includes the fomula. This makes it un-clear
for maintenance.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 342a31bfda)
2016-05-26 01:06:37 +00:00
Donald Sharp bd40c341ee lib: refactor connected_lookup_prefix
The connected_lookup_address function should really
be a connected_lookup_prefix function.  Refactor
the code to use it.

Ticket: CM-10890
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-05-12 10:03:44 -04:00
Donald Sharp b2d7c082a2 quagga: Remove iflist global variable
The file if.c has a iflist that had the list of interfaces
in the default vrf.  Remove this variable and replace
with a vrf_iflist lookup on the default vrf where it
was used.

Additionally, modify ptm code to iterate over all vrf's
when enabling ptm.

Ticket: CM-10338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
2016-04-08 13:15:59 -04:00
Christian Franke 85b123a4bf ripd, isisd: fix warnings that make the build fail
These issues have been found by running buildtest.sh
using GCC 5.2.0 and Clang 3.7.0

Fixes pointer checks that can never be null

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:11 -04:00
Donald Sharp 4608cb43b1 quagga: Additional centos 6 -enable-werror fixes
This commit fixes these warnings:

1) bgpd/bgp_nexthop.c - dereferencing pointer 'X' does break strict-aliasing rules
3) ripd/ripd.c - 'ifaddr.prefixlen' may be used uninitialized in this function

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-09-29 06:36:04 -07:00
Dinesh G Dutt 0aabccc0a8 Zebra: Add IPv6 protocol filtering support & Setting Src of IPv6 routes
Ticket:
Reviewed By: CCR-3335
Testing Done: bgpsmoke, ENHE tests etc.

    Add support for filtering routes from upper layer protocols to zebra
    via route-maps for IPv6. The same functionality already existed for
    IPv4.

    In addition, add support for setting source of routes via IPv6 protocol
    map.

    Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
    Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
    Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
    Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
2015-09-15 23:48:00 -07:00
Donald Sharp 7ce2a26cd7 Fixup of some last remaining differences between stg and git 2015-07-22 13:12:22 -07:00
Donald Sharp e5f745ca93 ripd: ripd-warnings.patch
Remove compile warnings for the ripd directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
2015-05-19 18:29:14 -07:00
Lu Feng 342a31bfda ripd: use only one constant for derivation
RIP_MAX_RTE is defined in ripd.h as 25 but is in fact the
result of a formula. More over it is not used in the code:
the code itself includes the fomula. This makes it un-clear
for maintenance.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-07-02 19:30:20 +02:00
David Lamparter 6b0655a251 *: nuke ^L (page feed)
Quagga sources have inherited a slew of Page Feed (^L, \xC) characters
from ancient history.  Among other things, these break patchwork's
XML-RPC API because \xC is not a valid character in XML documents.

Nuke them from high orbit.

Patches can be adapted simply by:
	sed -e 's%^L%%' -i filename.patch
(you can type page feeds in some environments with Ctrl-V Ctrl-L)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-06-04 06:58:02 +02:00
Lu Feng 7b3b98ae3e ripd & ripngd: avoid the zero interface metric
The interface metric is initialized to 0 in the commit db19c85:
zebra: set metric for directly connected routes via netlink to 0

Ripd and ripngd must be aware of it and avoid increase the
route metric by 0.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-06-03 15:32:11 +02:00
David Lamparter b68da446e9 ripd: correctly redistribute ifindex routes (BZ#664)
ripd had a check to restrict metric 0 to only directly connected routes.
This check was implemented by checking against Connected as route type.
This is, however, incorrect -- all routes that directly use an interface
without a nexthop should be treated as directly connected and passed off
with metric 0.

ripngd does not posess such a check and was not touched.

Reported-by: Sean Fulton <sean@gcnpublishing.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-04-09 22:33:19 +02:00
Nick Hilliard bb2315f287 ripd: clear sockaddr_in before using
ripd_create_socket() failed in bind() on Mac OS X 10.7 since there was garbage
in unused fields of struct sockaddr_in.

* ripd/ripd.c: zero out struct sockaddr_sin from before filling.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-09-25 06:03:46 +02:00
Stephen Hemminger 2c2397059d ripd: fix compiler warnings
* ripd/rip_interface.c
  * rip_request_neighbor(): comment out, unused
  * rip_request_neighbor_all(): idem
  * rip_interface_up(): Cast flags otherwise compiler complains
    about %lld not matching uint64_t on 64 bit x86. Print in hex
    since flags are bit field.
  * rip_interface_add(): idem
  * rip_interface_delete(): idem
* ripd/rip_zebra.c
  * rip_redistribute_set(): comment out, unused
* ripd/ripd.h
  * rip_redistribute_check(): move prototype here so compiler
    can check function against prototype
* ripd/ripd.c
  * rip_update_default_metric(): comment out, unused
2009-12-10 19:16:05 +03:00
Stephen Hemminger 78b31d5cf5 ripd: set IP TOS for control socket
* ripd.c: (rip_create_socket) RIP packets should go out with Type Of Service
  (DSCP) set to Internet control (like OSPF and BGP).
2009-07-27 12:37:26 +01:00
Stephen Hemminger 82f5ee1ead [ripd] Ignore non-running interfaces in rip status
Vyatta Bug 3999
2009-06-18 20:18:27 +01:00
Stephen Hemminger 7fc626de5f [cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
2009-06-12 17:10:29 +01:00
Stephen Hemminger 393deb9bd6 [cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
2009-06-12 17:07:49 +01:00
Stephen Hemminger 1423c809cc [lib] mes_lookup string lookup table argument should be marked const
2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com>

	* lib/log.{c,h}: struct message argument should point to const
	* */*.c: adjust to suit,

Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22 19:52:58 +01:00
Paul Jakma fa93b16208 [ripd] Fix mistaken empty string test
2008-05-29 Stephen Hemminger <stephen.hemminger@vyatta.com>

	* ripd.c: (rip_auth_md5) fix bogus empty string test
2008-05-29 19:03:08 +00:00
Paul Jakma ce6ab03a27 [ripd] remove unnecessary 0 entries from struct message's
2008-03-13 Paul Jakma <paul.jakma@sun.com>

	* ripd.c/rip_interface.c: Remove 0 entries from rip_msg
	  ri_version_msg struct message's, not needed with recent fixes
	  to mes_lookup.
2008-03-13 03:28:13 +00:00
Paul Jakma 6f0e3f6e17 [autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>

	* configure.ac: sys/conf.h depends on sys/param.h, at least on
	  FBSD 6.2.
	  (bug #363) Should check for in_pktinfo for IRDP

2006-05-27 Paul Jakma <paul.jakma@sun.com>

	* configure.ac: General cleanup of header and type checks, introducing
	  an internal define, QUAGGA_INCLUDES, to build up a list of
	  stuff to include so as to avoid 'present but cant be compiled'
	  warnings.
	  Misc additional checks of things missing according to autoscan.
	  Add LIBM, for bgpd's use of libm, so as to avoid burdening
	  LIBS, and all the binaries, with libm linkage.
	  Remove the bad practice of using m4 changequote(), just
	  quote the []'s in the case statements properly.
	  This should fix bugs 162, 303 and 178.
	* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
	  HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
	* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 02:38:51 +00:00
Andrew J. Schorr 33672eddf1 [ripd, ripngd] Remove useless code in rip_vty_out_uptime function
2007-04-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ripd/ripd.c: (rip_vty_out_uptime) Remove unused variable timer_now.
	* ripngd/ripngd.c: (ripng_vty_out_uptime) Remove unused variable
	  timer_now.
2007-04-27 18:03:11 +00:00
Vincent Jardin a1fdf94796 Fix the display of route timeout in "show ip rip". (Use thread_timer_remain_second) 2007-04-11 15:12:05 +00:00
Andrew J. Schorr a4c648281d [ripd] Fix "show ip rip status" display of time until next update
2007-03-21 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ripd.c: (show_ip_rip_status) Use new thread_timer_remain_second
	  function instead of rip_next_thread_timer to display the time until
	  next update properly.
	  (rip_next_thread_timer) Remove obsolete function.
2007-03-21 18:57:38 +00:00
Andrew J. Schorr e4529636b7 [PtP over ethernet] New peer flag allows much more addressing flexibility
2006-12-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* if.h: (struct connected) Add new ZEBRA_IFA_PEER flag indicating
	  whether a peer address has been configured.  Comment now shows
	  the new interpretation of the destination addr: if ZEBRA_IFA_PEER
	  is set, then it must contain the destination address, otherwise
	  it may contain the broadcast address or be NULL.
	  (CONNECTED_DEST_HOST,CONNECTED_POINTOPOINT_HOST) Remove obsolete
	  macros that were specific to IPv4 and not fully general.
	  (CONNECTED_PEER) New macro to check ZEBRA_IFA_PEER flag.
	  (CONNECTED_PREFIX) New macro giving the prefix to insert into
	  the RIB: if CONNECTED_PEER, then use the destination (peer) address,
	  else use the address field.
	  (CONNECTED_ID) New macro to come up with an identifying address
	  for the struct connected.
	* if.c: (if_lookup_address, connected_lookup_address) Streamline
	  logic with new CONNECTED_PREFIX macro.
	* prefix.h: (PREFIX_COPY_IPV4, PREFIX_COPY_IPV6) New macros
	  for better performance than the general prefix_copy function.
	* zclient.c: (zebra_interface_address_read) For non-null destination
	  addresses, set prefixlen to equal the address prefixlen.  This
	  is needed to get the new CONNECTED_PREFIX macro to work properly.
	* connected.c: (connected_up_ipv4, connected_down_ipv4,
	  connected_up_ipv6, connected_down_ipv6) Simplify logic using the
	  new CONNECTED_PREFIX macro.
	  (connected_add_ipv4) Set prefixlen in destination addresses (required
	  by the CONNECTED_PREFIX macro).  Use CONNECTED_PEER macro instead
	  of testing for IFF_POINTOPOINT.  Delete invalid warning message.
	  Warn about cases where the ZEBRA_IFA_PEER is set but no
	  destination address has been supplied (and turn off the flag).
	  (connected_add_ipv6) Add new flags argument so callers may set
	  the ZEBRA_IFA_PEER flag.  If peer/broadcast address satisfies
	  IN6_IS_ADDR_UNSPECIFIED, then reject it with a warning.
	  Set prefixlen in destination address so CONNECTED_PREFIX will work.
	* connected.h: (connected_add_ipv6) Add new flags argument so
	  callers may set the ZEBRA_IFA_PEER flag.
	* interface.c: (connected_dump_vty) Use CONNECTED_PEER macro
	  to decide whether the destination address is a peer or broadcast
	  address (instead of checking IFF_BROADCAST and IFF_POINTOPOINT).
	* if_ioctl.c: (if_getaddrs) Instead of setting a peer address
	  only when the IFF_POINTOPOINT is set, we now accept a peer
	  address whenever it is available and not the same as the local
	  address.  Otherwise (no peer address assigned), we check
	  for a broadcast address (regardless of the IFF_BROADCAST flag).
	  And must now pass a flags value of ZEBRA_IFA_PEER to
	  connected_add_ipv4 when a peer address is assigned.
	  The same new logic is used with the IPv6 code as well (and we
	  pass the new flags argument to connected_add_ipv6).
	  (if_get_addr) Do not bother to check IFF_POINTOPOINT: just
	  issue the SIOCGIFDSTADDR ioctl and see if we get back
	  a peer address not matching the local address (and set
	  the ZEBRA_IFA_PEER in that case).  If there's no peer address,
	  try to grab SIOCGIFBRDADDR regardless of whether IFF_BROADCAST is set.
	* if_ioctl_solaris.c: (if_get_addr) Just try the SIOCGLIFDSTADDR ioctl
	  without bothering to check the IFF_POINTOPOINT flag.  And if
	  no peer address was found, just try the SIOCGLIFBRDADDR ioctl
	  without checking the IFF_BROADCAST flag.  Call connected_add_ipv4
	  and connected_add_ipv6 with appropriate flags.
	* if_proc.c: (ifaddr_proc_ipv6) Must pass new flags argument to
	  connected_add_ipv6.
	* kernel_socket.c: (ifam_read) Must pass new flags argument to
	  connected_add_ipv6.
	* rt_netlink.c: (netlink_interface_addr) Copy logic from iproute2
	  to determine local and possible peer address (so there's no longer
	  a test for IFF_POINTOPOINT).  Set ZEBRA_IFA_PEER flag appropriately.
	  Pass new flags argument to connected_add_ipv6.
	  (netlink_address) Test !CONNECTED_PEER instead of if_is_broadcast
	  to determine whether the connected destination address is a
	  broadcast address.
	* bgp_nexthop.c: (bgp_connected_add, bgp_connected_delete)
	  Simplify logic by using new CONNECTED_PREFIX macro.
	* ospf_interface.c: (ospf_if_is_configured, ospf_if_lookup_by_prefix,
	  ospf_if_lookup_recv_if) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_lsa.c: (lsa_link_ptop_set) Using the new CONNECTED_PREFIX
	  macro, both options collapse into the same code.
	* ospf_snmp.c: (ospf_snmp_if_update) Simplify logic using new
	  CONNECTED_ID macro.
	  (ospf_snmp_is_if_have_addr) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_vty.c: (show_ip_ospf_interface_sub) Use new CONNECTED_PEER macro
	  instead of testing the IFF_POINTOPOINT flag.
	* ospfd.c: (ospf_network_match_iface) Use new CONNECTED_PEER macro
	  instead of testing with if_is_pointopoint.  And add commented-out
	  code to implement alternative (in my opinion) more elegant behavior
	  that has no special-case treatment for PtP addresses.
	  (ospf_network_run) Use new CONNECTED_ID macro to simplify logic.
	* rip_interface.c: (rip_interface_multicast_set) Use new CONNECTED_ID
	  macro to simplify logic.
	  (rip_request_interface_send) Fix minor bug: ipv4_broadcast_addr does
	  not give a useful result if prefixlen is 32 (we require a peer
	  address in such cases).
	* ripd.c: (rip_update_interface) Fix same bug as above.
2006-12-12 19:18:21 +00:00
Paul Jakma 3e557ae1ea [ripd] bug #278: remove gratuitous use of mid-function declaration
2006-09-11 Paul Jakma <paul.jakma@sun.com>

	* ripd.c: (rip_read) remove gratuitous use of mid-function
	  declaration of vrecv, bug #278.
2006-09-11 02:10:40 +00:00
Paul Jakma 15a2b089ce [ripd] bugs #261, #262: Fix RIPv1 info-leak and unauthenticated route updates
2006-05-04 Paul Jakma <paul.jakma@sun.com>

	* (general) Fixes for bugs #261 and 262. Thanks to
	  Konstantin V. Gavrilenko <kos@arhont.com> for the problem
	  reports, testing of a series of proposed patches and comment
	  on the proposed changes in behaviour.
	* rip_interface.c: (ip_rip_authentication_mode_cmd) Parse all
	  of the command before making any changes to configured state.
	* ripd.c: (rip_read) RIP version control should be absolute and
          always apply, fixes bug #261 by allowing RIPv1 to be disabled.
	  Fix bug #262: If authentication is enabled, then
	  unauthenticated packets should not be accepted. We do however
	  make an exception for RIPv1 REQUEST packets, to which we will
	  reply as RIPv1 can now be disabled fully, to allow ripd to
	  still provide routing /information/ to simple devices.
2006-05-04 07:36:34 +00:00
Andrew J. Schorr b9d92881f5 [ripd] Fix logic to send updates on all connected addresses.
2006-04-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ripd.c: (rip_update_process) Try to fix the logic for sending
	  an updated on each connected network.  The new code will
	  attempt to send the update on each connected network, whereas
	  the previous code seemed to be attempting to avoid sending
	  more than one RIPv1 update on a given interface, but was coded
	  incorrectly.  The actual effect of the old code was to send
	  an update only on the first connected address in the cases
	  where the interface is not multicast, or RIPv2 is not being used.
2006-04-28 16:22:36 +00:00
vincent 7a38333957 ripd.c: correct bug that allowed route learnt through RIP to take precedence over connected routes 2006-01-30 18:12:42 +00:00
paul 98fd1e6121 [ripd] Fix verification of received MD5 authenticated packets
2006-01-17 Paul Jakma <paul.jakma@sun.com>

	* ripd.c: (rip_auth_md5) remove pdigest, not needed.
	  Use a local buffer for the auth_str, where it can be properly
	  nul padded. Do so, hence fixing MD5 authentication.
	  Key looked up via key ring should be used in preference to
	  the RIPv1 simple password, not other way around.
	  No need to copy around digests, we can reference them
	  directly.
	  The auth_len received can't be trusted, some implementations
	  lie (e.g. older ripd).
	  (rip_auth_md5_ah_write) rename len local variable to doff
	  to be consistent with other functions.
	  (rip_auth_header_write) add the missing return.
	  (rip_auth_md5_set) use the proper constructs to access stream.
2006-01-17 17:26:25 +00:00
ajs 35a60c2d3c 2005-10-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ripd.c: (rip_response_process) Instead of calling
	  rip_interface.c:if_valid_neighbor(), call the equivalent
	  library function if_lookup_address().
	* rip_interface.c: (if_valid_neighbor) Remove function, since it is
	  essentially equivalent to the if_lookup_address() library function.
	* ripd.h: (if_valid_neighbor) Remove function declaration.
2005-10-30 23:51:32 +00:00
paul 216565ab68 2005-10-26 Paul Jakma <paul.jakma@sun.com>
* ripd.c: Update couple more functions to specify void
	  explicitely.
2005-10-25 23:35:28 +00:00
paul dc63bfd495 2005-10-26 Paul Jakma <paul.jakma@sun.com>
* (general) static/extern functions and definitions.
	* rip_interface.h: new file, export the public functions from
	  rip_interface.c
2005-10-25 23:31:05 +00:00
jardin 38d3c163cf 2005-10-17 Vincent Jardin <vincent.jardin@6wind.com>
* ripd.c: rip_create_socket() for each packet, it does not bind to the
          proper interfaces because we forget to use the from address when
          it is specified.
2005-10-19 19:29:59 +00:00