Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
241fa9c6
Commit
241fa9c6
authored
Nov 22, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove arc4random, we have a good RNG and it's a portability problem.
parent
e142a832
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
37 deletions
+0
-37
src/config.h
src/config.h
+0
-13
src/util.c
src/util.c
+0
-24
No files found.
src/config.h
View file @
241fa9c6
...
@@ -189,10 +189,6 @@ HAVE_SOLARIS_NETWORK
...
@@ -189,10 +189,6 @@ HAVE_SOLARIS_NETWORK
HAVE_GETOPT_LONG
HAVE_GETOPT_LONG
defined when GNU-style getopt_long available.
defined when GNU-style getopt_long available.
HAVE_ARC4RANDOM
defined if arc4random() available to get better security from DNS spoofs
by using really random ids (OpenBSD)
HAVE_SOCKADDR_SA_LEN
HAVE_SOCKADDR_SA_LEN
defined if struct sockaddr has sa_len field (*BSD)
defined if struct sockaddr has sa_len field (*BSD)
*/
*/
...
@@ -201,7 +197,6 @@ HAVE_SOCKADDR_SA_LEN
...
@@ -201,7 +197,6 @@ HAVE_SOCKADDR_SA_LEN
#if defined(__uClinux__)
#if defined(__uClinux__)
#define HAVE_LINUX_NETWORK
#define HAVE_LINUX_NETWORK
#define HAVE_GETOPT_LONG
#define HAVE_GETOPT_LONG
#undef HAVE_ARC4RANDOM
#undef HAVE_SOCKADDR_SA_LEN
#undef HAVE_SOCKADDR_SA_LEN
/* Never use fork() on uClinux. Note that this is subtly different from the
/* Never use fork() on uClinux. Note that this is subtly different from the
--keep-in-foreground option, since it also suppresses forking new
--keep-in-foreground option, since it also suppresses forking new
...
@@ -215,7 +210,6 @@ HAVE_SOCKADDR_SA_LEN
...
@@ -215,7 +210,6 @@ HAVE_SOCKADDR_SA_LEN
((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21))
((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21))
# define HAVE_GETOPT_LONG
# define HAVE_GETOPT_LONG
#endif
#endif
#undef HAVE_ARC4RANDOM
#undef HAVE_SOCKADDR_SA_LEN
#undef HAVE_SOCKADDR_SA_LEN
#if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__)
#if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__)
# define NO_FORK
# define NO_FORK
...
@@ -230,7 +224,6 @@ HAVE_SOCKADDR_SA_LEN
...
@@ -230,7 +224,6 @@ HAVE_SOCKADDR_SA_LEN
#elif defined(__linux__)
#elif defined(__linux__)
#define HAVE_LINUX_NETWORK
#define HAVE_LINUX_NETWORK
#define HAVE_GETOPT_LONG
#define HAVE_GETOPT_LONG
#undef HAVE_ARC4RANDOM
#undef HAVE_SOCKADDR_SA_LEN
#undef HAVE_SOCKADDR_SA_LEN
#elif defined(__FreeBSD__) || \
#elif defined(__FreeBSD__) || \
...
@@ -242,15 +235,11 @@ HAVE_SOCKADDR_SA_LEN
...
@@ -242,15 +235,11 @@ HAVE_SOCKADDR_SA_LEN
#if defined(optional_argument) && defined(required_argument)
#if defined(optional_argument) && defined(required_argument)
# define HAVE_GETOPT_LONG
# define HAVE_GETOPT_LONG
#endif
#endif
#if !defined(__FreeBSD_kernel__)
# define HAVE_ARC4RANDOM
#endif
#define HAVE_SOCKADDR_SA_LEN
#define HAVE_SOCKADDR_SA_LEN
#elif defined(__APPLE__)
#elif defined(__APPLE__)
#define HAVE_BSD_NETWORK
#define HAVE_BSD_NETWORK
#define HAVE_GETOPT_LONG
#define HAVE_GETOPT_LONG
#define HAVE_ARC4RANDOM
#define HAVE_SOCKADDR_SA_LEN
#define HAVE_SOCKADDR_SA_LEN
/* Define before sys/socket.h is included so we get socklen_t */
/* Define before sys/socket.h is included so we get socklen_t */
#define _BSD_SOCKLEN_T_
#define _BSD_SOCKLEN_T_
...
@@ -261,13 +250,11 @@ HAVE_SOCKADDR_SA_LEN
...
@@ -261,13 +250,11 @@ HAVE_SOCKADDR_SA_LEN
#elif defined(__NetBSD__)
#elif defined(__NetBSD__)
#define HAVE_BSD_NETWORK
#define HAVE_BSD_NETWORK
#define HAVE_GETOPT_LONG
#define HAVE_GETOPT_LONG
#undef HAVE_ARC4RANDOM
#define HAVE_SOCKADDR_SA_LEN
#define HAVE_SOCKADDR_SA_LEN
#elif defined(__sun) || defined(__sun__)
#elif defined(__sun) || defined(__sun__)
#define HAVE_SOLARIS_NETWORK
#define HAVE_SOLARIS_NETWORK
#define HAVE_GETOPT_LONG
#define HAVE_GETOPT_LONG
#undef HAVE_ARC4RANDOM
#undef HAVE_SOCKADDR_SA_LEN
#undef HAVE_SOCKADDR_SA_LEN
#define ETHER_ADDR_LEN 6
#define ETHER_ADDR_LEN 6
...
...
src/util.c
View file @
241fa9c6
...
@@ -28,28 +28,6 @@
...
@@ -28,28 +28,6 @@
#include <idna.h>
#include <idna.h>
#endif
#endif
#ifdef HAVE_ARC4RANDOM
void
rand_init
(
void
)
{
return
;
}
unsigned
short
rand16
(
void
)
{
return
(
unsigned
short
)
(
arc4random
()
>>
15
);
}
u64
rand64
(
void
)
{
u64
ret
;
arc4random_buf
(
&
ret
,
sizeof
(
ret
));
return
ret
;
}
#else
/* SURF random number generator */
/* SURF random number generator */
static
u32
seed
[
32
];
static
u32
seed
[
32
];
...
@@ -119,8 +97,6 @@ u64 rand64(void)
...
@@ -119,8 +97,6 @@ u64 rand64(void)
return
(
u64
)
out
[
outleft
+
1
]
+
(((
u64
)
out
[
outleft
])
<<
32
);
return
(
u64
)
out
[
outleft
+
1
]
+
(((
u64
)
out
[
outleft
])
<<
32
);
}
}
#endif
static
int
check_name
(
char
*
in
)
static
int
check_name
(
char
*
in
)
{
{
/* remove trailing .
/* remove trailing .
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment