]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years agolib, zebra: add "vrf_id" into the "struct interface"
Feng Lu [Fri, 22 May 2015 09:39:57 +0000 (11:39 +0200)]
lib, zebra: add "vrf_id" into the "struct interface"

Later, an interface will belong to a specific VRF. Now we add a
property "vrf_id" to the "struct interface", and keep it as the
default value 0.

This property is shown when displaying interfaces information.
It is also added in some logs.

This is just the preparation to move the interace list into the
"struct vrf". The main logic is not changed.

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>
Conflicts:
lib/if.c
zebra/interface.c

8 years agolib, zebra: move "struct vrf" to be a lib module
Feng Lu [Fri, 22 May 2015 09:39:56 +0000 (11:39 +0200)]
lib, zebra: move "struct vrf" to be a lib module

Previously "struct vrf" is defined locally in zebra. Now it is moved
to be a lib module.

This is the first step to support multi-VRF in quagga. The
implementation is splitted into small patches for the purpose of
easy review.

* lib:
    "struct vrf" with basic members is defined in vrf.c. The member
    "void *info" is for user data.

    Some basic functions are defined in vrf.c for adding/deleting/
    looking up a VRF, scanning the VRF table and initializing the
    VRF module.

    The type "vrf_id_t" is defined specificly for VRF ID.

* zebra:
    The previous "struct vrf" is re-defined as "struct zebra_vrf";
    and previous "vrf" variables are renamed to "zvrf".

    The previous "struct vrf" related functions are removed from
    zbera_rib.c. New functions are defined to maintain the new
    "struct zebra_vrf".

    The names vrf_xxx are reserved for the functions in VRF module.
    So:
    - the previous vrf_table() are renamed to zebra_vrf_table();
    - the previous vrf_static_table() are renamed to
      zebra_vrf_static_table().

    The main logic is not changed.

    BTW: Add a statement to zebra_snmp.c telling that the SNMP is
         running only for the MIBs in the default VRF.

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>
Conflicts:
lib/Makefile.am
zebra/zebra_rib.c
zebra/zebra_vty.c

Conflicts:
lib/Makefile.am
lib/memtypes.c
zebra/rib.h
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_rnh.h
zebra/zebra_vty.c

8 years agoDeactivate BGP peer via "no neighbor x.x.x.x activate" removes other config
Daniel Walton [Thu, 29 Oct 2015 20:33:30 +0000 (20:33 +0000)]
Deactivate BGP peer via "no neighbor x.x.x.x activate" removes other config

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-6281

8 years agoDebian: Track dependencies so that rebuilds can work right
Donald Sharp [Thu, 22 Oct 2015 00:40:39 +0000 (17:40 -0700)]
Debian: Track dependencies so that rebuilds can work right

Not the debian way, I know.  But cause the debian build to create
and follow dependencies.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoBGP: Do appropriate cleanup on receipt of redistribute update
vivek [Thu, 29 Oct 2015 17:30:45 +0000 (10:30 -0700)]
BGP: Do appropriate cleanup on receipt of redistribute update

When there is a change to a redistributed route, either an attribute
such as the metric or the route type itself has changed, protocol clients
receive an update of the route instead of a delete and add as a result
of an earlier optimization. The update needs to be handled as an implicit
delete for any existing redistributed route, especially to handle change
in route type.

Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-7578
Reviewed By: CCR-3718
Testing Done: Manual verification
Related-to: CM-6768
8 years agoBGP: Check for duplicate and overlapping listen ranges
vivek [Thu, 29 Oct 2015 16:41:23 +0000 (09:41 -0700)]
BGP: Check for duplicate and overlapping listen ranges

When configuring listen ranges for allowing dynamic BGP neighbors,
ensure that there are no duplicate or overlapping ones. This is
necessary because at the time of handling an incoming connection,
the first range that matches the source of the connection (and hence,
its peer-group parameters) will be used.

Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Atul Patel <atul@cumulusnetworks.com>
Ticket: CM-5153
Reviewed By: CCR-3714
Testing Done: Manual verification

8 years agoBGP: Display the interface name used to resolve a nexthop.
vivek [Thu, 29 Oct 2015 16:34:47 +0000 (09:34 -0700)]
BGP: Display the interface name used to resolve a nexthop.

Display the interface name used to resolve a nexthop instead of just
the ifIdx. This is already done for many cases, but was missing for
one scenario.

Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-6888
Reviewed By: CCR-3705
Testing Done: Manual verification

This is an import of patch bgpd-show-ifname-for-nht.patch from 2.5-br.

8 years agolib: Memory reporting fails over 2GB
Donald Sharp [Wed, 28 Oct 2015 23:59:30 +0000 (19:59 -0400)]
lib: Memory reporting fails over 2GB

Ticket: CM-8015
Reviewed by: CCR-3717
Testing: See bug

The old style mallinfo() function uses an 'int' to
report memory usage data to the program.  Unfortunately
modern architectures can chew through 2gb of memory like a
buzz saw hitting some warm butter, especially in the case
of a memory leak or memory fragmentation.

When a daemon uses more than 2gb of memory, just indicate it's
gotten large and we don't know anymore.

Pre-change behavior:
Robot-1# show memory
System allocator statistics:
Total heap allocated: 16777216 TiB
Holding block headers: 1288 KiB
Used small blocks: 0 bytes
Used ordinary blocks: 535 MiB
Free small blocks: 768 bytes
Free ordinary blocks: 16777216 TiB
Ordinary blocks: 266107
Small blocks: 24
Holding blocks: 2

