aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--gtp/gtp.c3
-rw-r--r--sgsnemu/sgsnemu.c8
3 files changed, 7 insertions, 6 deletions
diff --git a/README b/README
index 6a4f576..340f715 100644
--- a/README
+++ b/README
@@ -67,7 +67,7 @@ file. A sample file is provided in examples/sgsnemu.conf.
Edit the configuration file ggsn.conf found under openggsn/examples.
Start the ggsn as root using the command:
-ggsn --fg -c examples/ggsn.conf -l 10.0.0.40 --statedir .
+ggsn --fg -c examples/ggsn.conf -l 10.0.0.40 --statedir ./
This will run the ggsn in foreground using the local interface
10.0.0.40. If you don't have a GSM network available for testing you
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 6f94aa5..fd2105f 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -688,7 +688,8 @@ static void log_restart(struct gsn_t *gsn) {
/* We try to open file. On failure we will later try to create file */
if (!(f = fopen(filename, "r"))) {
- gtp_err(LOG_ERR, __FILE__, __LINE__, "fopen(path=%s, mode=%s) failed: Error = %s", filename, "r", strerror(errno));
+
+ gtp_err(LOG_ERR, __FILE__, __LINE__, "State information file (%s) not found. Creating new file.", filename);
}
else {
umask(i);
diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 8187163..9befbfb 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -78,7 +78,7 @@ struct iphash_t *iphash[MAXCONTEXTS];
/* 3: Done */
/* 4: Wait_disconnect */
/* 5: Disconnected */
-int state = 0;
+int state = 0;
struct gsn_t *gsn = NULL; /* GSN instance */
struct tun_t *tun = NULL; /* TUN instance */
@@ -787,7 +787,6 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) {
printf("Retrying with version 0\n");
iph->pdp->version = 0;
gtp_create_context_req(gsn, iph->pdp, iph, &options.remote);
- state = 1; /* Enter wait_connection state */
return 0;
}
else {
@@ -844,7 +843,6 @@ int echo_conf(int recovery) {
printf("Retrying with version 0\n");
echoversion = 0;
gtp_echo_req(gsn, echoversion, NULL, &options.remote);
- state = 1; /* Enter wait_connection state */
return 0;
}
else {
@@ -852,8 +850,10 @@ int echo_conf(int recovery) {
return EOF;
}
}
- else
+ else {
printf("Received echo response\n");
+ if (!options.contexts) state = 5;
+ }
return 0;
}