]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bridge_snmp.h
authorbz <bz@FreeBSD.org>
Fri, 29 Dec 2006 19:23:38 +0000 (19:23 +0000)
committerbz <bz@FreeBSD.org>
Fri, 29 Dec 2006 19:23:38 +0000 (19:23 +0000)
commit999db60bea69bac2697a664720778809a734add1
treed75d4e3baa69ac0a30b995e0e917904e3fe9c258
parent7c57814bdcf673bb4e3961b662c3dbf11a8f9c7e
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
usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.h
usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c