Mao Yuankui | 1 Jun 2009 04:08
Picon

[quagga-dev 6609] Re: How to get Development Documentation of Quagga?

Hi,
I need to add something on Quagga ospfd, and i find your thread in Quagga-dev <at> lists.quagga.net.
I want to know that if you have got the design architecture document or not. It will be really helpful to my study.
So will you please share your documents about Quagga and ospf and something the like with me?
Sorry for my interruption and Thank you in advance.
 
 
 
                                                  Sincerely
                                                  Mao Yuankui
                                              
<div>
<div>Hi,</div>
<div>I need to add something on Quagga ospfd, and i find your 
thread in <a href="mailto:Quagga-dev <at> lists.quagga.net">Quagga-dev <at> lists.quagga.net</a>.</div>
<div>I want to know that if you have got the design architecture 
document or not. It will be really helpful to my study.</div>
<div>So will you please share your documents about Quagga&nbsp;and 
ospf and something the like with me?</div>
<div>Sorry for my interruption and Thank you in 
advance.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Sincerely</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Mao Yuankui</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</div>
</div>
Joakim Tjernlund | 2 Jun 2009 13:22
Picon

[quagga-dev 6611] enable/disable OSPF on a specific interface


When enabling OSPF on an interface one have to perform
a "network 1.2.3.4/6 area X" command or a "ip ospf area X". I want to disable
OSPF on a interface I see no other way than undoing the one of the above
commands and that annoys me.

Is there an alternative command (possible not impl yet) that will
allow me disable OSPF on an interface without removing the area information?
something like "ip ospf disable" resp. "no ip ospf disable"

 Jocke

paul | 2 Jun 2009 13:58

[quagga-dev 6610] Re: Is there any maintained quagga repository/release?

On Fri, 29 May 2009, Simon Talbot wrote:

> Paul, I will run this by one of our Legal chaps and let you know his
> response and whether we can easily create some drafts for discussion,

That kind of thing would be really useful. The idea being to have 
some kind of body corporate to hold and manage assets in trust for 
the community.

Stuff we'd need advice about:

- is there a minimum number of UK directors required? (I could manage
   myself obviously, and one other)

- what restrictions, if any, are there on non-UK directors? What
   about non-EU?

- How to minimise legislatively mandated duties (I.e. we
   really don't want to have to start retaining accountants)

So what's the best body for the above.

I've no idea how it should be governed though (how to define the 
'community' it is responsible to in particular). That could be a 
matter for the first board of directors to sort out ;).

regards,
--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
I'm a Lisp variable -- bind me!
paul | 2 Jun 2009 16:24

[quagga-dev 6612] Re: fd leak in bgpd

On Mon, 13 Apr 2009, Steve Hill wrote:

> When Hold_Timer_expired fires in Established state, a notify is 
> sent and BGP_Stop event queued. The fsm then transitions into 
> Clearing state. That is the problem; When the BGP_Stop event is 
> serviced, the state table says to ignore it while in Clearing. Thus 
> bgp_stop is not called and the fd leaks. Previously the peer would 
> be in Idle state, which correctly handles the BGP_Stop event.

Oops.

> I think the correct solution is to call bgp_stop in Clearing for a
> number of events, including those that would also call it in Idle (For
> instance TCP_fatal_error can be generated by sending the notify). I
> attached the trivial patch to this email.

Yep. Clearing is meant to be a wait-state for Idle - it's an 
expansion of the Idle state.

> I could also see a case for calling bgp_stop in response to 
> Receive_FOO_message, but I think the other events will clean things 
> up properly.

I think it probably makes sense to do so - bgp_stop should be 
idem-potent anyway. If you want to investigate/test that...?

Patch applied locally.

regards,
--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
Reformatting Page. Wait...
paul | 2 Jun 2009 18:42

[quagga-dev 6614] Re: PCRE patch

On Mon, 27 Apr 2009, C.J. Adams-Collier wrote:

> Hey all,
>
> I'm trying to figure out git and resolve bug #483.  Anyone want to
> review it before I push it back up?
>
> http://bugzilla.quagga.net/show_bug.cgi?id=483
> http://bugzilla.quagga.net/attachment.cgi?id=277&action=view

That seems reasonable to me. If you push it I'll pull it.

regards,
--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
If you teach your children to like computers and to know how to gamble
then they'll always be interested in something and won't come to no real harm.
paul | 2 Jun 2009 17:32

[quagga-dev 6613] Re: fd leak in bgpd

On Mon, 20 Apr 2009, Steve Hill wrote:

> My previous patch suffered from a race condition, triggered if a 
> session with 0 prefixes had a hold timer expire; The peer would get 
> stuck in Clearing because the Clearing_Completed event was 
> inadvertently eaten by calling bgp_stop in Clearing.

Ah.

> This new patch just calls bgp_stop at the bottom of
> bgp_fsm_holdtime_expire, which seems to work better.

> I think there is still a an fd leak if TCP_connection_open_failed 
> fires during Established, but I can't convince myself that's 
> actually possible. Using bgp_stop instead of bgp_ignore as the 
> event handler for TCP_connection_open_failed would clear it up.

Hmm, or we stick with your original proposal but remove the 
problematic from bgp_stop (or split up bgp_stop). All transitions 
from Established have to go through Clearing:

Established -> (shutdown) -> Clearing -> (stop) -> Idle

The stop code path == shutdown + flush. shutdown should be 
idem-potent.

Transitions into Idle directly can call either stop or shutdown. 
Calling just shutdown might result in further events in Idle besides 
stop, but can be ignored - unneeded but harmless. That can happen 
with transition into Idle via bgp_stop_with_error, and could be fixed 
by splitting it up into 2 or by having an entry function into Idle - 
but that seems an over-optimisation.

The off-the-cuff, untested, not-ready-for-integration patch is 
attached, what do you think?

regards,
-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
A language that doesn't affect the way you think about programming is
not worth knowing.
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index d0db6aa..bd96139 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
 <at>  <at>  -426,17 +426,14  <at>  <at>  bgp_fsm_change_status (struct peer *peer, int status)
 		LOOKUP (bgp_status_msg, peer->status));
 }
 
