FreeBSD Bugzilla – Attachment 41961 Details for
Bug 65501
[MAINTAINER] net-mgmt/arpwatch-devel: dns resolution bug
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.02 KB, created by
Matthew George
on 2004-04-13 20:20:19 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Matthew George
Created:
2004-04-13 20:20:19 UTC
Size:
3.02 KB
patch
obsolete
>--- patch-ai.orig Tue Mar 30 04:11:56 2004 >+++ patch-ai Tue Apr 13 14:41:13 2004 >@@ -1,22 +1,22 @@ > --- db.c.orig Sat Sep 30 19:39:58 2000 >-+++ db.c Mon Mar 29 14:26:14 2004 >++++ db.c Tue Apr 13 14:39:50 2004 > @@ -41,6 +41,7 @@ > #include <string.h> > #include <syslog.h> > #include <unistd.h> > +#include <pthread.h> >- >+ > #include "gnuc.h" > #ifdef HAVE_OS_PROTO_H > @@ -54,18 +55,9 @@ > #include "report.h" > #include "util.h" >- >+ > -#define HASHSIZE (2 << 15) > - > #define NEWACTIVITY_DELTA (6*30*24*60*60) /* 6 months in seconds */ > #define FLIPFLIP_DELTA (24*60*60) /* 24 hours in seconds */ >- >+ > -/* Ethernet info */ > -struct einfo { > - u_char e[6]; /* ether address */ >@@ -30,7 +30,7 @@ > @@ -78,22 +70,69 @@ > /* Address hash table */ > static struct ainfo ainfo_table[HASHSIZE]; >- >+ > + > +/* Ethernet hash table */ > +struct einfo einfo_table[HASHSIZE]; >@@ -44,7 +44,7 @@ > +static struct einfo *einfo_find(u_char *); > static void check_hname(struct ainfo *); > struct ainfo *newainfo(void); >- >+ > +pthread_mutex_t mtx_einfo, mtx_ainfo; > + > int >@@ -75,7 +75,7 @@ > + BCOPY(e, ep->e, sizeof(ep->e)); > + if (h == NULL) > + h = getsname(a); >-+ if (h != NULL && !isdigit((int)*h)) >++ if (h != NULL) > + strncpy(ep->h, h, sizeof(ep->h)); > + ep->t = t; > + strncpy(ep->iface, interface, sizeof(ep->iface)); >@@ -97,7 +97,7 @@ > + > + pthread_mutex_unlock(&mtx_einfo); > + pthread_mutex_lock(&mtx_ainfo); >- >+ > /* Lookup ip address */ > ap = ainfo_find(a); > @@ -101,28 +140,30 @@ >@@ -117,7 +117,7 @@ > - return (1); > } > } >- >+ > /* Check for a virgin ainfo record */ > if (ap->ecount == 0) { > ap->ecount = 1; >@@ -129,7 +129,7 @@ > + e2 = NULL; > + t2 = 0; > } >- >+ > /* Check for a flip-flop */ > if (ap->ecount > 1) { > ep = ap->elist[1]; >@@ -160,7 +160,7 @@ > - return (1); > } > } >- >+ > for (i = 2; i < ap->ecount; ++i) { > ep = ap->elist[i]; > - if (MEMCMP(e, ep->e, 6) == 0) { >@@ -180,7 +180,7 @@ > - return (1); > } > } >- >+ > - /* New ether address */ > - e2 = ap->elist[0]->e; > - t2 = ap->elist[0]->t; >@@ -230,7 +230,7 @@ > + > + return(NULL); > } >- >+ > static struct ainfo * > @@ -259,7 +328,7 @@ > /* Allocate and initialize a elist struct */ >@@ -242,15 +242,16 @@ > register struct einfo *ep; > register u_int size; > @@ -280,12 +349,16 @@ >- >+ > ep = elist++; > --eleft; > - BCOPY(e, ep->e, 6); > + BCOPY(e, ep->e, sizeof(ep->e)); > if (h == NULL && !initializing) > h = getsname(a); >- if (h != NULL && !isdigit((int)*h)) >+- if (h != NULL && !isdigit((int)*h)) > - strcpy(ep->h, h); >++ if (h != NULL) > + strncpy(ep->h, h, sizeof(ep->h)); > ep->t = t; > + >@@ -259,13 +260,17 @@ > + > return (ep); > } >- >-@@ -304,7 +377,7 @@ >- if (!isdigit((int)*h) && strcmp(h, ep->h) != 0) { >+ >+@@ -301,10 +374,10 @@ >+ return; >+ ep = ap->elist[0]; >+ h = getsname(ap->a); >+- if (!isdigit((int)*h) && strcmp(h, ep->h) != 0) { >++ if (h != NULL && strcmp(h, ep->h) != 0) { > syslog(LOG_INFO, "hostname changed %s %s %s -> %s", > intoa(ap->a), e2str(ep->e), ep->h, h); > - strcpy(ep->h, h); > + strncpy(ep->h, h, sizeof(ep->h)); > } > } >- >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 65501
: 41961 |
41962
|
41963