Post-change behavior:
Robot-1# show memory
System allocator statistics:
  Total heap allocated:  1572 KiB
  Holding block headers: > 2GB
  Used small blocks:     0 bytes
  Used ordinary blocks:  1443 KiB
  Free small blocks:     32 bytes
  Free ordinary blocks:  129 KiB
  Ordinary blocks:       2
  Small blocks:          1
  Holding blocks:        2

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoBGP: route-map scale
Daniel Walton [Wed, 28 Oct 2015 19:12:24 +0000 (19:12 +0000)]
BGP: route-map scale
- use a hash to store the route-maps
- reduce the number of route_map_lookup_by_name() calls in BGP

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7407

8 years agoBGP: peer-group restrictions should be relaxed, update-groups determine outbound...
Daniel Walton [Wed, 28 Oct 2015 01:54:48 +0000 (01:54 +0000)]
BGP: peer-group restrictions should be relaxed, update-groups determine outbound policy anyway

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Ticket: CM-7933

8 years agolib: zlog_hexdump actually output printable ascii characters
Donald Sharp [Sat, 24 Oct 2015 00:10:51 +0000 (17:10 -0700)]
lib: zlog_hexdump actually output printable ascii characters

We are getting this output from zlog_hexdump:

0x00007fffdd1f9648: 45 00 00 94 ee 63 40 00 45....6340.
0x00007fffdd1f9650: 03 00 ff 0a 14 00 0f fd ........
0x00007fffdd1f9658: e8 01 01 01 45 00 00 80 ....45...
0x00007fffdd1f9660: ee 63 40 00 0a 11 75 0a .6340...75.
0x00007fffdd1f9668: 14 00 0f fd e8 01 01 01 ........
0x00007fffdd1f9670: 10 e1 10 e1 00 6c d0 54 .....6c.54
0x00007fffdd1f9678: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9680: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9688: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9690: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f9698: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96a0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96a8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96b0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96b8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96c0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96c8: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96d0: 00 00 00 00 00 00 00 00 ........
0x00007fffdd1f96d8: 00 00 00 00             ....

As you can see the ascii dump on the right is wrong and not lined
up correctly.  This commit fixes this issue:

