Date: Tue, 15 Aug 2000 22:08:06 -0500 From: Jon Hamilton <hamilton@pobox.com> To: freebsd-bugs@freebsd.org Subject: pccardd logging NULL junk to syslog [patch] Message-ID: <20000816030806.157431E2@woodstock.monkey.net> In-Reply-To: Your message of "Wed, 16 Aug 2000 18:36:17 -0000." <20000816183617.D0C8437B5C0@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I tried to send-pr this, but it bounced: } <FreeBSD-gnats-submit@freebsd.org>: unknown user: "freebsd-gnats-submit" Anyway, here is a patch which fixes some cosmetic problems with the logging done by pccardd. >Submitter-Id: current-users >Originator: Jon Hamilton >Organization: >Confidential: no >Synopsis: pccardd logging NULL junk to syslog [patch] >Severity: non-critical >Priority: low >Category: bin<[ advocacy | alpha | bin | conf | docs | gnu | i386 | ke rn | misc | ports | sparc ]> >Release: FreeBSD 4.1-STABLE i386 >Class: sw-bug >Environment: >Description: If a pccard does not have "additional info" in its CIS, pccardd will log a string to syslog containing NULLs. Additionally, it will log a message "No matching card for..." when in fact there is no card, and no message should be logged. Patch follows. >How-To-Repeat: Start pccardd with a card which has no info in its CIS for the additional info fields (e.g. newer versions of the Netgear FA-410TX). >Fix: Index: cardd.c =================================================================== RCS file: /export/freebsd-cvs/src/usr.sbin/pccard/pccardd/cardd.c,v retrieving revision 1.46.2.4 diff -u -r1.46.2.4 cardd.c --- cardd.c 2000/07/18 04:59:39 1.46.2.4 +++ cardd.c 2000/08/16 01:17:00 @@ -291,15 +291,16 @@ cis_strcmp(cp->add_info2, sp->cis->add_info2) != 0) { break; } logmsg("Card \"%s\"(\"%s\") " "[%s] [%s] " "matched \"%s\" (\"%s\") " "[%s] [%s] ", sp->cis->manuf, sp->cis->vers, - sp->cis->add_info1, sp->cis->add_info2, + sp->cis->add_info1 == NULL ? "" : sp->cis-> add_info1, + sp->cis->add_info2 == NULL ? "" : sp->cis-> add_info2, cp->manuf, cp->version, - cp->add_info1, cp->add_info2); + cp->add_info1 == NULL ? "" : cp->add_info1, + cp->add_info2 == NULL ? "" : cp->add_info2) ; goto escape; } break; @@ -325,8 +326,10 @@ reset_slot(sp); #endif if (cp == 0) { - logmsg("No card in database for \"%s\"(\"%s\")", - sp->cis->manuf, sp->cis->vers); + if(sp->cis->manuf != NULL){ + logmsg("No card in database for \"%s\"(\"%s\")", + sp->cis->manuf, sp->cis->vers); + } return; } if (sp->cis->lan_nid && sp->cis->lan_nid[0] == sizeof(sp->eaddr)) { -- Jon Hamilton hamilton@pobox.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000816030806.157431E2>