Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev

[PATCH 14/25] bgpd: bgp_attr_default_set() already allocates a struct attr_extra

 

 

Quagga dev RSS feed   Index | Next | Previous | View Threaded


jorge at dti2

May 7, 2012, 10:53 AM

Post #1 of 3 (210 views)
Permalink
[PATCH 14/25] bgpd: bgp_attr_default_set() already allocates a struct attr_extra

From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>

Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>
---
bgpd/bgp_route.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index ad942e2..ad562aa 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5342,9 +5342,8 @@ bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop,
#ifdef HAVE_IPV6
if (nexthop6)
{
- struct attr_extra *extra = bgp_attr_extra_get(&attr);
- extra->mp_nexthop_global = *nexthop6;
- extra->mp_nexthop_len = 16;
+ attr.extra->mp_nexthop_global = *nexthop6;
+ attr.extra->mp_nexthop_len = 16;
}
#endif

--
1.7.8.3


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


paul at jakma

May 7, 2012, 11:18 AM

Post #2 of 3 (196 views)
Permalink
Re: [PATCH 14/25] bgpd: bgp_attr_default_set() already allocates a struct attr_extra [In reply to]

Hmm, my tendency'd be to NACK this.

Access to the extra attributes should be obviously safe from local
inspection of code. This weakens that obviousness, and the call to
bgp_attr_extra_get is hardly performance critical here.

On Mon, 7 May 2012, Jorge Boncompte [DTI2] wrote:

> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>
> Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>
> ---
> bgpd/bgp_route.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
> index ad942e2..ad562aa 100644
> --- a/bgpd/bgp_route.c
> +++ b/bgpd/bgp_route.c
> @@ -5342,9 +5342,8 @@ bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop,
> #ifdef HAVE_IPV6
> if (nexthop6)
> {
> - struct attr_extra *extra = bgp_attr_extra_get(&attr);
> - extra->mp_nexthop_global = *nexthop6;
> - extra->mp_nexthop_len = 16;
> + attr.extra->mp_nexthop_global = *nexthop6;
> + attr.extra->mp_nexthop_len = 16;
> }
> #endif
>
>

--
Paul Jakma paul [at] jakma @pjakma Key ID: 64A2FF6A
Fortune:
Natural laws have no pity.
_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


jorge at dti2

May 8, 2012, 3:12 AM

Post #3 of 3 (197 views)
Permalink
Re: [PATCH 14/25] bgpd: bgp_attr_default_set() already allocates a struct attr_extra [In reply to]

El 07/05/2012 20:18, Paul Jakma escribió:
> Hmm, my tendency'd be to NACK this.
>
> Access to the extra attributes should be obviously safe from local inspection of
> code. This weakens that obviousness, and the call to bgp_attr_extra_get is
> hardly performance critical here.
>

I was checking and removing superfluous calls to bgp_attr_extra_get() while
reviewing the code to leave only the "interesting" ones. Maybe a comment would
suffice? If not i have no problem in dropping this one.

> On Mon, 7 May 2012, Jorge Boncompte [DTI2] wrote:
>
>> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>>
>> Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>
>> ---
>> bgpd/bgp_route.c | 5 ++---
>> 1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
>> index ad942e2..ad562aa 100644
>> --- a/bgpd/bgp_route.c
>> +++ b/bgpd/bgp_route.c
>> @@ -5342,9 +5342,8 @@ bgp_redistribute_add (struct prefix *p, const struct
>> in_addr *nexthop,
>> #ifdef HAVE_IPV6
>> if (nexthop6)
>> {
>> - struct attr_extra *extra = bgp_attr_extra_get(&attr);
>> - extra->mp_nexthop_global = *nexthop6;
>> - extra->mp_nexthop_len = 16;
>> + attr.extra->mp_nexthop_global = *nexthop6;
>> + attr.extra->mp_nexthop_len = 16;
>> }
>> #endif
>>
>>
>


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev

Quagga dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.