osmo-ggsn[master]: sgsnemu: fix: no outgoing GTP-U in "createif" mode

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Viktor Tsymbalyuk gerrit-no-reply at lists.osmocom.org
Mon Feb 12 12:43:54 UTC 2018


Patch Set 1:

some debug below - just for time saving.

## stop on Breakpoint after sending packet into tun0
- ipm->pdp null as result gtp_data_req not executed
```
Breakpoint 1, cb_tun_ind (tun=<optimized out>, pack=0x7fffffffbe40, len=1028) at sgsnemu.c:1367
1367            if (ipm->pdp)           /* Check if a peer protocol is defined */
(gdb)
(gdb) print ipm->pdp
$1 = (struct pdp_t *) 0x0
(gdb) list
1362                    printf("Dropping packet from invalid source address: %s\n",
1363                           in46a_ntoa(&src));
1364                    return 0;
1365            }
1366
1367            if (ipm->pdp)           /* Check if a peer protocol is defined */
1368                    gtp_data_req(gsn, ipm->pdp, pack, len);
1369            return 0;
1370    }
1371
```

## new run Breakpoint in create_pdp_conf
```
Breakpoint 5, create_pdp_conf (cause=<optimized out>, cbp=0x6145a0 <iparr>, pdp=0x7ffff79be2e0 <pdpa>) at sgsnemu.c:1465
1465            ipset((struct iphash_t *)pdp->peer, &addr);
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) list
1460                    }
1461                    free(accept_ra);
1462                    free(forwarding);
1463            }
1464
1465            ipset((struct iphash_t *)pdp->peer, &addr);
1466
1467            state = 2;              /* Connected */
1468
1469            return 0;
(gdb) s
ipset (addr=0x7fffffffb500, ipaddr=0x7ffff79be300 <pdpa+32>) at sgsnemu.c:172
172             int hash = ippool_hash(addr) % MAXCONTEXTS;
(gdb) n
176             ipaddr->addr = *addr;
(gdb) print hash
$5 = 165
(gdb) n
177             for (h = iphash[hash]; h; h = h->ipnext)
(gdb) n
175             ipaddr->ipnext = NULL;
(gdb) n
176             ipaddr->addr = *addr;
(gdb) n
177             for (h = iphash[hash]; h; h = h->ipnext)
(gdb) n
create_pdp_conf (cause=<optimized out>, cbp=0x6145a0 <iparr>, pdp=0x7ffff79be2e0 <pdpa>) at sgsnemu.c:1465
1465            ipset((struct iphash_t *)pdp->peer, &addr);
(gdb) print iphash[165]
$7 = (struct iphash_t *) 0x0
(gdb) n
1467            state = 2;              /* Connected */
```
 - as result of `struct iphash_t *)pdp->peer` casting in *iphash[165] we has pdp = 0x0

```
(gdb) print *iphash[165]
$9 = {inuse = 160 '\240', ipnext = 0x0, pdp = 0x0, addr = {len = 4 '\004', {v4 = {s_addr = 67112970}, v6 = {__in6_u = {
          __u6_addr8 = "\n\020\000\004mQ{\367\377\177\000\000\377\000\000", __u6_addr16 = {4106, 1024, 20845, 63355, 32767, 0, 255,
            0}, __u6_addr32 = {67112970, 4152054125, 32767, 255}}}}}}
(gdb)
```

-- 
To view, visit https://gerrit.osmocom.org/6385
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icd58450548b3a47cb933d70a2e3166c067552b2c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Viktor Tsymbalyuk <viktor.tsymbalyuk at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Viktor Tsymbalyuk <viktor.tsymbalyuk at gmail.com>
Gerrit-HasComments: No



More information about the gerrit-log mailing list