diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-10-31 20:50:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:23 -0500 |
commit | 898f9c8bcca04320d64963a87ea3bca81113bf6f (patch) | |
tree | a127d64080a7b9fbe1071631cb58de92a4dc0fbb /src/common/address.c | |
parent | cac5335195d3bb9a39af77886992ffa98b8c7817 (diff) | |
download | tor-898f9c8bcca04320d64963a87ea3bca81113bf6f.tar.gz tor-898f9c8bcca04320d64963a87ea3bca81113bf6f.zip |
Add a function to set a tor_addr_t to a null address
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/address.c b/src/common/address.c index 3f00c1e617..7a2ce6eef8 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -181,6 +181,14 @@ tor_addr_make_unspec(tor_addr_t *a) a->family = AF_UNSPEC; } +/** DOCDOC */ +void +tor_addr_make_null(tor_addr_t *a, sa_family_t family) +{ + memset(a, 0, sizeof(*a)); + a->family = family; +} + /** Similar behavior to Unix gethostbyname: resolve <b>name</b>, and set * *<b>addr</b> to the proper IP address and family. The <b>family</b> * argument (which must be AF_INET, AF_INET6, or AF_UNSPEC) declares a |