Commit Graph

2013 Commits

Author SHA1 Message Date
Donatas Abraitis
083e241235 ospfd: Remove deprecated command graceful-restart helper-only
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-23 22:10:44 +03:00
Jafar Al-Gharaibeh
1762461ca8
Merge pull request #11911 from mruprich/ospf-api
ospfd: Adding SUPPORT_OSPF_API define in ospf_spf.c
2022-09-06 22:55:58 -05:00
Donatas Abraitis
cbe4fd18fc
Merge pull request #11864 from manojvn/clis
ospfd: Added clis to change default timers for LSA refresh and maxage remove delay.
2022-09-06 18:32:56 +03:00
Michal Ruprich
ec3bb054c3 ospfd: Adding SUPPORT_OSPF_API define in ospf_spf.c
It is not possible to build ospf_spf.c file with --disable-ospfapi because
ospf_apiserver.c has SUPPORT_OSPF_API around all function definitions and
that results in an undefined reference to the ospf_apiserver_notify_reachable
function error while building.

Signed-off-by: Michal Ruprich <mruprich@redhat.com>
2022-09-06 12:34:15 +02:00
Manoj Naragund
b345a3d9b4 ospfd: Added clis to change default timers for LSA refresh and maxage remove delay.
Description:
Added hidden clis that will allow you to reset the default timers
for LSA refresh and LSA maxage remove delay, these will help in testing
LSA refresh scenarios in upcoming OSPFv2 Flood reduction feature(rfc4136).

