]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r310586,r310587,r310588:
authorngie <ngie@FreeBSD.org>
Fri, 13 Jan 2017 09:11:11 +0000 (09:11 +0000)
committerngie <ngie@FreeBSD.org>
Fri, 13 Jan 2017 09:11:11 +0000 (09:11 +0000)
commit9157d26f8d68bde336c5e7d215a8f841aa5b6863
tree9e54a1b7400f864d38f802ecb16c89449ba15f6d
parent17877d8b7a368c9fda358f0c69c564aff964fccf
MFC r310586,r310587,r310588:

r310586:

Refactor transport sources a bit to facilitate changes coming down pipeline

Add recv callback to transport layer to better facilitate code reuse and
readability and for symmetry with send callback. Move recv_dgram and
recv_stream to udp_recv and lsock_recv, respectively, and make the
beforementioned functions recv callbacks for the udp and lsock transports,
respectively.

Consolidate the check_priv* functions in their relevant trans*.c source to
limit scope/use.

Note: this code is roughly based content from the submitter, although this
was modified to be more of a direct move from snmpd/main.c to the trans_*.c
sources, and to reduce unnecessary static function declarations.

r310587:

Fix definition for recv_dgram(..); it should be "ssize_t", not "int"

I'm not sure why this wasn't flagged as an issue by the compiler, yet

r310588:

Fix return type for `ret` (recv callback) and sort variables by alignment

Again, for reasons I don't yet understand, this is not being flagged by the
compiler. Unlike the issue addressed in r310587, this problem existed prior
to r310586
contrib/bsnmp/snmpd/main.c
contrib/bsnmp/snmpd/snmpd.h
contrib/bsnmp/snmpd/trans_lsock.c
contrib/bsnmp/snmpd/trans_udp.c