Improved Solaris support

This commit is contained in:
jjako 2004-01-16 11:05:22 +00:00
parent 1d3db978f4
commit ff9985cb36
5 changed files with 32 additions and 16 deletions

2
NEWS
View File

@ -7,7 +7,7 @@ Copyright (C) 2002, 2003 Mondru AB.
Version 0.8
===========
* Solaris support.
* Support for compilation under Solaris.
* Iptables firewall script.
Version 0.7

10
README
View File

@ -9,11 +9,11 @@ QuickStart
Requirements
------------
*Linux*
OpenGGSN was developed and tested using Redhat 8.0 and 9.0 and Solaris
2.8. It should run also on other Linux distributions as well as
FreeBSD, but this is untested. Please tell me of any
testing results.
*Linux*
OpenGGSN was developed and tested using Redhat 8.0 and 9.0. It should
run also on other Linux distributions as well as FreeBSD, but this is
untested. Compilation on Solaris 2.8 has also been verified. Please
tell me of any testing results.
*Tun*
The tun driver is required for proper operation of openggsn. For linux

17
acinclude.m4 Normal file
View File

@ -0,0 +1,17 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/adl_func_getopt_long.html
dnl
AC_DEFUN([adl_FUNC_GETOPT_LONG],
[AC_PREREQ(2.49)dnl
# clean out junk possibly left behind by a previous configuration
rm -f lib/getopt.h
# Check for getopt_long support
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_FUNCS([getopt_long],,
[# FreeBSD has a gnugetopt library for this
AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
[# use the GNU replacement
AC_LIBOBJ(getopt)
AC_LIBOBJ(getopt1)
AC_CONFIG_LINKS([ggsn/getopt.h:ggsn/gnugetopt.h])
AC_CONFIG_LINKS([sgsnemu/getopt.h:sgsnemu/gnugetopt.h])])])])

View File

@ -47,6 +47,8 @@
#include <time.h>
#include "config.h"
#include "tun.h"
#include "ippool.h"
#include "syserr.h"
@ -328,7 +330,7 @@ int main(int argc, char **argv)
}
/* DNS1 and DNS2 */
#ifndef HAVE_INET_ATON
#ifdef HAVE_INET_ATON
dns1.s_addr = 0;
if (args_info.pcodns1_arg) {
if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) {
@ -346,11 +348,10 @@ int main(int argc, char **argv)
}
}
#else
#ifndef HAVE_INET_ADDR
dns1.s_addr = 0;
if (args_info.pcodns1_arg) {
dns1 = inet_addr(args_info.pcodns1_arg);
if (dns1.s_addr == INADDR_NONE) {
dns1.s_addr = inet_addr(args_info.pcodns1_arg);
if (dns1.s_addr == -1) {
sys_err(LOG_ERR, __FILE__, __LINE__, 0,
"Failed to convert pcodns1!");
exit(1);
@ -358,16 +359,13 @@ int main(int argc, char **argv)
}
dns2.s_addr = 0;
if (args_info.pcodns2_arg) {
dns2 = inet_addr(args_info.pcodns2_arg);
if (dns2.s_addr == INADDR_NONE) {
dns2.s_addr = inet_addr(args_info.pcodns2_arg);
if (dns2.s_addr == -1) {
sys_err(LOG_ERR, __FILE__, __LINE__, 0,
"Failed to convert pcodns2!");
exit(1);
}
}
#else
#error Function missing!
#endif
#endif

View File

@ -48,6 +48,7 @@
#include <resolv.h>
#include <time.h>
#include "config.h"
#include "tun.h"
#include "ippool.h"
#include "syserr.h"
@ -932,7 +933,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) {
if ((options.createif) && (!options.net.s_addr)) {
struct in_addr m;
#ifndef HAVE_INET_ATON
#ifdef HAVE_INET_ATON
inet_aton("255.255.255.255", &m);
#else
m.s_addr = INADDR_NONE;