Compare commits

...

2 Commits

Author SHA1 Message Date
Pau Espin Pedrol
88d65840aa sgsnemu: Initial support IPv4v6 PDP context type
Related: OS#4433
Change-Id: If6eb2f1a5d0fb71da80e289112a67dd2faa30b4b
2025-07-16 19:08:13 +02:00
Pau Espin Pedrol
3aa81c594d cosmetic: sgsnemu: Fix trailing whitespace
Also make linter happy:
sgsnemu/cmdline.c:4: WARNING:LEADING_SPACE: please, no spaces at the start of a line

Change-Id: Ie89a9f9de64cd59d21341b6f381b32f56693840f
2025-07-16 19:03:38 +02:00
3 changed files with 19 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
/*
File autogenerated by gengetopt version 2.22.6
generated with the following command:
gengetopt --conf-parser
The developers of gengetopt consider the fixed text that goes in all
gengetopt output files to be in the public domain:
we make no copyright claims on it.
*/
* File autogenerated by gengetopt version 2.22.6
* generated with the following command:
* gengetopt --conf-parser
*
* The developers of gengetopt consider the fixed text that goes in all
* gengetopt output files to be in the public domain:
* we make no copyright claims on it.
*/
/* If we use autoconf. */
#ifdef HAVE_CONFIG_H
@@ -80,7 +80,7 @@ const char *gengetopt_args_info_help[] = {
" --pingcount=INT Number of ping req to send (default=`0')",
" --pingquiet Do not print ping packet info (default=off)",
" --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)",
" -t, --pdp-type=(v4|v6) PDP Type (default=`v4')",
" -t, --pdp-type=(v4|v6|v4v6) PDP Type (default=`v4')",
0
};

View File

@@ -1,11 +1,11 @@
# OsmoGGSN - Gateway GPRS Support Node
# Copyright (C) 2002, 2003, 2004 Mondru AB.
#
#
# The contents of this file may be used under the terms of the GNU
# General Public License Version 2, provided that the above copyright
# notice and this permission notice is included in all copies or
# substantial portions of the software.
#
#
# Use
# gengetopt --conf-parser < cmdline.ggo
# linux-2.6/scripts/Lindent cmdline.c
@@ -68,4 +68,4 @@ modeoption "pingcount" - "Number of ping req to send" int default="0" d
modeoption "pingquiet" - "Do not print ping packet info" flag dependon="pinghost" off mode="pinghost"
option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off
option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)"
option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6|v4v6)"

View File

@@ -925,6 +925,8 @@ static int process_options(int argc, char **argv)
options.pdp_type = PDP_EUA_TYPE_v6;
else if (!strcmp(args_info.pdp_type_arg, "v4"))
options.pdp_type = PDP_EUA_TYPE_v4;
else if (!strcmp(args_info.pdp_type_arg, "v4v6"))
options.pdp_type = PDP_EUA_TYPE_v4v6;
else {
SYS_ERR(DSGSN, LOGL_ERROR, 0, "Unsupported/unknown PDP Type '%s'\n",
args_info.pdp_type_arg);
@@ -944,6 +946,9 @@ static int process_options(int argc, char **argv)
case PDP_EUA_TYPE_v6:
hints.ai_family = AF_INET6;
break;
case PDP_EUA_TYPE_v4v6:
hints.ai_family = AF_UNSPEC;
break;
default:
SYS_ERR(DSGSN, LOGL_ERROR, 0, "lookup(AF_UNSPEC) %d", options.pdp_type);
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
@@ -1664,7 +1669,8 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
}
}
if (options.createif && options.pdp_type == PDP_EUA_TYPE_v6) {
if (options.createif && (options.pdp_type == PDP_EUA_TYPE_v6 ||
options.pdp_type == PDP_EUA_TYPE_v4v6)) {
struct in6_addr *saddr6;
struct msgb *msg;
if (in46a_is_v6(&addr[0])) {