aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/network.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-07 07:58:56 +0000
committerMartin Storsjö <martin@martin.st>2010-10-07 07:58:56 +0000
commit55b6bd1c01be167f0fcea2ec181d644e24c31454 (patch)
treeee1f2c3cd4008d12b54f53ca9ffbcd4d4b9081bc /libavformat/network.h
parent7ac57fa5eb117d43f95be80acd9df310eecc6d07 (diff)
downloadffmpeg-55b6bd1c01be167f0fcea2ec181d644e24c31454.tar.gz
Convert ff_is_multicast_address to take a struct sockaddr parameter
Not all users of this function will have a full struct sockaddr_storage available, and casting other sockaddrs to sockaddr_storage is wrong, while any sockaddr can be cast to a base sockaddr. Originally committed as revision 25388 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/network.h')
-rw-r--r--libavformat/network.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/network.h b/libavformat/network.h
index 1ad7319649..d6aee93121 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -162,13 +162,13 @@ const char *ff_gai_strerror(int ecode);
#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
#endif
-static inline int ff_is_multicast_address(struct sockaddr_storage *addr)
+static inline int ff_is_multicast_address(struct sockaddr *addr)
{
- if (addr->ss_family == AF_INET) {
+ if (addr->sa_family == AF_INET) {
return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
}
#if HAVE_STRUCT_SOCKADDR_IN6
- if (addr->ss_family == AF_INET6) {
+ if (addr->sa_family == AF_INET6) {
return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
}
#endif