Skip to content

Commit

Permalink
libsnmp, Unix transport: Fix the definition of SUN_LEN()
Browse files Browse the repository at this point in the history
Fixes: e498db9 ("CHANGES: moved transport code into a separate subdirectory in snmplib")
  • Loading branch information
bvanassche committed Sep 16, 2022
1 parent 43d541d commit 504f985
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions snmplib/transports/snmpUnixDomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all);
#define NETSNMP_STREAM_QUEUE_LEN 5
#endif

#ifndef SUN_LEN
#undef SUN_LEN
/*
* Evaluate to actual length of the `sockaddr_un' structure.
*/
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
#define SUN_LEN(ptr) ((size_t)&(((struct sockaddr_un *)NULL)->sun_path) \
+ strlen ((ptr)->sun_path))
#endif

const oid netsnmp_UnixDomain[] = { TRANSPORT_DOMAIN_LOCAL };
static netsnmp_tdomain unixDomain;
Expand Down

0 comments on commit 504f985

Please sign in to comment.