[packages_10.03.2] p910nd: merge r29227
[10.03/packages.git] / net / quagga / patches / 030-fix-opaque-support.patch
1 --- a/ospfd/ospf_lsa.h
2 +++ b/ospfd/ospf_lsa.h
3 @@ -114,6 +114,9 @@ struct ospf_lsa
4  
5    /* Refreshement List or Queue */
6    int refresh_list;
7 +  
8 +  /* For Type-9 Opaque-LSAs */
9 +  struct ospf_interface *oi;
10  };
11  
12  /* OSPF LSA Link Type. */
13 --- a/ospfd/ospf_nsm.c
14 +++ b/ospfd/ospf_nsm.c
15 @@ -216,7 +216,7 @@ ospf_db_summary_add (struct ospf_neighbo
16      {
17      case OSPF_OPAQUE_LINK_LSA:
18        /* Exclude type-9 LSAs that does not have the same "oi" with "nbr". */
19 -      if (lsa->oi != nbr->oi)
20 +      if (nbr->oi && ospf_if_exists (lsa->oi) != nbr->oi)
21            return 0;
22        break;
23      case OSPF_OPAQUE_AREA_LSA:
24 --- a/ospfd/ospf_opaque.c
25 +++ b/ospfd/ospf_opaque.c
26 @@ -251,7 +251,7 @@ struct ospf_opaque_functab
27    void (* config_write_debug )(struct vty *vty);
28    void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa);
29    int  (* lsa_originator)(void *arg);
30 -  void (* lsa_refresher )(struct ospf_lsa *lsa);
31 +  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa);
32    int (* new_lsa_hook)(struct ospf_lsa *lsa);
33    int (* del_lsa_hook)(struct ospf_lsa *lsa);
34  };
35 @@ -354,7 +354,7 @@ ospf_register_opaque_functab (
36    void (* config_write_debug )(struct vty *vty),
37    void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa),
38    int  (* lsa_originator)(void *arg),
39 -  void (* lsa_refresher )(struct ospf_lsa *lsa),
40 +  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
41    int (* new_lsa_hook)(struct ospf_lsa *lsa),
42    int (* del_lsa_hook)(struct ospf_lsa *lsa))
43  {
44 @@ -1608,12 +1608,13 @@ out:
45    return new;
46  }
47  
48 -void
49 +struct ospf_lsa *
50  ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
51  {
52    struct ospf *ospf;
53    struct ospf_opaque_functab *functab;
54 -
55 +  struct ospf_lsa *new = NULL;
56 +  
57    ospf = ospf_lookup ();
58  
59    if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
60 @@ -1633,9 +1634,9 @@ ospf_opaque_lsa_refresh (struct ospf_lsa
61        ospf_lsa_flush (ospf, lsa);
62      }
63    else
64 -    (* functab->lsa_refresher)(lsa);
65 +    new = (* functab->lsa_refresher)(lsa);
66  
67 -  return;
68 +  return new;
69  }
70  
71  /*------------------------------------------------------------------------*
72 --- a/ospfd/ospf_opaque.h
73 +++ b/ospfd/ospf_opaque.h
74 @@ -120,7 +120,7 @@ ospf_register_opaque_functab (
75    void (* config_write_debug )(struct vty *vty),
76    void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa),
77    int  (* lsa_originator)(void *arg),
78 -  void (* lsa_refresher )(struct ospf_lsa *lsa),
79 +  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
80    int (* new_lsa_hook)(struct ospf_lsa *lsa),
81    int (* del_lsa_hook)(struct ospf_lsa *lsa)
82  );
83 @@ -143,7 +143,7 @@ extern void ospf_opaque_lsa_originate_sc
84                                                 int *init_delay);
85  extern struct ospf_lsa *ospf_opaque_lsa_install (struct ospf_lsa *,
86                                                  int rt_recalc);
87 -extern void ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
88 +extern struct ospf_lsa *ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
89  
90  extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
91                                                   u_char lsa_type,