-/* Administrative BGP peer stop event. */
-int
-bgp_stop (struct peer *peer)
+/* Shutdown and release resources */
+static int
+bgp_shutdown (struct peer *peer)
 {
   afi_t afi;
   safi_t safi;
   char orf_name[BUFSIZ];
 
-  /* Delete all existing events of the peer */
-  BGP_EVENT_FLUSH (peer);
-
   /* Increment Dropped count. */
   if (peer->status == Established)
     {
 <at>  <at>  -573,6 +570,20  <at>  <at>  bgp_stop (struct peer *peer)
   return 0;
 }
 
+/* Administrative BGP peer stop event. 
+ *
+ * Also used by bgp_packet to do its peer-swap hack
+ */
+int
+bgp_stop (struct peer *peer) {
+  bgp_shutdown (peer);
+  
+  /* Delete all existing events of the peer */
+  BGP_EVENT_FLUSH (peer);
+  
+  return 0;
+}
+
 /* BGP peer is stoped by the error. */
 static int
 bgp_stop_with_error (struct peer *peer)
 <at>  <at>  -584,7 +595,7  <at>  <at>  bgp_stop_with_error (struct peer *peer)
   if (peer->v_start >= (60 * 2))
     peer->v_start = (60 * 2);
 
-  bgp_stop (peer);
+  bgp_shutdown (peer);
 
   return 0;
 }
 <at>  <at>  -996,36 +1007,36  <at>  <at>  struct {
   {
     /* Established, */
     {bgp_ignore,               Established}, /* BGP_Start                    */
-    {bgp_stop,                    Clearing}, /* BGP_Stop                     */
-    {bgp_stop,                    Clearing}, /* TCP_connection_open          */
-    {bgp_stop,                    Clearing}, /* TCP_connection_closed        */
-    {bgp_ignore,                  Clearing}, /* TCP_connection_open_failed   */
-    {bgp_stop,                    Clearing}, /* TCP_fatal_error              */
-    {bgp_ignore,                  Clearing}, /* ConnectRetry_timer_expired   */
-    {bgp_fsm_holdtime_expire,     Clearing}, /* Hold_Timer_expired           */
+    {bgp_shutdown,             Clearing}, /* BGP_Stop                     */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_open          */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_closed        */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_open_failed   */
+    {bgp_shutdown,             Clearing}, /* TCP_fatal_error              */
+    {bgp_shutdown,             Clearing}, /* ConnectRetry_timer_expired   */
+    {bgp_fsm_holdtime_expire,  Clearing}, /* Hold_Timer_expired           */
     {bgp_fsm_keepalive_expire, Established}, /* KeepAlive_timer_expired      */
-    {bgp_stop,                    Clearing}, /* Receive_OPEN_message         */
+    {bgp_shutdown,             Clearing}, /* Receive_OPEN_message         */
     {bgp_fsm_keepalive,        Established}, /* Receive_KEEPALIVE_message    */
     {bgp_fsm_update,           Established}, /* Receive_UPDATE_message       */
-    {bgp_stop_with_error,         Clearing}, /* Receive_NOTIFICATION_message */
-    {bgp_ignore,                      Idle}, /* Clearing_Completed           */
+    {bgp_stop_with_error,      Clearing}, /* Receive_NOTIFICATION_message */
+    {bgp_ignore,               Idle}, /* Clearing_Completed           */
   },
   {
     /* Clearing, */
-    {bgp_ignore,  Clearing},	/* BGP_Start                    */
-    {bgp_stop,    Clearing},	/* BGP_Stop                     */
-    {bgp_stop,    Clearing},	/* TCP_connection_open          */
-    {bgp_stop,    Clearing},	/* TCP_connection_closed        */
-    {bgp_stop,    Clearing},	/* TCP_connection_open_failed   */
-    {bgp_stop,    Clearing},	/* TCP_fatal_error              */
-    {bgp_ignore,  Clearing},	/* ConnectRetry_timer_expired   */
-    {bgp_ignore,  Clearing},	/* Hold_Timer_expired           */
-    {bgp_ignore,  Clearing},	/* KeepAlive_timer_expired      */
-    {bgp_ignore,  Clearing},	/* Receive_OPEN_message         */
-    {bgp_ignore,  Clearing},	/* Receive_KEEPALIVE_message    */
-    {bgp_ignore,  Clearing},	/* Receive_UPDATE_message       */
-    {bgp_ignore,  Clearing},	/* Receive_NOTIFICATION_message */
-    {bgp_ignore,  Idle    },	/* Clearing_Completed           */
+    {bgp_ignore,   Clearing},	/* BGP_Start                    */
+    {bgp_shutdown, Clearing},	/* BGP_Stop                     */
+    {bgp_shutdown, Clearing},	/* TCP_connection_open          */
+    {bgp_shutdown, Clearing},	/* TCP_connection_closed        */
+    {bgp_shutdown, Clearing},	/* TCP_connection_open_failed   */
+    {bgp_shutdown, Clearing},	/* TCP_fatal_error              */
+    {bgp_shutdown, Clearing},	/* ConnectRetry_timer_expired   */
+    {bgp_shutdown, Clearing},	/* Hold_Timer_expired           */
+    {bgp_shutdown, Clearing},	/* KeepAlive_timer_expired      */
+    {bgp_shutdown, Clearing},	/* Receive_OPEN_message         */
+    {bgp_shutdown, Clearing},	/* Receive_KEEPALIVE_message    */
+    {bgp_shutdown, Clearing},	/* Receive_UPDATE_message       */
+    {bgp_shutdown, Clearing},	/* Receive_NOTIFICATION_message */
+    {bgp_stop,     Idle    },	/* Clearing_Completed           */
   },
   {
     /* Deleted, */
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index d0db6aa..bd96139 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
 <at>  <at>  -426,17 +426,14  <at>  <at>  bgp_fsm_change_status (struct peer *peer, int status)
 		LOOKUP (bgp_status_msg, peer->status));
 }
 
