On Sat, Mar 17, 2007 at 03:08:21PM +0000, Jon Morby wrote:
> On 17 Mar 2007, at 14:48, Jon Morby wrote:
> 
> > Doing an ospfctl reload seems to result in problems with simple  
> > authentication enabled
> >
> > Mar 17 14:44:14 l2-c1 ospfd[7096]: recv_packet: authentication  
> > error, interface vlan544
> > Mar 17 14:44:45 l2-c1 last message repeated 213 times
> >
> > Checking tcpdump it seems that the password is being passed but  
> > truncated as 7 characters plus a null character instead of the full  
> > 8 character password
> >
> > This is with -current
> >
> 
> Apologies, I forgot to paste the config and results from our lab machine
> 
> 15:04:59.942992 0:d:93:4e:30:8a 1:0:5e:0:0:5 0800 78: 84.246.195.116  
>  > 224.0.0.5: OSPFv2-hello 44: backbone auth "passwor^@" E mask  
> 255.255.255.248 int 10 pri 1 dead 40 dr 84.246.195.116 nbrs [tos  
> 0xc0] [ttl 1] (id 51672, len 64)
> 
> 
> Mar 17 15:02:29 stats ospfd[4412]: recv_packet: authentication error,  
> interface gem0
> Mar 17 15:03:09 stats last message repeated 4 times
> Mar 17 15:05:19 stats last message repeated 13 times
> 
> ospfd.conf
> 
> area 0.0.0.0 {
>          interface gem0 {
>                  auth-type simple
>                  auth-key password
>          }
> }
> 
> If I pkill ospfd and run ospfd from cold everything sync's fine.   
> It's just when we do an ospfctl reload
> 

Can you try this diff?

-- 
:wq Claudio

Index: ospfd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v
retrieving revision 1.42
diff -u -p -r1.42 ospfd.c
--- ospfd.c     16 Mar 2007 10:56:31 -0000      1.42
+++ ospfd.c     17 Mar 2007 15:40:28 -0000
@@ -765,7 +765,7 @@ merge_interfaces(struct area *a, struct 
                i->linkstate = xi->linkstate; /* needed? */
 
                i->auth_type = xi->auth_type;
-               strlcpy(i->auth_key, xi->auth_key, MAX_SIMPLE_AUTH_LEN);
+               strncpy(i->auth_key, xi->auth_key, MAX_SIMPLE_AUTH_LEN);
                md_list_clr(&i->auth_md_list);
                md_list_copy(&i->auth_md_list, &xi->auth_md_list);

Reply via email to