Mercurial > hg > freeDiameter
changeset 512:16224de837fd
Fix problem reported by ????? ????????? on dev@freediameter.net
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 24 Aug 2010 16:20:10 +0900 |
parents | 17435072de36 |
children | 662b1f9258c3 |
files | freeDiameter/endpoints.c include/freeDiameter/libfreeDiameter.h |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/freeDiameter/endpoints.c Fri Aug 20 15:18:58 2010 +0900 +++ b/freeDiameter/endpoints.c Tue Aug 24 16:20:10 2010 +0900 @@ -73,9 +73,8 @@ if (! (flags & EP_ACCEPTALL)) { if (IN_IS_ADDR_UNSPECIFIED(&ptr.sin->sin_addr) || IN_IS_ADDR_LOOPBACK(&ptr.sin->sin_addr) - || IN_MULTICAST(ptr.sin->sin_addr.s_addr) - || IN_EXPERIMENTAL(ptr.sin->sin_addr.s_addr) - || IN_BADCLASS(ptr.sin->sin_addr.s_addr) + /* the next one filters both EXPERIMENTAL, BADCLASS and MULTICAST. */ + || (((ptr.sin->sin_addr.s_addr) & ntohl(0xe0000000)) == ntohl(0xe0000000)) || (ptr.sin->sin_addr.s_addr == INADDR_BROADCAST)) { if (TRACE_BOOL(ANNOYING + 1)) { TRACE_DEBUG(ANNOYING, " DEBUG:fd_ep_add_merge Address was ignored, not added.");
--- a/include/freeDiameter/libfreeDiameter.h Fri Aug 20 15:18:58 2010 +0900 +++ b/include/freeDiameter/libfreeDiameter.h Tue Aug 24 16:20:10 2010 +0900 @@ -484,6 +484,10 @@ #define INADDR_LOOPBACK inet_addr("127.0.0.1") #endif /* INADDR_LOOPBACK */ +#ifndef INADDR_BROADCAST +#define INADDR_BROADCAST ((in_addr_t) 0xffffffff) +#endif /* INADDR_BROADCAST */ + /* An IP equivalent to IN6_IS_ADDR_LOOPBACK */ #ifndef IN_IS_ADDR_LOOPBACK #define IN_IS_ADDR_LOOPBACK(a) \