9
0
Fork 0

ggsn: Fix DNS not sent in PDP context response

During IPv6 support implementation, helper function pco_contains_proto
was added which contains an error: It is only capable of finding first
protocol correctly, and as a consequence, in my setup DNS servers where not
sent back to the SGSN/MS, resulting in phone being able to connect to
IPs but not to domain names which required DNS resolution.

The condition in the while loop is also changed to match the increment
of the variable inside the loop to make it easier to understand at first
glance.

Fixes: 1ae98777d9

Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e
This commit is contained in:
Pau Espin 2017-08-30 15:51:24 +02:00
parent bdc504e29c
commit 0ab62fe081
1 changed files with 2 additions and 2 deletions

View File

@ -215,14 +215,14 @@ static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot)
uint8_t *cur = pco->v + 1;
/* iterate over PCO and check if protocol contained */
while (cur + 2 < pco->v + pco->l) {
while (cur + 3 <= pco->v + pco->l) {
uint16_t cur_prot = osmo_load16be(cur);
uint8_t cur_len = cur[2];
if (cur_prot == prot)
return true;
if (cur_len == 0)
break;
cur += cur_len;
cur += cur_len + 3;
}
return false;
}