Mailing List Archive

patch: fix for UNH 3.12 failure.
Hi,

here's a patch that fixes misc. bugs, including the one which
causes unh 3.12 to fail. The changes are:

- ospfd/ospf_abr.c: fix for UNH 3.12 failure: update cost of range to
the *max* cost in the area
- ospfd/ospf_lsa.c: more debug statements.
- lib/log.c: missing tzset()
- ospfd/ospf_route.c, ospfd/ospf_packet.c: fix compiler warnings.

--Sowmini

===================================================================
RCS file: ./ospfd/ospf_abr.c,v
retrieving revision 1.5
diff -uwb -r1.5 ./ospfd/ospf_abr.c
--- ./ospfd/ospf_abr.c 2003/08/10 02:51:22 1.5
+++ ./ospfd/ospf_abr.c 2004/01/28 15:05:59
@@ -580,10 +580,11 @@
if (range->specifics == 0)
range->cost = or->cost; /* 1st time get 1st cost */

- if (or->cost < range->cost)
+ if (or->cost > range->cost)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_info ("ospf_abr_update_aggregate(): lowest cost, update");
+ zlog_info ("ospf_abr_update_aggregate(): updating cost "
+ "from %d to %d", range->cost, or->cost);

range->cost = or->cost;
}
===================================================================
RCS file: ./ospfd/ospf_lsa.c,v
retrieving revision 1.23
diff -uwb -r1.23 ./ospfd/ospf_lsa.c
--- ./ospfd/ospf_lsa.c 2003/10/13 09:06:46 1.23
+++ ./ospfd/ospf_lsa.c 2004/01/28 15:09:10
@@ -557,6 +557,8 @@
masklen2ip (oi->address->prefixlen, &mask);
id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr;
link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, oi->output_cost);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_info("lsa_link_broadcast_set id %s STUB", inet_ntoa(id));
return 1;
}

@@ -568,6 +570,9 @@
{
link_info_set (s, DR (oi), oi->address->u.prefix4,
LSA_LINK_TYPE_TRANSIT, 0, oi->output_cost);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_info("lsa_link_broadcast_set id %s TRANSIT",
+ inet_ntoa(oi->address->u.prefix4));
}
/* Describe type 3 link. */
else
@@ -575,6 +580,8 @@
masklen2ip (oi->address->prefixlen, &mask);
id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr;
link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, oi->output_cost);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_info("lsa_link_broadcast_set Full/DR id %s STUB", inet_ntoa(id));
}
return 1;
}
===================================================================
RCS file: ./ospfd/ospf_route.c,v
retrieving revision 1.4
diff -uwb -r1.4 ./ospfd/ospf_route.c
--- ./ospfd/ospf_route.c 2003/08/15 16:04:21 1.4
+++ ./ospfd/ospf_route.c 2004/01/28 15:28:23
@@ -192,8 +192,9 @@
{
if (rn && rn->info)
{
- struct prefix_ipv4 *p = &rn->p;
- if ( (ext_rn = route_node_lookup (external_routes, p)) )
+ struct prefix_ipv4 *p = (struct prefix_ipv4 *)&rn->p;
+ if ( (ext_rn = route_node_lookup (external_routes,
+ (struct prefix *)p)) )
{
ospf_zebra_delete (p, ext_rn->info);
if (ext_rn->info)
===================================================================
RCS file: ./ospfd/ospf_packet.c,v
retrieving revision 1.24
diff -uwb -r1.24 ./ospfd/ospf_packet.c
--- ./ospfd/ospf_packet.c 2003/12/08 10:34:54 1.24
+++ ./ospfd/ospf_packet.c 2004/01/28 15:28:53
@@ -290,8 +290,8 @@
{
zlog_warn ("interface %s: ospf_check_md5 bad sequence %d (expect %d)",
IF_NAME (oi),
- ntohl(ospfh->u.crypt.crypt_seqnum),
- ntohl(nbr->crypt_seqnum));
+ (int) ntohl(ospfh->u.crypt.crypt_seqnum),
+ (int) ntohl(nbr->crypt_seqnum));
return 0;
}

===================================================================
RCS file: ./lib/log.c,v
retrieving revision 1.4
diff -uwb -r1.4 ./lib/log.c
--- ./lib/log.c 2003/12/23 08:56:19 1.4
+++ ./lib/log.c 2004/01/28 15:09:50
@@ -330,6 +330,7 @@
zl->record_priority = 0;

openlog (progname, syslog_flags, zl->facility);
+ tzset();

return zl;
}
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
Your patch seems OK.

sowmini.varadhan@sun.com wrote:

>Hi,
>
>here's a patch that fixes misc. bugs, including the one which
>causes unh 3.12 to fail. The changes are:
>
>- ospfd/ospf_abr.c: fix for UNH 3.12 failure: update cost of range to
> the *max* cost in the area
>- ospfd/ospf_lsa.c: more debug statements.
>- lib/log.c: missing tzset()
>- ospfd/ospf_route.c, ospfd/ospf_packet.c: fix compiler warnings.
>
>--Sowmini
>
>===================================================================
>RCS file: ./ospfd/ospf_abr.c,v
>retrieving revision 1.5
>diff -uwb -r1.5 ./ospfd/ospf_abr.c
>--- ./ospfd/ospf_abr.c 2003/08/10 02:51:22 1.5
>+++ ./ospfd/ospf_abr.c 2004/01/28 15:05:59
>@@ -580,10 +580,11 @@
> if (range->specifics == 0)
> range->cost = or->cost; /* 1st time get 1st cost */
>
>- if (or->cost < range->cost)
>+ if (or->cost > range->cost)
> {
> if (IS_DEBUG_OSPF_EVENT)
>- zlog_info ("ospf_abr_update_aggregate(): lowest cost, update");
>+ zlog_info ("ospf_abr_update_aggregate(): updating cost "
>+ "from %d to %d", range->cost, or->cost);
>
> range->cost = or->cost;
> }
>===================================================================
>RCS file: ./ospfd/ospf_lsa.c,v
>retrieving revision 1.23
>diff -uwb -r1.23 ./ospfd/ospf_lsa.c
>--- ./ospfd/ospf_lsa.c 2003/10/13 09:06:46 1.23
>+++ ./ospfd/ospf_lsa.c 2004/01/28 15:09:10
>@@ -557,6 +557,8 @@
> masklen2ip (oi->address->prefixlen, &mask);
> id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr;
> link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, oi->output_cost);
>+ if (IS_DEBUG_OSPF_EVENT)
>+ zlog_info("lsa_link_broadcast_set id %s STUB", inet_ntoa(id));
> return 1;
> }
>
>@@ -568,6 +570,9 @@
> {
> link_info_set (s, DR (oi), oi->address->u.prefix4,
> LSA_LINK_TYPE_TRANSIT, 0, oi->output_cost);
>+ if (IS_DEBUG_OSPF_EVENT)
>+ zlog_info("lsa_link_broadcast_set id %s TRANSIT",
>+ inet_ntoa(oi->address->u.prefix4));
> }
> /* Describe type 3 link. */
> else
>@@ -575,6 +580,8 @@
> masklen2ip (oi->address->prefixlen, &mask);
> id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr;
> link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, oi->output_cost);
>+ if (IS_DEBUG_OSPF_EVENT)
>+ zlog_info("lsa_link_broadcast_set Full/DR id %s STUB", inet_ntoa(id));
> }
> return 1;
> }
>===================================================================
>RCS file: ./ospfd/ospf_route.c,v
>retrieving revision 1.4
>diff -uwb -r1.4 ./ospfd/ospf_route.c
>--- ./ospfd/ospf_route.c 2003/08/15 16:04:21 1.4
>+++ ./ospfd/ospf_route.c 2004/01/28 15:28:23
>@@ -192,8 +192,9 @@
> {
> if (rn && rn->info)
> {
>- struct prefix_ipv4 *p = &rn->p;
>- if ( (ext_rn = route_node_lookup (external_routes, p)) )
>+ struct prefix_ipv4 *p = (struct prefix_ipv4 *)&rn->p;
>+ if ( (ext_rn = route_node_lookup (external_routes,
>+ (struct prefix *)p)) )
> {
> ospf_zebra_delete (p, ext_rn->info);
> if (ext_rn->info)
>===================================================================
>RCS file: ./ospfd/ospf_packet.c,v
>retrieving revision 1.24
>diff -uwb -r1.24 ./ospfd/ospf_packet.c
>--- ./ospfd/ospf_packet.c 2003/12/08 10:34:54 1.24
>+++ ./ospfd/ospf_packet.c 2004/01/28 15:28:53
>@@ -290,8 +290,8 @@
> {
> zlog_warn ("interface %s: ospf_check_md5 bad sequence %d (expect %d)",
> IF_NAME (oi),
>- ntohl(ospfh->u.crypt.crypt_seqnum),
>- ntohl(nbr->crypt_seqnum));
>+ (int) ntohl(ospfh->u.crypt.crypt_seqnum),
>+ (int) ntohl(nbr->crypt_seqnum));
> return 0;
> }
>
>===================================================================
>RCS file: ./lib/log.c,v
>retrieving revision 1.4
>diff -uwb -r1.4 ./lib/log.c
>--- ./lib/log.c 2003/12/23 08:56:19 1.4
>+++ ./lib/log.c 2004/01/28 15:09:50
>@@ -330,6 +330,7 @@
> zl->record_priority = 0;
>
> openlog (progname, syslog_flags, zl->facility);
>+ tzset();
>
> return zl;
> }
>_______________________________________________
>Quagga-dev mailing list
>Quagga-dev@lists.quagga.net
>http://lists.quagga.net/mailman/listinfo/quagga-dev
>
>
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
Just to avoid duplicate work I have patch to fix UNH OSPF_CONF.3.22
failure in work queue. Actually it's porting old zebra patch made by
Vadim Suraev to Quagga.

Also, I'm waiting for comments regarding patch to fix #10 -
http://bugzilla.quagga.net/show_bug.cgi?id=10

If someone with more vtysh knowledge could look at #58
(http://bugzilla.quagga.net/show_bug.cgi?id=58) would be good. This
issue annoys me every time I had to configure my routers with
ospfd/ripd/ripngd running :).

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
>
> Just to avoid duplicate work I have patch to fix UNH OSPF_CONF.3.22
> failure in work queue. Actually it's porting old zebra patch made by
> Vadim Suraev to Quagga.
>

UNH 3.22 was fixed in [quagga-dev 288].

--Sowmini
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
sowmini.varadhan@sun.com wrote:
> > Just to avoid duplicate work I have patch to fix UNH
> > OSPF_CONF.3.22 failure in work queue. Actually it's porting old
> > zebra patch made by Vadim Suraev to Quagga.
>
> UNH 3.22 was fixed in [quagga-dev 288].

Hmmm ... why I got report still that's bug is there ... Will do some
testing myself, thanks.

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
sowmini.varadhan@sun.com wrote:
> > Just to avoid duplicate work I have patch to fix UNH
> > OSPF_CONF.3.22 failure in work queue. Actually it's porting old
> > zebra patch made by Vadim Suraev to Quagga.
>
> UNH 3.22 was fixed in [quagga-dev 288].

OK. I looked at it. Can you explain this part of code from ospf_lsa.c
ospf_maxage_lsa_remover()?

if (lsa->flags & OSPF_LSA_PREMATURE_AGE)
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
zlog_info ("originating new router lsa for lsa 0x%lx \n",
(u_long)lsa);
ospf_router_lsa_originate(lsa->area);
}