IETF Link : https://datatracker.ietf.org/doc/html/rfc4136

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-08-31 23:10:09 -07:00
rgirada
ef151af79b ospfd: crash when router acts as GR helper upon a topo change
Description:
	ospf process is crashing when  the current router acts
	as GR helper and it received a new lsa.

	Here, ospf_lsa_different() is being called without checking
	'old' pointer. It is asserted in ospf_lsa_different() api
	if the 'old' pointer is NULL.

	corrected this by validaing old pointer before calling
	ospf_lsa_different() api.

	back tarce:
	Program terminated with signal SIGABRT, Aborted.
	0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
	[Current thread is 1 (Thread 0x6b84348827c0 (LWP 3155))]
	0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
	1  0x00006b8433aa4801 in __GI_abort () at abort.c:79
	2  0x00006b8433a9439a in __assert_fail_base (fmt=0x6b8433c1b7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:92
	3  0x00006b8433a94412 in __GI___assert_fail (assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:101
	4  0x0000162ffc008c25 in ospf_lsa_different (l1=l1@entry=0x0, l2=l2@entry=0x162ffe535c60, ignore_rcvd_flag=ignore_rcvd_flag@entry=true) at ospfd/ospf_lsa.c:3520
	5  0x0000162ffc00a8e8 in ospf_lsa_install (ospf=ospf@entry=0x162ffe513650, oi=oi@entry=0x162ffe531c30, lsa=lsa@entry=0x162ffe535c60) at ospfd/ospf_lsa.c:2892
	6  0x0000162ffc059d16 in ospf_flood (ospf=0x162ffe513650, nbr=nbr@entry=0x162ffe52cc90, current=current@entry=0x0, new=new@entry=0x162ffe535c60) at ospfd/ospf_flood.c:429
	7  0x0000162ffc01838f in ospf_ls_upd (size=<optimized out>, oi=0x162ffe531c30, s=<optimized out>, ospfh=<optimized out>, iph=<optimized out>, ospf=<optimized out>) at ospfd/ospf_packet.c:2162
	8  ospf_read_helper (ospf=<optimized out>) at ospfd/ospf_packet.c:3241
	9  ospf_read (thread=<optimized out>) at ospfd/ospf_packet.c:3272
	10 0x00006b843450139c in thread_call (thread=thread@entry=0x7780f42c7480) at lib/thread.c:1692
	11 0x00006b84344cfb18 in frr_run (master=0x162ffe34d130) at lib/libfrr.c:1068

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-08-30 00:48:32 -07:00
mobash-rasool
6c231c2e38
Merge pull request #11867 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-29 11:50:54 +05:30
sri-mohan1
70ad0b6627 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-28 20:48:29 +05:30
Donald Sharp
43bb6fc8d4
Merge pull request #11863 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-26 10:50:21 -04:00
sri-mohan1
1396917dde ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-26 13:01:37 +05:30
mobash-rasool
c4d9ff5f1a
Merge pull request #11862 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-26 12:08:53 +05:30
sri-mohan1
ea892800dd ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-25 23:48:24 +05:30
Donald Sharp
373dce6d11
Merge pull request #11858 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-25 09:25:10 -04:00
sri-mohan1
e6f3b2621b ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-24 23:34:41 +05:30
Donatas Abraitis
9e7103f6b7
Merge pull request #11848 from rgirada/ospf_gr_nbr
ospfd: Adding per neighbour json details to GR helper detail command
2022-08-24 12:39:13 +03:00
rgirada
7b71c1e3f7 ospfd: Adding per neighbour json details to GR helper detail command
Description:
	Per neighbor GR enabled information is  missing from json
	output in "show ip ospf gr helper details json" command.

      Example config:

	frr(config-router)# graceful-restart helper enable 2.2.2.2
	frr(config-router)#
	frr(config-router)# do show ip ospf  graceful-restart helper  detail

       OSPF Router with ID (10.112.156.220)

	Graceful restart helper support disabled.
	Strict LSA check is enabled.
	Helper supported for Planned and Unplanned Restarts.
	Supported Graceful restart interval: 1800(in seconds).
	Enable Router list:
		2.2.2.2,

	frr(config-router)# do show ip ospf  graceful-restart helper  detail json
	{
	 "routerId":"10.112.156.220",
	 "helperSupport":"Disabled",
	 "strictLsaCheck":"Enabled",
	 "restartSupoort":"Planned and Unplanned Restarts",
	 "supportedGracePeriod":1800,
	}
	frr(config-router)#

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-08-23 21:15:12 -07:00
sri-mohan1
921b959602 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-23 22:18:33 +05:30
sri-mohan1
f96ec6a674 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-23 16:50:54 +05:30
sri-mohan1
2944807553 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-22 23:16:28 +05:30
sri-mohan1
0faaabfb0b ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-22 18:23:04 +05:30
sri-mohan1
4adc415e99 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-22 12:48:35 +05:30
sri-mohan1
733c0f3ae6 ospfd: changes code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-19 12:45:16 +05:30
Donatas Abraitis
17667be0a3
Merge pull request #11781 from donaldsharp/ospf_packet_helper
Ospf packet helper
2022-08-15 20:43:49 +03:00
sri-mohan1
88282a260c ospfd: debug string corrected
Debug string for ospf is corrected

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-12 18:37:42 +05:30
Donald Sharp
f54b256b93 ospfd: Add how many packets the interface has queued to send
In `show ip ospf interface traffic` how many packets this
interface has queued to send.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
fb617d1874 ospfd: Refactor fifo_flush for the interface
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
14fad76ce2 ospfd: When a neighbor goes down clear the oi->obuf if we can
When a neighbor goes down on an interface and that interface
has no more neighbors in a viable state where packets should
be being sent, then let's clear up the oi->obuf associated
with the interface the neighbor is on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
fe61ceaee7 ospfd: Cleanup indentation surrounding oi->nbr
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
812e6c78c1 ospfd: Increase packets sent at one time in ospf_write
ospf_write pulls an interface off the ospf->oi_write_q
then writes one packet and places it back on the queue,
keeping track of the first one sent.  Then it will
stop sending packets even if we get back to the first
interface written too but before we have sent the full
pkt_count.  I do not believe this makes a whole bunch
of sense and is very restrictive of how much data can
be sent especially if you have a limited number of peers
but large amounts of data.  Why be so restrictive?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
be4b502a76 ospfd: Remove usage of inet_ntop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-29 18:31:58 -04:00
Donald Sharp
c33e80d5f7 ospfd: Coverity warns that we could possibly use unininted data
In ospf_handle_exnl_lsa_lsId_chg there is a code path
where that we may be using uninitialized data for decisions.
Doubtful that this happens but let's make it less likely to
even more.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-27 12:17:50 -04:00
Donald Sharp
bc1f09de73 ospfd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
cccd44f3b1 ospfd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
anlan_cs
5cf2f9a7ea ospfd: correct one debug info for lsa
The index about slots should be displayed as `slot`. Additionally, adjust format.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-07-20 02:34:59 -04:00
Lou Berger
b976af1b09 ospfd: free unreachable router LSA node so that it is not left unreachable
allows for an LSA to be unreachable via one link and reachable via another

Signed-off-by: Lou Berger <lberger@labn.net>
2022-07-16 10:28:42 -04:00
Dmitrii Turlupov
f3fd7196eb ospfd: set/unset bfd profile
Before this patch we can enable 'ip ospf bfd' via '[no] ip ospf bfd profile ...' commads.
After patch '[no] ip ospf bfd profile ...' actual only if 'ip ospf bfd' is set.

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2022-06-30 10:56:34 +03:00
Donald Sharp
f4cb4b4126
Merge pull request #11460 from LabNConsulting/chopps/ospfapi-routerid
Chopps/ospfapi routerid
2022-06-23 13:52:09 -04:00
rgirada
25804ce593 ospfd: fixing few coverity issue in 'show_ip_ospf_neighbour_brief'
Description:
	timerval data structure is being used without initialization.
	Using these uninitialized parameters can lead unexpected results
	so initializing before using it.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-23 06:43:22 -07:00
Christian Hopps
44038c7ae3 ospfd: add router id support to ospf api
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-23 05:01:40 -04:00
rgirada
e8a8b11610 ospfd: Fixing "show ip ospf neighbour <nbrid>" command
Description:
	"show ip ospf neighbour [nbrid] [json]" is expected to give brief output
	of the specific neighbour. But it gives the detailed output without
	the detail keyword.
	"show ip ospf neighbour [nbrid] [deatil] [json]" command is failed to
	fetch the ecpected o/p. Corrected it.

	Ex o/p:
	frr(config-if)# do show ip ospf  neighbor

	Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
	8.8.8.8           1 Full/DR         17m03s            31.192s 20.1.1.194      ens192:20.1.1.220                    0     0     0
	30.1.1.100        1 Full/DR         56.229s           32.000s 30.1.1.100      ens224:30.1.1.220                    0     0     0

	frr(config-if)#
	frr(config-if)#
	frr(config-if)# do show ip ospf  neighbor 8.8.8.8
	Neighbor 8.8.8.8, interface address 20.1.1.194
	In the area 0.0.0.0 via interface ens192
	Neighbor priority is 1, State is Full/DR, 6 state changes
	Most recent state change statistics:
	  Progressive change 17m18s ago
	DR is 20.1.1.194, BDR is 20.1.1.220
	Options 2 *|-|-|-|-|-|E|-
	Dead timer due in 35.833s
	Database Summary List 0
	Link State Request List 0
	Link State Retransmission List 0
	Thread Inactivity Timer on
	Thread Database Description Retransmision off
	Thread Link State Request Retransmission on
	Thread Link State Update Retransmission on

	Graceful restart Helper info:
	  Graceful Restart HELPER Status : None

	frr(config-if)# do show ip ospf  neighbor 8.8.8.8 detail
	No such interface.
	frr(config-if)# do show ip ospf  neighbor 8.8.8.8 detail json
	{}
	frr(config-if)#

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-22 08:40:24 -07:00
Donald Sharp
442321664b bgpd, ospfd: Remove extra newline for show debugging
This extra newline was adding a weird output to `show debugging`
display where there would be extra newlines sometims and not
others.  Make it consistent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-15 10:34:30 -04:00
Donatas Abraitis
70dd370f5a *: Use autocomplete for route-maps under commands that require it
For example:

```
donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ?
  RMAP_NAME  Name of the route map
       testas2 testas

donatas-laptop(config)# router bgp
donatas-laptop(config-router)# address-family ipv4
donatas-laptop(config-router-af)# redistribute connected route-map ?
  RMAP_NAME  Pointer to route-map entries
       testas2 testas

donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ?
  RMAP_NAME  Name of the route map
       testas2 testas
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-13 21:00:51 +03:00
Donald Sharp
2d4093ee30 ospfd: Fixup ospfd.h to declare variable names
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-08 11:38:22 -04:00
Olivier Dugeon
96b706b72a
Merge pull request #11334 from ton31337/fix/deprecation_warning
ospfd: Remove local-block deprecated command
2022-06-07 17:38:52 +02:00
Donatas Abraitis
d2e02cbf64 ospfd: Remove local-block deprecated command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 16:11:46 +03:00
Christian Hopps
bd1188f904 ospfd: api: always ready to receive opaque from client
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
97355a6d92 ospfd: api: add new ISM and NSM sync requests
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
b1e40ef0ea ospfd: api: remove unused api code/message creation
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
5349121b4c ospfd: api: fix recovery of LSA after restart of api client
Prior to this fix, restarting the client just failed b/c the code tried to
"refresh" the existing LSA being added, except that code checked for meta-data
to exist, which was deleted when the client disconnected previously (or had
never connected and the LSA state was picked up from the network).

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
d86760acad ospfd: cli: add "show ip ospf reachable-routers" CLI
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00