From: Ian Jackson Date: Sat, 28 Jun 2014 13:26:56 +0000 (+0100) Subject: comm_if: Define the meaning of ->sendmsg returning false X-Git-Tag: base.polypath.v1~30 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=3183f7f609609bf234d9162cfbf0b319767c2e86;hp=ff8034f3369f5dee896cb1536a0c3bd1d94bd953 comm_if: Define the meaning of ->sendmsg returning false site's transport logic is going to want to know when a failure occurs which is attributable to the address being unsuitable for the local network environment (eg v4 address on v6-only host). Use the boolean return value from sendmsg for that. At the moment all the callers ignore the return value, and the only actual sendmsg function always returns true. This is consistent with the new semantics. Therefore, no functional change in this patch. Signed-off-by: Ian Jackson --- diff --git a/secnet.h b/secnet.h index f0ab80b..b01c485 100644 --- a/secnet.h +++ b/secnet.h @@ -338,6 +338,9 @@ typedef void comm_release_notify_fn(void *commst, void *nst, comm_notify_fn *fn); typedef bool_t comm_sendmsg_fn(void *commst, struct buffer_if *buf, const struct comm_addr *dest); + /* Only returns false if (we know that) the local network + * environment is such that this address cannot work; transient + * or unknown/unexpected failures return true. */ typedef const char *comm_addr_to_string_fn(void *commst, const struct comm_addr *ca); /* Returned string is in a static buffer. */