summaryrefslogtreecommitdiffstats
path: root/zebra/rtadv.c
Commit message (Collapse)AuthorAgeFilesLines
* cumulus take-3cumulus-take-3Timo Teräs2016-03-301-8/+75
|
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-02-261-3/+3
|
* lib, zebra: unify link layer type and hardware address handlingTimo Teräs2016-02-261-19/+0
| | | | | | | | | | | | | | | | This removes the BSD specific usage of struct sockaddr_dl hardware address. This unifies to use explict hw_addr member for the address, and zebra specific enumeration for the link layer type. Additionally the zapi is updated to never send platform specific structures over the wire, but the ll_type along with hw_addr_len and hw_addr are now sent for all platforms. Based on initial work by Paul Jakma. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Cleanup RTADV defineDonald Sharp2015-12-081-2/+2
| | | | | | | | | | The RTADV define was not being set correctly or consistently. Make the code consistent with our HAVE_IPV6 define. If the user wants to explicitly turn it off then they should run --disable-rtadv from the configure cli Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Fix leaked sockets in rtadv.cMorgan Stewart2015-09-241-6/+24
| | | | | | | | Coverity Scan #709790 In zebra/rtadv.c: rtadv_make_socket leaks socket for error cases. Added lines to close the socket for each error case or return. Signed-off-by: Morgan Stewart <morgan@cumulusnetworks.com>
* zebra: maintain RTADV per VRFFeng Lu2015-06-021-66/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the global variable "rtadv" into the "struct zebra_vrf", so that RTADV feature can work per VRF. * rtadv.c/rtadv.h: Add a proper parameter to the functions so that the entity of the "struct zebra_vrf" and interfaces can be obtained from the specified VRF. The old rtadv_init() is splitted into: - rtadv_cmd_init(): it installs the RTADV commands; is called from main(); - new rtadv_init(): it creates the socket; is called from zebra_vrf_enable(). rtadv_terminate() is added to stop the threads, close the socket and clear the counters. It is called from zebra_vrf_disable(). rtadv_make_socket() now calls vrf_socket() to create a socket in the VRF. * interface.h and rib.h: define the macro RTADV. * main.c: according changes, refer to rtadv.c. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: use prefix2str for logging where possibleTimo Teräs2015-06-011-5/+3
| | | | | | | This makes code more robust, consice and readable. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra, isisd: cast to unsigned char for ctypesDavid Lamparter2015-04-211-1/+2
| | | | | | | | ctype.h macros take int as arguments, but expect arguments to be in unsigned char's range. Even though it probably works, this isn't correct on systems that have a signed char type. Cast explicitly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: nuke ^L (page feed)David Lamparter2014-06-041-3/+3
| | | | | | | | | | | | | | 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>
* bgpd, ospfd, zebra: fix some DEFUN definitionsChristian Franke2014-04-011-1/+1
| | | | | | | Fixup some DEFUNS with incorrect command strings or mixed up helpstrings. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: justify rtadv VTY commands with argumentsDenis Ovsienko2012-01-261-101/+110
| | | | | | | | | | | | | | | | | | | ipv6 nd ra-interval ipv6 nd ra-lifetime ipv6 nd reachable-time ipv6 nd home-agent-preference ipv6 nd home-agent-lifetime ipv6 nd router-preference Calls to atoi() and atol() are replaced with VTY_GET_INTEGER_RANGE() macro, command patterns are clarified and aliases of some commands are added for consistency. Other changes are listed below. * zebra/rtadv.c * ipv6_nd_ra_interval_msec(): resolve -Wsign-compare * ipv6_nd_ra_interval(): idem * rtadv_init(): update to list new aliases * doc/ipv6.texi: update to match current implementation
* zebra: use prefix_ipv6 in rtadv_prefixDenis Ovsienko2012-01-261-10/+9
| | | | | rtadv_prefix.prefix was casted to "struct prefix_ipv6" and had the same size, make it exactly this type to make the code a bit cleaner.
* zebra: clear host bits of ND RA prefix optionDenis Ovsienko2012-01-261-0/+2
| | | | | | | | | | | | | | | RFC4861 4.6.2. Prefix Information Prefix An IP address or a prefix of an IP address. The Prefix Length field contains the number of valid leading bits in the prefix. The bits in the prefix after the prefix length are reserved and MUST be initialized to zero by the sender and ignored by the receiver. * rtadv.c * ipv6_nd_prefix(): add missing call to apply_mask_ipv6() * no_ipv6_nd_prefix(): idem
* zebra: justify some IPv6 ND RA timers wrt RFCDenis Ovsienko2012-01-261-11/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | There was a regression introduced with the previous commit: "ipv6 nd home-agent-lifetime 1800000" appeared by default in every interface section of running-config, although this command is invalid in this context. Troubleshooting and bugfixing of the issue tracked out several bugs in router advertisement procedures, some of which are fixed in this commit. * zebra/interface.c * if_zebra_new_hook(): update to treat -1 as "uninitialized" * nd_dump_vty(): idem * zebra/rtadv.c * rtadv_send_packet(): update processing of "router lifetime" field, "home agent" option and "home agent lifetime" field to conform to RFC6275 better * ipv6_nd_ra_interval_msec(): update MaxRtrAdvInterval range check, make sure it never exceeds (initialized) AdvDefaultLifetime * ipv6_nd_ra_interval(): idem * ipv6_nd_ra_lifetime(): update AdvDefaultLifetime range check, make sure it never falls below MaxRtrAdvInterval * ipv6_nd_homeagent_lifetime(): update HomeAgentLifetime range check * no_ipv6_nd_ra_lifetime(): update to treat -1 as "uninitialized" * no_ipv6_nd_homeagent_lifetime(): idem * rtadv_config_write(): idem
* zebra: fix output of IPv6 ND RA optionsDenis Ovsienko2012-01-261-0/+14
| | | | | | | | | | The following options could be configured for an interface, but were never visible in the config text: ipv6 nd adv-interval-option ipv6 nd home-agent-preference ipv6 nd home-agent-lifetime ipv6 nd home-agent-config-flag
* zebra: include MTU option in RA on request (BZ#665)Denis Ovsienko2012-01-201-0/+54
| | | | | | | | | | | | This implements a new "ipv6 nd mtu <1-65535>" interface-level command. * doc/ipv6.texi: add description * zebra/rtadv.c * rtadv_send_packet(): send option type 5, when configured * ipv6_nd_mtu(): new VTY helper * no_ipv6_nd_mtu(): ditto * rtadv_config_write(): add new option * rtadv_init(): list new helpers
* zebra: fix IPv6 RA wrt interface removal (BZ#480)Denis Ovsienko2012-01-021-1/+1
|
* zebra: fix more warnings in rtadvStephen Hemminger2009-12-081-8/+5
| | | | | | | | | * zebra/rtadv.c * rtadv_free(): remove unused function * rtadv_recv_packet(): break up cast/dereference to avoid compiler type pun warning * rtadv_read(): initialize ifindex, because compiler can't figure out that it is okay
* zebra: Fix router advertisements for non-Ethernet link layer addressesDavid Ward2009-09-011-2/+16
| | | | | * rtadv.c: round up when calculating the link-layer address option length; add padding to the option if needed to end on an octet boundary
* RFC 4191 Default Router Preference support for router advertisementsChris Caputo2009-06-231-1/+63
| | | | | | | | | | | | | | | Adds "ipv6 nd router-preference (high|medium|low)" and "no ipv6 nd router-preference" interface commands. Files modified: doc/ipv6.texi zebra/interface.c zebra/interface.h zebra/rtadv.c zebra/rtadv.h Signed-off-by: Chris Caputo <ccaputo@alt.net>
* [cleanup] functions taking no args should be declared with void argsStephen Hemminger2009-06-121-1/+1
| | | | | Use Ansi-C prototypes rather than old K&R method of declaring function without arguments
* [cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger2009-06-121-10/+2
| | | | Simple conversion of XMALLOC/memset to XCALLOC
* [autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warningsPaul Jakma2007-05-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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().
* 2005-06-28 Paul Jakma <paul.jakma@sun.com>paul2005-06-281-26/+26
| | | | | | | * (global) Extern and static'ification, with related fixups of declarations, ensuring files include their own headers, etc. if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in list loop
* 2005-04-07 Paul Jakma <paul.jakma@sun.com>quagga_post_listloop_cleanuppaul2005-04-071-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
* 2005-03-25 Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>vincent2005-03-251-14/+355
| | | | | * interface.c, interface.h, rtadv.c, rtadv.h: extensions to Neighbor discovery for Mobile IPv6.
* 2005-01-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-01-041-2/+2
| | | | | | | | | | | | | | | | * configure.ac: Added test for broken CMSG_FIRSTHDR macro (relevant for Solaris 8 and unpatched Solaris 9, don't know whether other platforms are affected). * zebra.h: Define ZCMSG_FIRSTHDR appropriately based on whether config.h indicates HAVE_BROKEN_CMSG_FIRSTHDR (as determined by the configure test program). * sockopt.c: (getsockopt_cmsg_data) Use ZCMSG_FIRSTHDR instead of CMSG_FIRSTHDR. * rtadv.c: (rtadv_recv_packet,rtadv_send_packet) Use ZCMSG_FIRSTHDR instead of CMSG_FIRSTHDR. * ripd.c: (rip_recvmsg) Use ZCMSG_FIRSTHDR instead of CMSG_FIRSTHDR. * ripngd.c: (ripng_recv_packet) Use ZCMSG_FIRSTHDR instead of CMSG_FIRSTHDR.
* 2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-071-2/+2
| | | | * *.c: Change level of debug messages to LOG_DEBUG.
* 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-201-7/+7
| | | | | * global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
* Fix warnings. Didn't even look at files not compiled in Linux though.hasso2004-10-071-2/+2
|
* Compiler warnings fixes.hasso2004-09-261-1/+1
|
* Remove usage of evil list and listnode typedefs.hasso2004-09-231-6/+6
|
* Include padding in control message length.gdt2004-08-111-1/+1
| | | | Inspired by netbsd:src/usr.sbin/rtadvd/rtadvd.c (from KAME).
* 2004-08-11 Greg Troxel <gdt@fnord.ir.bbn.com>gdt2004-08-111-20/+20
| | | | | | | * rtadv.c (rtadv_send_packet): Allocate space for control messages more carefully; it was wrong on NetBSD/sparc where CMSG alignment is to 8 bytes instead of 4, and overwriting the address. Use the provided macros for determining lengths.
* Add extra padding in cmsgdata buffer; there wasn't enough ongdt2004-08-111-1/+18
| | | | | | | | NetBSD/sparc, resulting in overwriting the address. Add code to check if overwriting is happening, at least for now. Set msg_flags to MSG_DONTROUTE; they had been stack garbage.
* Router advertisement cleanup. Removed compatibility command because it'shasso2004-05-181-78/+191
| | | | | | very annoying to have both obsolete "prefix-advertisement" and "prefix" in completion. We will break configuration anyway with secondary cleanup, so just remember mention it in release notes.
* Many warning fixes from PC Drew ([quagga-dev 940]) and removing using PAGERhasso2004-03-041-0/+4
| | | | from vtysh ([quagga-dev 932]).
* change perror to zlog_errgdt2004-01-061-2/+5
|
* reorder includes to avoid warning.gdt2003-12-031-1/+1
| | | | fixes rest of bug #62
* 2003-08-27 Jay Fenlason <fenlason@redhat.com>paul2003-08-271-0/+1
| | | | | | | * bgpd/bgp_routemap.c: attr->med is type u_in32_t, should be compared with UINT32_MAX * ospfd/ospfd.c: remove redundant assert * zebra/rtadv.c: add missing include for zebra/rib.h
* 2003-06-15 Paul Jakma <paul@dishone.st>paul2003-06-151-5/+7
| | | | | | | | * lib/vty.{c,h}: Remove vty layer depending on a 'master' global, pass the thread master in explicitly to vty_init. Sort out some header dependency problems with lib/command.h * zebra/: Move globals to struct zebrad. Update vty_init(). * (.*)/\1_main.c: update call to vty_init().
* 2003-06-07 Paul Jakma <paul@dishone.st>paul2003-06-071-3/+0
| | | | | | | | | | | | | | * (zebra/rtadvc.): can not set checksum for ICMPV6, see: From: Jun-ichiro itojun Hagino <itojun@iijlab.net> Subject: [zebra 11052] setsockopt(IPV6_CHECKSUM) does not work for ICMPv6 socket setsockopt(IPV6_CHECKSUM) does not work for ICMPv6 socket. RFC2292 may not be clear enough about it (it talks about raw socket and ICMPv6 socket mixed up), but the next revision (draft-ietf-ipngwg-rfc2292bis-02.txt) is very clear about it. > An attempt to set IPV6_CHECKSUM for an ICMPv6 socket will fail.
* 2003-06-04 Paul Jakma <paul@dishone.st>paul2003-06-041-1/+12
| | | | * Merge of zebra privileges
* Initial revisionpaul2002-12-131-0/+1112