diff options
| author | hasso <hasso> | 2005-08-17 13:31:47 +0000 | 
|---|---|---|
| committer | hasso <hasso> | 2005-08-17 13:31:47 +0000 | 
| commit | 54bedb55d9f4185e35307a4178ad8d73a9a8857d (patch) | |
| tree | 9cccbd6d9ed8d0e612a76817ced6cd24dbb8e2a0 /ospfd | |
| parent | 56b24f4c33d2dc093922945319da02c7cbdadd2b (diff) | |
	* ospf_vty.c: Check carefully if interface exists before trying to
	  print info about it.
	Fixes bugzilla #213. [backport candidate]
Diffstat (limited to 'ospfd')
| -rw-r--r-- | ospfd/ChangeLog | 5 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 21 | 
2 files changed, 17 insertions, 9 deletions
| diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index cb164590..b546bbd1 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,8 @@ +2005-08-17 Hasso Tepper <hasso at quagga.net> + +	* ospf_vty.c: Check carefully if interface exists before trying to +	  print info about it. +  2005-08-05 Hasso Tepper <hasso at quagga.net>  	* ospf_zebra.c: Don't assert/stop before type == ZEBRA_ROUTE_MAX if diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 179464cc..0f2a0fce 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -6533,7 +6533,7 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt)          if (or->type == OSPF_DESTINATION_NETWORK)            for (ALL_LIST_ELEMENTS (or->paths, pnode, pnnode, path))              { -              if (path->oi != NULL) +              if (path->oi != NULL && ospf_if_exists(path->oi))                  {                    if (path->nexthop.s_addr == 0)                      vty_out (vty, "%24s   directly attached to %s%s", @@ -6583,13 +6583,16 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs)                    for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path))                      { -                      if (path->nexthop.s_addr == 0) -                        vty_out (vty, "%24s   directly attached to %s%s", -                                 "", path->oi->ifp->name, VTY_NEWLINE); -                      else -                        vty_out (vty, "%24s   via %s, %s%s", "", -                                 inet_ntoa (path->nexthop), path->oi->ifp->name, -                                            VTY_NEWLINE); +		      if (path->oi != NULL && ospf_if_exists(path->oi)) +			{ +			  if (path->nexthop.s_addr == 0) +			    vty_out (vty, "%24s   directly attached to %s%s", +				     "", path->oi->ifp->name, VTY_NEWLINE); +			  else +			    vty_out (vty, "%24s   via %s, %s%s", "", +				     inet_ntoa (path->nexthop), +				     path->oi->ifp->name, VTY_NEWLINE); +			}                      }            }        } @@ -6627,7 +6630,7 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt)          for (ALL_LIST_ELEMENTS (er->paths, pnode, pnnode, path))            { -            if (path->oi != NULL) +            if (path->oi != NULL && ospf_if_exists(path->oi))                {                  if (path->nexthop.s_addr == 0)                    vty_out (vty, "%24s   directly attached to %s%s", | 
