From owner-cvs-all@FreeBSD.ORG Fri Dec 29 19:23:39 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36FCA16A40F; Fri, 29 Dec 2006 19:23:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 2760B13C44C; Fri, 29 Dec 2006 19:23:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBTJNdME008896; Fri, 29 Dec 2006 19:23:39 GMT (envelope-from bz@repoman.freebsd.org) Received: (from bz@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBTJNdcp008894; Fri, 29 Dec 2006 19:23:39 GMT (envelope-from bz) Message-Id: <200612291923.kBTJNdcp008894@repoman.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 29 Dec 2006 19:23:38 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/usr.sbin/bsnmpd/modules/snmp_bridge bridge_if.c bridge_snmp.h bridge_sys.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2006 19:23:39 -0000 bz 2006-12-29 19:23:38 UTC FreeBSD src repository Modified files: usr.sbin/bsnmpd/modules/snmp_bridge bridge_if.c bridge_snmp.h bridge_sys.c Log: bridge_snmp.h * Change the API of bridge_get_basemac to take a maximum buffer length. bridge_if.c * Adopt to new API. * In bridge_attach_newif() remove an additional pointer to the buffer by shuffling the code a bit. Also makes the code more readable. bridge_sys.c * bridge_get_basemac(): - Adopt to the new API. - Change check for error code of getifaddrs(). - First check for sa_family != AF_LINK. - Copy sockaddr_dl * to get around alignment constraints on some platforms. - Use strcmp instead of strncmp so that "foo11" != "foo1". * other functions: - Allocate n times of the struct we need instead of arbitrary len, cast to the type we want it to be and pass around struct *s instead of char *s. This gets us around alignment restrictions on some platforms and in addition it is more clear what data is passed around. - Name variables for same types consistently. Reviewed by: syrinx Revision Changes Path 1.6 +12 -9 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c 1.4 +1 -1 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.h 1.5 +77 -65 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c