As I understand it, regardless what was type of lsa with
OSPF_LSA_PREMATURE_AGE flag, router lsa is originated? What about
other types?

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
On Wed, 28 Jan 2004, Hasso Tepper wrote:

> Just to avoid duplicate work I have patch to fix UNH OSPF_CONF.3.22

Didnt Sowmini post a fix for this failure quite a while ago? Its
included in CVS.

> Also, I'm waiting for comments regarding patch to fix #10 -
> http://bugzilla.quagga.net/show_bug.cgi?id=10

Seems reasonably.

> If someone with more vtysh knowledge could look at #58
> (http://bugzilla.quagga.net/show_bug.cgi?id=58) would be good. This
> issue annoys me every time I had to configure my routers with
> ospfd/ripd/ripngd running :).

I dont see this issue:

fogarty.jakma.org(config)# router bgp 26
fogarty.jakma.org(config-router)# quit
fogarty.jakma.org(config)# router ospf
fogarty.jakma.org(config-router)# quit
fogarty.jakma.org(config)# router bgp 26
fogarty.jakma.org(config-router)# exit
fogarty.jakma.org(config)# router ospf
fogarty.jakma.org(config-router)# quit
fogarty.jakma.org(config)# router ospf
fogarty.jakma.org(config-router)# quit
fogarty.jakma.org(config)# end
fogarty.jakma.org#

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
The Heineken Uncertainty Principle:
You can never be sure how many beers you had last night.
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
Paul Jakma wrote:
> On Wed, 28 Jan 2004, Hasso Tepper wrote:
> > If someone with more vtysh knowledge could look at #58
> > (http://bugzilla.quagga.net/show_bug.cgi?id=58) would be good.
> > This issue annoys me every time I had to configure my routers
> > with ospfd/ripd/ripngd running :).
>
> I dont see this issue:
>
> fogarty.jakma.org(config)# router bgp 26
> fogarty.jakma.org(config-router)# quit
> fogarty.jakma.org(config)# router ospf
> fogarty.jakma.org(config-router)# quit
> fogarty.jakma.org(config)# router bgp 26
> fogarty.jakma.org(config-router)# exit
> fogarty.jakma.org(config)# router ospf
> fogarty.jakma.org(config-router)# quit
> fogarty.jakma.org(config)# router ospf
> fogarty.jakma.org(config-router)# quit
> fogarty.jakma.org(config)# end
> fogarty.jakma.org#

t3# conf t
t3(config)# router bgp 1234
t3(config-router)# no neighbor dead::beaf activate
t3(config-router)# exit
t3(config)# router ospf
% Unknown command.
t3(config)#

Enter some command in router node. It isn't always necessary though;
for example when switching between ospf and ripng.

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: patch: fix for UNH 3.12 failure. [ In reply to ]
On Thu, 29 Jan 2004, Hasso Tepper wrote:

> t3# conf t
> t3(config)# router bgp 1234
> t3(config-router)# no neighbor dead::beaf activate
> t3(config-router)# exit
> t3(config)# router ospf
> % Unknown command.
> t3(config)#
>
> Enter some command in router node. It isn't always necessary though;
> for example when switching between ospf and ripng.

Nope, still works fine here. I have noticed the problem in the past,
but i assumed someone had fixed it cause I havnt seen that problem in
a while now.

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
It is a lesson which all history teaches wise men, to put trust in ideas,
and not in circumstances.
-- Emerson