]> git.puffer.fish Git - mirror/frr.git/commit
ospfd: Allow unnumbered and numbered addresses to co-exist better 12282/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 12 Oct 2022 20:05:23 +0000 (16:05 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 8 Nov 2022 11:51:12 +0000 (11:51 +0000)
commitfe5434eb946948778d4572b4d6a8380027f544eb
tree95965354d71fbae886780d72acb2e95d561170c2
parent9d2a8d56cf939ac3e9f841718864f34da44873d5
ospfd: Allow unnumbered and numbered addresses to co-exist better

When forming a neighbor relationship on an interface, ospf is
currently evaluating unnumbered as highest priority, without
any consideration for if you have /32's and non /32's on the
interface.  Effectively if I have something like this:

int foo0
  ip address 192.168.119.1/24
!
router ospf
  network 0.0.0.0/0 area 0
!

ospf will form a neighbor on foo0 if it exists.  Now
suppose someone does this:

int foo0
  ip address 192.168.120.1/32

This will create the unnumbered interface on foo0 and
the peering will come down immediately.

The problem here is that the original designers of the unnumbered
code for ospf didn't envision end operators mixing and matching
addresses on an interface like this ( for perfectly legitimate
reasons I might add ).

So if ospf has both numbered and unnumbered let's match against
the numbered first and then unnumbered.  This solves the problem

Fixes: #6823
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 5136e6729464c57353be1ad4a55fcbdbbfc7779d)
ospfd/ospf_interface.c