[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ospf_if_lookup_recv_interface returns wrong interface.
From: |
Kenji Yabuuchi |
Subject: |
ospf_if_lookup_recv_interface returns wrong interface. |
Date: |
Thu, 30 Jan 2003 14:01:05 +0900 |
Hi,
I'm using zebra and ospfd with a following configuration
|
| 202.xxx.xxx.228/28
---+---
|zebra|
| host|
---+---
| 202.xxx.xxx.241/24
|
1. I use source gotten by CVS on 29 Jan 2003.
2. Zebra and ospfd are running.
3. Ospfd says:
"Packet from [202.xxx.xxx.226] received on wrong link fxp0"
when routers on 202.xxx.xxx.228/28 network send OSPF packets.
This message is produced by ospf_read() in ospf_packet.c on
lookup recv interface of a received packet. In
ospf_if_lookup_recv_interface() in ospf_interface.c, all
interfaces are checked with a source address of the packet
without regard to a prefix length of interfaces. So, in an
above example, both interfaces are passed this check, then
a returning interface(struct ospf_interface) which depends
only on the order of registration to an ospf_interface
list might be wrong.
4. Configuration files are following:
------------------------------------------------------------
ospfd.conf
----------
hostname zebra-ospfd
password xxxxx
enable password xxxxx:
!
debug ospf packet all
!
interface nge0
ip ospf authentication-key xxxxx
ip ospf priority 0
ip ospf cost 10
!
interface fxp0
ip ospf authentication-key xxxxx
ip ospf priority 0
ip ospf cost 11
!
router ospf
ospf router-id 202.xxx.xxx.241
ospf rfc1583compatibility
network 202.xxx.xxx.228/28 area 0
network 202.xxx.xxx.241/24 area 0
area 0 authentication
!
log syslog
!log file /var/tmp/ospfd.log
------------------------------------------------------------
------------------------------------------------------------
zebra.conf
----------
hostname zebra-zebra
password xxxxx
enable password xxxxx:
interface fxp0
ip address 202.xxx.xxx.228/28
interface nge0
ip address 202.xxx.xxx.241/24
------------------------------------------------------------
8. Here's a patch.
Index: ospf_interface.c
===================================================================
RCS file: /cvsroot/zebra/ospfd/ospf_interface.c,v
retrieving revision 1.139
diff -c -r1.139 ospf_interface.c
*** ospf_interface.c 23 Oct 2002 09:12:36 -0000 1.139
--- ospf_interface.c 30 Jan 2003 04:35:17 -0000
***************
*** 402,409 ****
}
else
{
! if (prefix_match (oi->address, (struct prefix *) &addr))
! match = oi;
}
}
--- 402,410 ----
}
else
{
! if (prefix_match (oi->address, (struct prefix *) &addr))
! if (match == NULL || match->address->prefixlen <
oi->address->prefixlen)
! match = oi;
}
}
Thank you.
---
ASTEM RI
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ospf_if_lookup_recv_interface returns wrong interface.,
Kenji Yabuuchi <=