0x00007ffcf046f228: 45 00 00 58 c6 36 40 00 E..X.6@.
0x00007ffcf046f230: 03 00 ff 73 14 00 0f fd ...s....
0x00007ffcf046f238: e8 01 01 01 45 00 00 44 ....E..D
0x00007ffcf046f240: c6 36 40 00 0a 11 9d 73 .6@....s
0x00007ffcf046f248: 14 00 0f fd e8 01 01 01 ........
0x00007ffcf046f250: 10 e1 10 e1 00 30 d0 cc .....0..
0x00007ffcf046f258: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f260: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f268: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f270: 00 00 00 00 00 00 00 00 ........
0x00007ffcf046f278: 00 00 00 00 00 00 00 00 ........

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Sat, 24 Oct 2015 00:14:01 +0000 (17:14 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoQuagga needs better debugs in lib/sockunion.c
Daniel Walton [Fri, 23 Oct 2015 17:36:55 +0000 (17:36 +0000)]
Quagga needs better debugs in lib/sockunion.c

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Ticket: CM-7233

8 years agoUse a hash to store BGP peer structures
Daniel Walton [Fri, 23 Oct 2015 17:34:50 +0000 (17:34 +0000)]
Use a hash to store BGP peer structures

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-5370

8 years agoAddition of missing zebra command descriptions
radhika [Thu, 22 Oct 2015 17:14:00 +0000 (10:14 -0700)]
Addition of missing zebra command descriptions

Ticket: CM-7456
Reviewed By: CCR-3528
Testing Done: Unit

Porting of the patch zebra-fix-cmd-type-desc-log.patch from 2.5 branch

Last few Zebra message command types defined were not added to the command type description table used for getting logging strings. This was causing the logs to display "unknown command type" instead of the actual command type. So, added all the missing zebra commands to the command type description table. Also, changed the order of the description table to match with the actual command type definition order.

8 years agobgpd: Fix bgp_btoa to compile
Donald Sharp [Wed, 21 Oct 2015 14:00:47 +0000 (10:00 -0400)]
bgpd: Fix bgp_btoa to compile

bgp_btoa was abandoned at some point in time in the past.
This commit gets it to compile and to be added to /usr/bin.

At this point in time no work has done for 'correctness' of execution

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoBGP: "remote-as internal" need not be displayed if peer is member of
Daniel Walton [Wed, 21 Oct 2015 12:28:28 +0000 (12:28 +0000)]
BGP: "remote-as internal" need not be displayed if peer is member of
peer-group

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7744

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Wed, 21 Oct 2015 05:41:30 +0000 (22:41 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoZebra: On a link down, schedule static routes only.
vivek [Wed, 21 Oct 2015 05:37:32 +0000 (22:37 -0700)]
Zebra: On a link down, schedule static routes only.

Ticket: CM-7420
Reviewed By: Vivek, Donald
Testing Done: UT, verification of the fix + ospf and bgp smoke

On a link delete/down event, schedule only the prefixes which have a
static RIB too.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoFix location of some of the commands in integrated config
vivek [Wed, 21 Oct 2015 05:21:39 +0000 (22:21 -0700)]
Fix location of some of the commands in integrated config

Ticket:
Reviewed By: CCR-3509
Testing Done: bgpsmoke, enhe, tests with/without this change

When saving an integrated config file, certain commands such as
"ipv6 protocol", "ip nht route-map" etc. ended up with a very
different group of commands making it hard to look for them. This
fixes the command grouping so that related commands are located
together.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
8 years agoQuagga: Display useful info when doing service quagga status
vivek [Wed, 21 Oct 2015 05:09:58 +0000 (22:09 -0700)]
Quagga: Display useful info when doing service quagga status

Ticket: CM-7132
Reviewed By: CCR-3461
Testing Done: the usual

Today, 'service quagga status' merely sets the return code and nothing
more. Like other services, it'd be good to print some useful output as
well.

Example output:
    cumulus@top1$ sudo service quagga status ospfd
    [ ok ] ospfd-1 is running.
    [ ok ] ospfd-2 is running.
    cumulus@top1$ sudo service quagga status
    [ ok ] zebra is running.
    [ ok ] ospfd-1 is running.
    [ ok ] ospfd-2 is running.
    [ ok ] ospf6d is running.
    cumulus@top1$ sudo service quagga status
    [ ok ] zebra is running.
    [ ok ] ospfd-1 is running.
    [FAIL] ospfd-2 is not running ... failed!
    [ ok ] ospf6d is running.
    cumulus@top1$ echo $?
    1
    cumulus@top1$

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoBGP: Do not get out of bgp_start() if peer's IP address isn't known
vivek [Wed, 21 Oct 2015 05:01:49 +0000 (22:01 -0700)]
BGP: Do not get out of bgp_start() if peer's IP address isn't known

Ticket: CM-7140
Reviewed By: CCR-3412
Testing Done: bgpsmoke, Atul verified fix

BGP Unnumbered and Interface based peering can interact in some strange
ways. One of them is when there's an IPv4 address on a link on which
BGP Unnumbered session is beng attempted, but the IPv4 address is not
a /30 or /31. As per the bug report, we end up attempting to start the
BGP FSM on receiving a notification that an IPv4 address is present on
an interface. To avoid attempting to go past BGP's start state in the
absence of a valid peer address is the right thing to do. And this
simple patch does just that.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
8 years agoZebra: Redistribute replace handling corner cases
vivek [Wed, 21 Oct 2015 04:52:52 +0000 (21:52 -0700)]
Zebra: Redistribute replace handling corner cases

Ticket: CM-7309
Reviewed By: CCR-3448
Testing Done: passing route_ospf_route_thrash, the new redist test

When zebra was modified to have redistributed routes follow a replace
logic instead of the del-add, one case was missed. When a route is
replaced with a change only to the source protocol (say from static
to bgp), its possible that the new source protocol is not selected
for redistribution by a client. Since we did not delete the route
initially, if the add is not allowed for the new source protocol
for a client, we need to send a delete of that redistributed route.
This is what the patch fixes.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoZebra: Make redistribute do replace instead of del/add for better convergence
vivek [Wed, 21 Oct 2015 04:38:38 +0000 (21:38 -0700)]
Zebra: Make redistribute do replace instead of del/add for better convergence

Ticket: CM-6768
Reviewed By: CCR-3207
Testing Done: bgpsmoke, smoke, topo to create failure

Redistributing routes goes through a del/add cycle whenever a redistributed
is updated. This del/add cycle causes disruption by causing traffic loss
for brief/long periods of time(6-8 s in case of OSPF). The modifications in
this patch remove the del/add cycle to ensure that this disruption doesn't
happen.

Also fixed sending no forwarding address when announcing IPv4 routes with IPv6
nexthops, and sending nexthop only when there is a single path.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoAdd zlog_hexdump() for debugging
Daniel Walton [Wed, 21 Oct 2015 01:46:55 +0000 (01:46 +0000)]
Add zlog_hexdump() for debugging

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7931

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Vipin Kumar [Tue, 20 Oct 2015 22:19:55 +0000 (15:19 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoOSPF needs to handle the previously added redist update
Vipin Kumar [Tue, 20 Oct 2015 22:17:07 +0000 (15:17 -0700)]
OSPF needs to handle the previously added redist update

Ticket: CM-7388
Reviewed By: Donald, Vivek
Testing Done: Cherry picking from 2.5.4, no testing on 3.0 yet

OSPF needs to handle the previously added redist update/raplace semantics.
Update has no new message type, it comes as ADD message.

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Daniel Walton [Tue, 20 Oct 2015 22:14:24 +0000 (22:14 +0000)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Vipin Kumar [Tue, 20 Oct 2015 22:14:06 +0000 (15:14 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoBGP: crash from not NULLing freed pointers
Daniel Walton [Tue, 20 Oct 2015 22:13:20 +0000 (22:13 +0000)]
BGP: crash from not NULLing freed pointers

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7926

There was a crash from not NULLing out peer->hostname but I cleaned
up a bunch of other suspect ones as well.

8 years agoBGP: crash in list_delete_all_node when shutting down BGP
Daniel Walton [Tue, 20 Oct 2015 22:11:01 +0000 (22:11 +0000)]
BGP: crash in list_delete_all_node when shutting down BGP

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7904

8 years agoLower the default OSPF spf timers to '0 50 5000'
Daniel Walton [Tue, 20 Oct 2015 22:09:24 +0000 (22:09 +0000)]
Lower the default OSPF spf timers to '0 50 5000'

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7901

8 years agoLower BGP's default keepalive/holdtime to 3s/9s
Daniel Walton [Tue, 20 Oct 2015 22:07:54 +0000 (22:07 +0000)]
Lower BGP's default keepalive/holdtime to 3s/9s

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7900

8 years agoRemove BGP_ERROR_START_TIMER, it was no longer used
Daniel Walton [Tue, 20 Oct 2015 22:06:52 +0000 (22:06 +0000)]
Remove BGP_ERROR_START_TIMER, it was no longer used

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7903

8 years agoPrint an error when user tries to change a previously configured area.
Vipin Kumar [Tue, 20 Oct 2015 22:06:25 +0000 (15:06 -0700)]
Print an error when user tries to change a previously configured area.

Ticket: CM-5673
Reviewed By: Donald
Testing Done:  Cherry picking from 2.5.4, no testing in 3.0 yet.

8 years agoEnable "bgp log-neighbor-changes" by default
Daniel Walton [Tue, 20 Oct 2015 22:05:23 +0000 (22:05 +0000)]
Enable "bgp log-neighbor-changes" by default

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7899

8 years agoEnable "bgp default show-hostname" by default
Daniel Walton [Tue, 20 Oct 2015 22:03:37 +0000 (22:03 +0000)]
Enable "bgp default show-hostname" by default

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7902

8 years agoDisplay the BGP ipv4 unicast configuration under "address-family ipv4 unicast".
Daniel Walton [Tue, 20 Oct 2015 22:00:40 +0000 (22:00 +0000)]
Display the BGP ipv4 unicast configuration under "address-family ipv4 unicast".

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-6739

Before
router bgp 10
 bgp router-id 10.1.1.1
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 network 9.9.9.9/32
 neighbor 10.1.1.2 remote-as 10
 neighbor 10.1.1.2 shutdown
 neighbor 10.1.1.2 update-source lo
 neighbor 10.1.1.2 advertisement-interval 1
 neighbor 10.1.1.2 timers connect 10
 neighbor 10.1.1.2 activate
 neighbor 10.1.1.2 next-hop-self
 neighbor 10.1.1.2 route-map BAR in
 neighbor 10.1.1.2 route-map FOO out
 neighbor 20.1.2.2 remote-as 20
 neighbor 20.1.2.2 shutdown
 neighbor 20.1.2.2 advertisement-interval 1
 neighbor 20.1.2.2 timers connect 10
 neighbor 20.1.2.2 activate
 neighbor 20.1.2.2 route-map HAA in
 neighbor 20.1.2.2 route-map BOO out
!
 address-family ipv6
 network 2001:1:1:1::/64
 exit-address-family
!

After
!
router bgp 10
 bgp router-id 10.1.1.1
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 no bgp network import-check
 neighbor 10.1.1.2 remote-as 10
 neighbor 10.1.1.2 shutdown
 neighbor 10.1.1.2 update-source lo
 neighbor 10.1.1.2 advertisement-interval 1
 neighbor 10.1.1.2 timers connect 10
 neighbor 20.1.2.2 remote-as 20
 neighbor 20.1.2.2 shutdown
 neighbor 20.1.2.2 advertisement-interval 1
 neighbor 20.1.2.2 timers connect 10
!
 address-family ipv4 unicast
  network 9.9.9.9/32
  neighbor 10.1.1.2 activate
  neighbor 10.1.1.2 next-hop-self
  neighbor 10.1.1.2 route-map BAR in
  neighbor 10.1.1.2 route-map FOO out
  neighbor 20.1.2.2 activate
  neighbor 20.1.2.2 route-map HAA in
  neighbor 20.1.2.2 route-map BOO out
 exit-address-family
!
 address-family ipv6 unicast
  network 2001:1:1:1::/64
 exit-address-family
!

8 years agoEnable "bgp network import-check exact" by default. Without this it is
Daniel Walton [Tue, 20 Oct 2015 21:57:09 +0000 (21:57 +0000)]
Enable "bgp network import-check exact" by default. Without this it is
very easy to blackhole routes.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-6649

8 years agoDo not allow a timers connect of 0, this can hammer the CPU
Daniel Walton [Tue, 20 Oct 2015 21:55:37 +0000 (21:55 +0000)]
Do not allow a timers connect of 0, this can hammer the CPU

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7875

8 years agoRemove BGP's asorig timer, it is no longer used
Daniel Walton [Tue, 20 Oct 2015 21:54:07 +0000 (21:54 +0000)]
Remove BGP's asorig timer, it is no longer used

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoLower the default 'timers connect' in BGP to 10 seconds
Daniel Walton [Tue, 20 Oct 2015 21:53:10 +0000 (21:53 +0000)]
Lower the default 'timers connect' in BGP to 10 seconds

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Daniel Walton [Tue, 20 Oct 2015 21:51:31 +0000 (21:51 +0000)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoLower the default MRAI timer for EBGP peers to zero
Daniel Walton [Tue, 20 Oct 2015 21:51:00 +0000 (21:51 +0000)]
Lower the default MRAI timer for EBGP peers to zero

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Tue, 20 Oct 2015 21:50:50 +0000 (14:50 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoLower the default MRAI timer for iBGP peers to 0
Daniel Walton [Tue, 20 Oct 2015 21:50:03 +0000 (21:50 +0000)]
Lower the default MRAI timer for iBGP peers to 0

8 years agoZebra: Fix setting source for 5549-learnt routes via ip protocol
vivek [Tue, 20 Oct 2015 21:32:12 +0000 (14:32 -0700)]
Zebra: Fix setting source for 5549-learnt routes via ip protocol

Ticket: CM-6854
Reviewed By: CCR-3297
Testing Done: bgpsmoke, bgpclos to verify setting source (in 2.5-br)

Two pieces prevented the user from specifying a route-map with set src on
IPv4 routes learnt via BGP's RFC 5549 model (v4 prefix with v6 nexthop):
   - There was code missing in the section specific to 5549 in setting
     the src in the netlink message
   - During RIB processing, route-map processing was ignored when the NH
     was v6 and the route itself was v4.

As per the code, all route-map processing that uses nexthop validates the
NH type before applying the route-map and so there should be no errors
as a consequence of relaxing bullet 2 above.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoquagga crashes on 'show run bgp'
Daniel Walton [Fri, 16 Oct 2015 20:53:03 +0000 (20:53 +0000)]
quagga crashes on 'show run bgp'

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoquagga errors parsing a valid config
Daniel Walton [Fri, 16 Oct 2015 20:51:38 +0000 (20:51 +0000)]
quagga errors parsing a valid config

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: fix using of two pointers for struct thread_master *
Donald Sharp [Wed, 14 Oct 2015 12:50:39 +0000 (08:50 -0400)]
bgpd: fix using of two pointers for struct thread_master *

Ticket: CM-7861
Reviewed by: CCR-3651
Testing: See bug

bgp is using both bm->master and master pointers interchangebly
for thread manipulation.  Since they are the same thing consolidate
to one pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: backout change of bm->master and master
Donald Sharp [Tue, 13 Oct 2015 20:00:55 +0000 (13:00 -0700)]
bgpd: backout change of bm->master and master

Upstream does wanted the reverse of what was done
in this patch.  Back out the patch.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: fix vty.c and smux.c static variable clash
Donald Sharp [Tue, 13 Oct 2015 18:37:15 +0000 (11:37 -0700)]
lib: fix vty.c and smux.c static variable clash

Both vty.c and smux.c declare:
static struct thread_master *master

This is not a good thing because they are both linked into
the same library.  If you want to pass different struct thread_master
pointers into smux.c and vty.c you will probably not get the result
you were looking for

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoFix for IPv6 OSPF BFD session staying down when ifdown/ifup on logical interfaces
radhika [Fri, 9 Oct 2015 20:44:32 +0000 (13:44 -0700)]
Fix for IPv6 OSPF BFD session staying down when ifdown/ifup on logical interfaces

Ticket: CM-7649
Reviewed By: Donald
Testing Done:

This is porting of the patch, ospf6d-bfd-fix-dereg-miss.patch from br2.5.

 Issue: The IPv6 OSPF BFD sessions stay down after ifdown/ifup on logical interfaces. This problem doesn’t exist for BFD sessions created by BGP and IPv4 OSPF.

 Root cause: When the interface is brought down the IPv6 neighbors discovered on that interface are deleted. This deletion happens without first bringing down the neighbor and the BFD deregistration happens only when the neighbor state changes. This leaves an orphaned BFD session in PTM. Also, the BFD session socket that is bound to the interface that was brought down loses connection. The socket has to be rebound to the interface when it comes up. This problem will not happen if the client deleted the sessions and re-adds it when interface goes down and come up. IPv4 OSPF and BGP work exactly like that.

 Fix: Added the BFD deregistration code to IPv6 OSPF neighbor delete.

8 years ago Fix Quagga ptm status per interface to show more meaningful status
radhika [Fri, 9 Oct 2015 18:18:09 +0000 (11:18 -0700)]
 Fix Quagga ptm status per interface to show more meaningful status

Ticket: CM-6812
Reviewed By: Donald
Testing Done:

Double commit of 2119c8fccda5f1497820009c6f1f82eda3c8d0f1 from 2.5br to master

 In Quagga, the ptm status is shown as pass for all the interfaces that PTM is not tracking. When ptm is enabled in Quagga all the interfaces are initialized as pass and changed to fail/pass when ptm cable check updates are received. For all the interfaces for which no status was received from PTM remain at pass status. Interface show in quagga indicates wrong status and it should be n/a for all the untracked interfaces. To fix the problem introduced a third state “unknown” and this is default ptm status for all the interfaces. The ptm status is updated accordingly to pass/fail when the updates are received from PTM. Also, reset all interface ptm status to unknown when the connection with ptm is lost and the status gets updated when the connection with PTM is re-established.

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Wed, 7 Oct 2015 16:32:41 +0000 (09:32 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoQuagga: Fix some more compile warnings
Donald Sharp [Wed, 7 Oct 2015 16:27:09 +0000 (09:27 -0700)]
Quagga: Fix some more compile warnings

The debian build process under Jessie has a 'newer' gcc
compiler that is more stringent on warnings returned.
This commit cleans up some more warnings returned.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago'service quagga reload' breaks with four top level keywords
Daniel Walton [Thu, 1 Oct 2015 18:23:00 +0000 (11:23 -0700)]
'service quagga reload' breaks with four top level keywords

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Ticket: CM-7757
Reviewed By: Donald and Vivek

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Wed, 30 Sep 2015 22:08:26 +0000 (15:08 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agobgpd: Fix neighbor command with internal or external keyword and interface
Donald Sharp [Wed, 30 Sep 2015 22:05:19 +0000 (15:05 -0700)]
bgpd: Fix neighbor command with internal or external keyword and interface

Ticket: CM-7737
Reviewed-by: CCR-3611
Testing: See bug

When configuring a bgp peer that already has some config hung off of it,
such as 'interface v6only' and then configuring remote-as internal/external
will not cause the config to be taken.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoquagga: Additional centos 6 -enable-werror fixes
Donald Sharp [Tue, 29 Sep 2015 13:19:30 +0000 (09:19 -0400)]
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>
9 years agovtysh: Fix Quagga.conf file read in.
Donald Sharp [Mon, 28 Sep 2015 20:17:36 +0000 (13:17 -0700)]
vtysh: Fix Quagga.conf file read in.

There exists a sequence of cli commands that are successfully read in by bgpd.conf, but
not by a consolidated Quagga.conf.

This issue stems from the fact that the consolidated config file attempts to match the
current node + 1 node up the tree, while the individual config file searches for matches
all the way up the tree.

Quagga.conf read-in relies on vtysh_cmd.c command parsing which puts all nodes
at CONFIG_NODE and if a match is found CMD_SUCCESS_DAEMON is returned.  This signals to
the parser to call the appropriate daemon with the comamnd.

bgp as an example has three levels of config node's.  If you are reading in a config node
at the 3rd level(say address-family ipv6) then transition to another node under bgp it will
not work in Quagga.conf because the code only looked up one node and was at CONFIG_BGP when it failed
to find a match.

Ticket: CM-7625
Reviewed by: CCR-3591
Testing: See Bug

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoBGP: Fix source route type in redistributed route
vivek [Mon, 28 Sep 2015 19:27:17 +0000 (12:27 -0700)]
BGP: Fix source route type in redistributed route

Ticket: CM-7593
Reviewed By: CCR-3563
Testing Done: Manual verification of failed scenario (2.5-br)

When BGP receives an update to a redistributed route and the type of
the source has changed (e.g., from OSPF to static), the source route
type is not being updated in the RIB entry. This can lead to problems
such as the route being incorrectly deleted if redistribution for the
prior source is unconfigured.

Fix the code to update the source route type.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
9 years agoQuagga: Fix compile warnings for GCC4.9
Donald Sharp [Thu, 24 Sep 2015 23:57:36 +0000 (16:57 -0700)]
Quagga: Fix compile warnings for GCC4.9

As part of the debian build process for jessie we are seeing
some compile issues.  This addresses these issues

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agobgpd: fix using of two pointers for struct thread_master
Donald Sharp [Wed, 23 Sep 2015 19:41:33 +0000 (15:41 -0400)]
bgpd: fix using of two pointers for struct thread_master

bgp is using both bm->master and master pointers interchangebly
for thread manipulation.  Since they are the same thing consolidate
to one pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agolib: zclient.c remove extern struct thread_master *
Donald Sharp [Wed, 23 Sep 2015 20:26:56 +0000 (13:26 -0700)]
lib: zclient.c remove extern struct thread_master *

zclient.c depended upon link time inclusion of a
extern struct thread_master *master.  This is a violation of the
namespace of the calling daemon.  If a library needs the pointer
pass it in and save it for future use.

This code change also makes the zclient code consistent with
the other lib functions that need to schedule work on your behalf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agovtysh: Allow display of individual daemons configs
Donald Sharp [Tue, 22 Sep 2015 19:00:57 +0000 (12:00 -0700)]
vtysh: Allow display of individual daemons configs

When executing a 'show run' or 'write terminal' you see the
entire integrated config.  You have no way of knowing what an
individual daemon is going to write until after you do a write
of config to disk if you are not using an integrated configuration.
This change allows the end-user to do such a thing.

Ticket: CM-7597
Reviewed-by: CCR-3561
Testing: See Bug

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agogit: add (generated) cscope files to .gitignore
Donald Sharp [Tue, 22 Sep 2015 18:54:09 +0000 (11:54 -0700)]
git: add (generated) cscope files to .gitignore

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoZebra: Fix static NHT for multiple routes scenario
vivek [Mon, 21 Sep 2015 04:20:29 +0000 (21:20 -0700)]
Zebra: Fix static NHT for multiple routes scenario

Ticket: CM-7482
Reviewed By: CCR-3518
Testing Done: Manual verification (on 2.5-br)

When a static route has a nexthop change but the route is also learnt
through another protocol, ensure that the nexthop tracking code marks
the correct route entry (RIB) for processing.

This is a port of patch zebra-static-nht-fixes2.patch from 2.5-br.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
9 years agoBGP: Ensure default-originate works with update-groups
vivek [Mon, 21 Sep 2015 04:09:00 +0000 (21:09 -0700)]
BGP: Ensure default-originate works with update-groups

Ticket: CM-7113
Reviewed By: CCR-3458
Testing Done: Manual testing, failed test, bgpsmoke (on 2.5-br)

This is a port of patch bgpd-update-groups-fix-default-originate.patch
from 2.5-br.

Even though default origination is configured for a BGP neighbor through
"neighbor default-originate" or "peer-group default-originate", the neighbor
may sometimes not receive the default route in some situations. Change to
ensure update subgroups also differentiate on default-originate sent status.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
9 years agoBGP: "show ip bgp json" should return empty "routes : {}" if the table
Daniel Walton [Thu, 17 Sep 2015 14:54:20 +0000 (07:54 -0700)]
BGP: "show ip bgp json" should return empty "routes : {}" if the table
is empty

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7475
Reviewed By: Donald Sharp
Testing Done:

If the BGP table is empty, intead of returning

{'alert': 'No BGP network exists', 'routerId': '10.0.9.2',
'tableVersion': 180}

we should return

{'routerId': '10.0.9.2', 'routes': {}, 'tableVersion': 180}

This provides a more consistent json interface which is easier to script
against.

9 years ago'service quagga reload' should not dump so much output to the log file.
Daniel Walton [Thu, 17 Sep 2015 14:24:21 +0000 (07:24 -0700)]
'service quagga reload' should not dump so much output to the log file.
It should also check that quagga is running before attempting to do
any work.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7486
Reviewed By: Donald Sharp
Testing Done:

Verified that 'service quagga reload' exits cleanly if quagga is not
running.  Also verified that it produces a minimal amount of log output
by default.  The user can enable --debug in /etc/init.d/quagga if they
would like to enable debug output.

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Dinesh G Dutt [Wed, 16 Sep 2015 15:39:54 +0000 (08:39 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoRemove unused variable
Dinesh G Dutt [Wed, 16 Sep 2015 15:37:00 +0000 (08:37 -0700)]
Remove unused variable

Ticket:
Reviewed By:
Testing Done:

set src checkin had an unused variable. Fixed that.

9 years agoZebra: Add IPv6 protocol filtering support & Setting Src of IPv6 routes
Donald Sharp [Wed, 16 Sep 2015 12:30:57 +0000 (05:30 -0700)]
Zebra: Add IPv6 protocol filtering support & Setting Src of IPv6 routes

This Fix fixes Compile Issues associated with commit 0aabccc0a84

Ticket: None
Reviewed by: None
Testing: Compiles Now
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoWarn user in various max path edge cases
Donald Sharp [Wed, 16 Sep 2015 12:30:23 +0000 (05:30 -0700)]
Warn user in various max path edge cases

Ticket: CM-6680
Reviewed-by: CCR-3486
Testing: See bug

In these situations:
(A) user enters under bgp more 'maximum-paths' than zebra is compiled with
warn the user that there is a problem
(B) Zebra receives more maximum paths than what it can handle log the fact
that this happened

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoZebra: Add IPv6 protocol filtering support & Setting Src of IPv6 routes
Dinesh G Dutt [Wed, 16 Sep 2015 06:48:00 +0000 (23:48 -0700)]
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>
9 years agoBGP: Display the right reason code for session reset
Daniel Walton [Wed, 16 Sep 2015 02:14:06 +0000 (19:14 -0700)]
BGP: Display the right reason code for session reset

Ticket: CM-7439
Reviewed By: Donald Sharp
Testing Done:

If a session was reset due to a NOTIFICATION the "show ip bgp
neighbor" output would not display details on what the
notification actually was.  This patch changes that.  Example:

superm-redxp-05# show ip bgp neighbors 20.1.2.2
BGP neighbor is 20.1.2.2, remote AS 21, local AS 10, external link
[snip]
  Last reset 01:05:07, due to NOTIFICATION sent (OPEN Message Error/Bad Peer AS)

9 years agoquagga netlink buffer size increase
Donald Sharp [Fri, 11 Sep 2015 12:44:31 +0000 (05:44 -0700)]
quagga netlink buffer size increase

Ticket: CM-7380
Reviewed-by: CCR-3478
Testing: See Bug

This is a fix to allow the netlink buffer size to grow to a reasonable number
over the current 4mb choosen.  This number was choosen by running some
smoke tests that would fail and experimenting to find a number that worked
with those tests and then adding some headroom to that number.

This is a bit of a temporary fix due to timelines instead of the real fix
which is to write the code to properly recover from a netlink buffer overflow.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agobgpd: Exchange hostname capability and display hostnames in output
Daniel Walton [Fri, 11 Sep 2015 03:10:16 +0000 (20:10 -0700)]
bgpd: Exchange hostname capability and display hostnames in output

This patch adds a hostname capability. The node's hostname and
domainname are exchanged in the new capability and used in show command
outputs based on a knob enabled by the user. The hostname and domainname
can be a maximum of 64 chars long, each.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Ticket: CM-5660
Reviewed By: CCR-2563
Testing Done:

9 years agoFix arm compilation failures of sockunion_hash issues
Donald Sharp [Tue, 8 Sep 2015 23:18:30 +0000 (16:18 -0700)]
Fix arm compilation failures of sockunion_hash issues

Compiling for the arm platform with -Werror for the 9196caf commit
causes it to fail.  This commit addresses this issue

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Tue, 8 Sep 2015 20:30:13 +0000 (13:30 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoFix arm compilation failures of sockunion_hash issues
Donald Sharp [Tue, 8 Sep 2015 20:26:57 +0000 (13:26 -0700)]
Fix arm compilation failures of sockunion_hash issues

Compiling for the arm platform with -Werror for the 9196caf commit
causes it to fail.  This commit addresses this issue

9 years agolib: fix "sockunion: add hash function" for BSD (9196caf)
David Lamparter [Wed, 20 May 2015 20:34:56 +0000 (22:34 +0200)]
lib: fix "sockunion: add hash function" for BSD (9196caf)

The sockunion_hash() function uses s6_addr32, which is not defined on
BSD systems.  (It only works on glibc because we set _GNU_SOURCE)

ripngd/ripng_nexthop.h already contains a workaround for this.  Bump
workaround to prefix.h so it's available everywhere.

Reported-by: NetDEF CI System <mwinter@netdef.org>
Fixes: 9196caf ("sockunion: add hash function")
Cc: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agosockunion: add hash function
Timo Teräs [Wed, 29 Apr 2015 06:43:05 +0000 (09:43 +0300)]
sockunion: add hash function

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agoOSPFv3: Do not display default network type.
vivek [Tue, 8 Sep 2015 18:25:57 +0000 (11:25 -0700)]
OSPFv3: Do not display default network type.

Ticket: CM-3917
Reviewed By: CCR-3454
Testing Done: Manual verification

9 years agoFix bgp_exit crash
Donald Sharp [Tue, 8 Sep 2015 13:24:21 +0000 (06:24 -0700)]
Fix bgp_exit crash

Ticket: CM-7358
Reviewed-by: CCR-3462
Testing: See bug

9 years agoBgpd: aspath json memory leak fix
Donald Sharp [Thu, 3 Sep 2015 18:26:36 +0000 (11:26 -0700)]
Bgpd: aspath json memory leak fix

Ticket: CM-6790
Reviewed by: CCR-3453
Testing: See bug

This code change fixes these things:

(a) Fixes an assert followed by an if statement
(B) Fixes the memory leak in aspath->json

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Thu, 3 Sep 2015 13:50:41 +0000 (06:50 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoFix neighbor coming up without an as specified
Donald Sharp [Thu, 3 Sep 2015 13:50:16 +0000 (06:50 -0700)]
Fix neighbor coming up without an as specified

Ticket: CM-7012
Reviwed by: CCR-3451
Testing: See bug

When you specify a neighbor <interface> <something>
and don't specify a remote-as the neighbor relationship
will still come up with ipv6 unnumbered if you have
RA configured on the interface.

9 years agoZebra: Fix log related to delete notification for IPv6 route
vivek [Wed, 2 Sep 2015 23:43:33 +0000 (16:43 -0700)]
Zebra: Fix log related to delete notification for IPv6 route

Ticket: CM-7204
Reviewed By: CCR-3449
Testing Done: Verified the log manually

Port of patch zebra-fix-ipv6-route-delete-log.patch from 2.5-br

9 years agoMultiple redistribute commands with different metric fail
Donald Sharp [Wed, 2 Sep 2015 14:36:50 +0000 (07:36 -0700)]
Multiple redistribute commands with different metric fail

Ticket: CM-7339
Reviewed-by: CCR-3446
Testing: Test Suite passes now

The bgp_redistribute_metric_set function was not
taking into account the table # for deciding
what metric to set.

9 years agoFix some more memory issues in Quagga
Donald Sharp [Wed, 2 Sep 2015 12:19:44 +0000 (05:19 -0700)]
Fix some more memory issues in Quagga

Ticket: CM-4109
Reviewed-by: CCR-3414
Testing: See bug

Fixup of these memory issues:

(A) peer->clear_node_queue was accidently removed.  Add back in.
(B) Clean up bm->process_main_queue and bm->process_rsclient_queue initialization
(C) Some memory leaks
(D) Clean up unused threads

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Tue, 1 Sep 2015 19:47:04 +0000 (12:47 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoFix dryrun capability to output line # of failed read
Donald Sharp [Tue, 1 Sep 2015 19:46:08 +0000 (12:46 -0700)]
Fix dryrun capability to output line # of failed read

Ticket: CM-6856
Reviewed by: CCR-3431
Testing: See bug

9 years agolib: Improve error reporting from broken config files
Steve Hill [Tue, 28 Jul 2009 20:36:14 +0000 (16:36 -0400)]
lib: Improve error reporting from broken config files

* command.h: (config_from_file) Add variable to interface for line
      number reporting.
    * command.c: (config_from_file) Set & increment 'line_num' while parsing.
    * vty.c: (vty_read_file) Report parse errors in the correct order to
      stderr, with added line numbers.

Conflicts:
lib/command.c
lib/vty.c

Integrated in changes made to continue loading code even after failure
to read a line in properly as part of this cherry-pick

9 years ago'service quagga reload' is no longer experimental
Daniel Walton [Tue, 1 Sep 2015 16:58:50 +0000 (09:58 -0700)]
'service quagga reload' is no longer experimental

Ticket: CM-7305
Reviewed By: sharpd@cumulusnetworks.co
Testing Done:

9 years agoSupport of BFD status in Quagga
radhika [Mon, 31 Aug 2015 21:56:11 +0000 (14:56 -0700)]
Support of BFD status in Quagga

Ticket:CM-6802, CM-6952
Reviewed By: Donald, Kanna
Testing Done:

Double commit of b76943235e09472ec174edcf7204fc82d27fe966 from br2.5. But, manually resolved all the compilation errors. Also, modified the shows to support the json format which was not supported in br2.5.

CM-6802 – Currently, BFD session status can be monitored only through ptmctl. There is no way to check the BFD status of a peer/neighbor through Quagga. Debugging becomes easier if BFD status is shown in Quagga too. BFD status is relevant when it is shown against the BGP peer/OSPF neighbor. For, this following code changes have been done:
   - Only down messages from PTM were being propagated from Zebra daemon to clients (bgpd, ospfd and ospf6d). Now, both up and down messages are redistributed to the clients from zebra. BFD status field has been added to the messaging. Handling of BFD session up messages has been added to the client code. BGP/OSPF neighbor is brought down only if the old BFD session status is ‘Up’ to handle extra/initial down messages.
   - BFD status and last update timestamp fields have been added to the common BFD info structure. Also, common show functions for showing BFD information have been added to BFD lib.
   - Modified the BGP neighbor show functions to call common BFD lib functions.
   - For ospf and ospf6, BFD information was maintained only at interface level. To show BFD status per neighbor, BFD information has been added at neighbor level too. “show ip ospf interface”, “show ip ospf neighbor detail”, “show ipv6 ospf6 interface” and “show ipv6 ospf6 neighbor detail” output have been modified to show BFD information.

CM-6952 - IBGP peers were always assumed to be multi-hop since there was no easy way to determine whether an IBGP peer was single hop or multihop unlike EBGP. But, this is causing problem with IBGP link local peers since BFD doesn't allow multihop BFD session with link local IP addresses. Link local peers were discovered when the interface peering was enabled. Interface peering is always singlehop. So, added checks to treat all interface based peers as single hop irrespective of whether the peer is IBGP or EBGP.

9 years agoBGP: Fix MD5 authentication for unnumbered neighbors
vivek [Sat, 29 Aug 2015 23:10:12 +0000 (16:10 -0700)]
BGP: Fix MD5 authentication for unnumbered neighbors

Ticket: CM-6369
Reviewed By: CCR-3318
Testing Done: Manual testing of various password scenarios.

This is a port of patch bgpd-unnumbered-nbr-fix-password.patch from
2.5-br.

In the case of BGP unnumbered, the peer IP address is derived and not
explicitly configured. If there is a password configured for the peer,
it can be set on the listen socket only after the IP address has been
derived and needs to be cleared when the IP address goes away.

9 years agoBGP: Do not error upon duplicate listen range
vivek [Sat, 29 Aug 2015 18:54:41 +0000 (11:54 -0700)]
BGP: Do not error upon duplicate listen range

Ticket: CM-6517
Reviewed By: Trivial
Testing Done: Manual testing in 2.5-br

This commit is a port of the patch bgpd-dynamic-nbr-fix-config-error.patch
from 2.5-br.

9 years agoBGP: Handle interface or local address failure
vivek [Sat, 29 Aug 2015 18:40:32 +0000 (11:40 -0700)]
BGP: Handle interface or local address failure

Ticket: CM-6883
Reviewed By: CCR-3272
Testing Done: Tested on 2.5.3-SE-1

This commit is a port of the patch bgpd-handle-peer-local-address-failure.patch
from 2.5-br.

When a peering is being established, the IPv4 and IPv6 addresses of the
local end of the connection, as applicable, are obtained and stored in
the peer's 'nexthop' structure to facilitate filling of the NEXT_HOP
field in Update messages among other things. The process of obtaining the
local address involves examination of the list of interfaces to identify
a match corresponding to the socket address of the connection.

There are timing conditions, especially when BGPD starts with a config,
where the interface may not have reached BGP from Zebra at the time a
peering reaches the state to determine the local addresses. The code does
not handle this well and the result could be Updates generated with bad
(Martian) NEXT_HOP values. Resolve the issue by bringing down the connection
in this case as not identifying the local addresses is really an error.