-/* Administrative BGP peer stop event. */
-int
-bgp_stop (struct peer *peer)
+/* Shutdown and release resources */
+static int
+bgp_shutdown (struct peer *peer)
 {
   afi_t afi;
   safi_t safi;
   char orf_name[BUFSIZ];
 
-  /* Delete all existing events of the peer */
-  BGP_EVENT_FLUSH (peer);
-
   /* Increment Dropped count. */
   if (peer->status == Established)
     {
 <at>  <at>  -573,6 +570,20  <at>  <at>  bgp_stop (struct peer *peer)
   return 0;
 }
 
+/* Administrative BGP peer stop event. 
+ *
+ * Also used by bgp_packet to do its peer-swap hack
+ */
+int
+bgp_stop (struct peer *peer) {
+  bgp_shutdown (peer);
+  
+  /* Delete all existing events of the peer */
+  BGP_EVENT_FLUSH (peer);
+  
+  return 0;
+}
+
 /* BGP peer is stoped by the error. */
 static int
 bgp_stop_with_error (struct peer *peer)
 <at>  <at>  -584,7 +595,7  <at>  <at>  bgp_stop_with_error (struct peer *peer)
   if (peer->v_start >= (60 * 2))
     peer->v_start = (60 * 2);
 
-  bgp_stop (peer);
+  bgp_shutdown (peer);
 
   return 0;
 }
 <at>  <at>  -996,36 +1007,36  <at>  <at>  struct {
   {
     /* Established, */
     {bgp_ignore,               Established}, /* BGP_Start                    */
-    {bgp_stop,                    Clearing}, /* BGP_Stop                     */
-    {bgp_stop,                    Clearing}, /* TCP_connection_open          */
-    {bgp_stop,                    Clearing}, /* TCP_connection_closed        */
-    {bgp_ignore,                  Clearing}, /* TCP_connection_open_failed   */
-    {bgp_stop,                    Clearing}, /* TCP_fatal_error              */
-    {bgp_ignore,                  Clearing}, /* ConnectRetry_timer_expired   */
-    {bgp_fsm_holdtime_expire,     Clearing}, /* Hold_Timer_expired           */
+    {bgp_shutdown,             Clearing}, /* BGP_Stop                     */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_open          */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_closed        */
+    {bgp_shutdown,             Clearing}, /* TCP_connection_open_failed   */
+    {bgp_shutdown,             Clearing}, /* TCP_fatal_error              */
+    {bgp_shutdown,             Clearing}, /* ConnectRetry_timer_expired   */
+    {bgp_fsm_holdtime_expire,  Clearing}, /* Hold_Timer_expired           */
     {bgp_fsm_keepalive_expire, Established}, /* KeepAlive_timer_expired      */
-    {bgp_stop,                    Clearing}, /* Receive_OPEN_message         */
+    {bgp_shutdown,             Clearing}, /* Receive_OPEN_message         */
     {bgp_fsm_keepalive,        Established}, /* Receive_KEEPALIVE_message    */
     {bgp_fsm_update,           Established}, /* Receive_UPDATE_message       */
-    {bgp_stop_with_error,         Clearing}, /* Receive_NOTIFICATION_message */
-    {bgp_ignore,                      Idle}, /* Clearing_Completed           */
+    {bgp_stop_with_error,      Clearing}, /* Receive_NOTIFICATION_message */
+    {bgp_ignore,               Idle}, /* Clearing_Completed           */
   },
   {
     /* Clearing, */
-    {bgp_ignore,  Clearing},	/* BGP_Start                    */
-    {bgp_stop,    Clearing},	/* BGP_Stop                     */
-    {bgp_stop,    Clearing},	/* TCP_connection_open          */
-    {bgp_stop,    Clearing},	/* TCP_connection_closed        */
-    {bgp_stop,    Clearing},	/* TCP_connection_open_failed   */
-    {bgp_stop,    Clearing},	/* TCP_fatal_error              */
-    {bgp_ignore,  Clearing},	/* ConnectRetry_timer_expired   */
-    {bgp_ignore,  Clearing},	/* Hold_Timer_expired           */
-    {bgp_ignore,  Clearing},	/* KeepAlive_timer_expired      */
-    {bgp_ignore,  Clearing},	/* Receive_OPEN_message         */
-    {bgp_ignore,  Clearing},	/* Receive_KEEPALIVE_message    */
-    {bgp_ignore,  Clearing},	/* Receive_UPDATE_message       */
-    {bgp_ignore,  Clearing},	/* Receive_NOTIFICATION_message */
-    {bgp_ignore,  Idle    },	/* Clearing_Completed           */
+    {bgp_ignore,   Clearing},	/* BGP_Start                    */
+    {bgp_shutdown, Clearing},	/* BGP_Stop                     */
+    {bgp_shutdown, Clearing},	/* TCP_connection_open          */
+    {bgp_shutdown, Clearing},	/* TCP_connection_closed        */
+    {bgp_shutdown, Clearing},	/* TCP_connection_open_failed   */
+    {bgp_shutdown, Clearing},	/* TCP_fatal_error              */
+    {bgp_shutdown, Clearing},	/* ConnectRetry_timer_expired   */
+    {bgp_shutdown, Clearing},	/* Hold_Timer_expired           */
+    {bgp_shutdown, Clearing},	/* KeepAlive_timer_expired      */
+    {bgp_shutdown, Clearing},	/* Receive_OPEN_message         */
+    {bgp_shutdown, Clearing},	/* Receive_KEEPALIVE_message    */
+    {bgp_shutdown, Clearing},	/* Receive_UPDATE_message       */
+    {bgp_shutdown, Clearing},	/* Receive_NOTIFICATION_message */
+    {bgp_stop,     Idle    },	/* Clearing_Completed           */
   },
   {
     /* Deleted, */
paul | 2 Jun 2009 19:07

[quagga-dev 6615] Re: RFC 5082 GTSM for quagga bgpd

Neat.

Is this the most recent version of the patch?

--paulj

On Tue, 11 Nov 2008, Nick Hilliard wrote:

> Hello,
>
> I've attached a patch set to implement RFC 5082 GTSM for quagga.  This 
> depends on the IP_MINTTL socket option which was implemented by Andre 
> Oppermann:
>
> http://lists.quagga.net/pipermail/quagga-dev/2005-August/003607.html
>
> Implementation
> ==============
>
> The code is implemented using the "neighbor XXX ttl-security hops YYY" 
> command in the BGP router context.  The configuration is fully compatible 
> with the equivalent Cisco IOS commands.  Normally, YYY will be set to be the 
> number of hops between the two bgp neighbors.  The process works as follows:
>
> - all outgoing packets are set up with TTL of "MAXTTL + 1 - gtsm_hops"
> - all incoming packets are checked to ensure that the TTL falls within the 
> hop limit specified in the configuration
>
> Internally, this is implemented by silently using the ebgp-multihop command 
> when ttl-security hops is configured on a neighbor, and by configuring the 
> master BGP listening socket to have a TTL of 255.
>
> The code prohibits ebgp-multihop and ttl-security from being configured 
> together.
>
> I've fixed a very minor bug in peer_ebgp_multihop_set_vty() and 
> peer_ebgp_multihop_unset_vty().  These commands should not return CMD_SUCCESS 
> by default.
>
> If "ttl-security hops" is configured on an operating system which does not 
> support the IP_MINTTL socket option, or if ttl security is enabled on an IPv6 
> socket, then a warning will be logged on the system log.  However, bgpd will 
> accept the configuration.
>
> ttl-security hops is fully peer-group aware (including checking for conflicts 
> with ebgp-multihop).
>
> Usage
> =====
>
> Usage is described in the cisco documentation:
>
> http://www.cisco.com/en/US/docs/ios/12_3t/12_3t7/feature/guide/gt_btsh.html
>
> Under normal circumstances the ttl-security hops parameter should be set to 
> the exact number of hops between the two BGP peers.  So, for directly 
> connected peers, this will be "ttl-security hops 1".
>
> Cisco have also implemented GTSM for OSPF.  I haven't attempted that with 
> this patch, and don't have any plans to do so in future.
>
> Caveats
> =======
>
> -  Right now, this socket option is supported in FreeBSD >= 5.x, OpenBSD 
>> =4.1 and DragonflyBSD >= 2.0.0.  There is a minor bug in all these 
> implementations which is addressed here:
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=128790
>
> -  as there is no equivalent IP6_MINTTL socket option, this only works for 
> IPv4 sockets.
>
> Enjoy,
>
> Nick
>

--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
Hard reality has a way of cramping your style.
 		-- Daniel Dennett
Nick Hilliard | 2 Jun 2009 19:10
Picon

[quagga-dev 6616] Re: RFC 5082 GTSM for quagga bgpd

On 02/06/2009 18:07, paul <at> jakma.org wrote:
> Neat.
>
> Is this the most recent version of the patch?

It is - I'm running a patched 0.9.10 internally, but it shouldn't be too 
much work to port to the latest git head.

Nick
paul | 2 Jun 2009 19:35

[quagga-dev 6617] Re: [PATCH] 64-bit fix for lib/smux.h SNMP_INTEGER() macro

Applying thanks.

However, looking at how SNMP_INTEGER is used in Quagga - what's the 
point of the extra variables and the var_len variable? It doesn't 
seem useful at all, should it be ripped out?

--paulj

On Mon, 22 Dec 2008, Chris Caputo wrote:

> Macro SNMP_INTEGER() prepares data which is eventually processed
> by asn_build_int().  SNMP_INTEGER() was using "int32_t" whereas
> asn_build_int() uses "long".  On 32-bit systems these are the
> same, both 4 bytes, but on x86 64-bit systems "long" is 8 bytes.
>
> asn_build_int()'s reaction to an improperly sized value is to return
> a NULL pointer.  Quagga's smux.c would eventually get this NULL
> pointer and use it in calculations to determine how much data to send
> over the smux connection, resulting in garbage being sent to the
> SNMP agent.
>
> Corrected SNMP_INTEGER() to use "long".
>
> Tested on 32-bit and 64-bit x86 Linux 2.6.27.10 systems running
> Quagga 0.99.11 with bgpd smux.
> ---
> lib/smux.h |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/smux.h b/lib/smux.h
> index 79d23e7..bab3587 100644
> --- a/lib/smux.h
> +++ b/lib/smux.h
>  <at>  <at>  -127,12 +127,12  <at>  <at>  struct trap_object
>
> /* Declare SMUX return value. */
> #define SNMP_LOCAL_VARIABLES \
> -  static int32_t snmp_int_val; \
> +  static long snmp_int_val; \
>   static struct in_addr snmp_in_addr_val;
>
> #define SNMP_INTEGER(V) \
>   ( \
> -    *var_len = sizeof (int32_t), \
> +    *var_len = sizeof (snmp_int_val), \
>     snmp_int_val = V, \
>     (u_char *) &snmp_int_val \
>   )
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev <at> lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>

--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
Even if you're on the right track, you'll get run over if you just sit there.
 		-- Will Rogers
paul | 2 Jun 2009 19:48

[quagga-dev 6618] Re: [PATCH] Compiler warning fixes for when "--enable-snmp" is configured.

Applied, thanks.

Though, is it necessary to cast a (const char *) to (char *) for 
strlen? strlen seems to take (const char *) on both SNV and Glibc 
(not checked FBSD - must try get some FBSD images running soon).

regards,
--

-- 
Paul Jakma	paul <at> clubi.ie	paul <at> jakma.org	Key ID: 64A2FF6A
Fortune:
Real Programs don't use shared text.  Otherwise, how can they use functions
for scratch space after they are finished calling them?

Gmane