diff options
author | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-12-19 11:16:19 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-12-19 11:17:28 -0500 |
commit | 45d93c6d1c2373ba9bc93382ca801e4713d39f6d (patch) | |
tree | 04b3b661749e5e0c3bdb637747c8f759e7f3ad4b /noport.c | |
parent | 9f2cb9776b2e1f69529784d1dd0f07e0ece4e72d (diff) | |
download | krb5-45d93c6d1c2373ba9bc93382ca801e4713d39f6d.tar.gz krb5-45d93c6d1c2373ba9bc93382ca801e4713d39f6d.tar.xz krb5-45d93c6d1c2373ba9bc93382ca801e4713d39f6d.zip |
Enable pyrad-based tests
- update a test wrapper to properly handle things that the new libkrad does,
and add python-pyrad as a build requirement so that we can run its tests
Diffstat (limited to 'noport.c')
-rw-r--r-- | noport.c | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -87,21 +87,25 @@ sendto(int sockfd, const void *buf, size_t len, int flags, return next_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } - switch (dest_addr->sa_family) { - case AF_INET: - port = ntohs(((struct sockaddr_in *)dest_addr)->sin_port); - if (port_is_okay(port) != 0) { - return -1; - } - break; - case AF_INET6: - port = ntohs(((struct sockaddr_in6 *)dest_addr)->sin6_port); - if (port_is_okay(port) != 0) { - return -1; + if (dest_addr != NULL) { + switch (dest_addr->sa_family) { + case AF_INET: + port = ((struct sockaddr_in *)dest_addr)->sin_port; + port = ntohs(port); + if (port_is_okay(port) != 0) { + return -1; + } + break; + case AF_INET6: + port = ((struct sockaddr_in6 *)dest_addr)->sin6_port; + port = ntohs(port); + if (port_is_okay(port) != 0) { + return -1; + } + break; + default: + break; } - break; - default: - break; } return next_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } |