gtp: sanity check gtp version for PDP context
make sure it's GTP_V0 or GTP_V1.
This commit is contained in:
parent
2060f60afe
commit
a7012e1376
8
gtp.c
8
gtp.c
|
@ -923,6 +923,14 @@ static int ipv4_pdp_add(struct gtp_instance *gti, struct genl_info *info)
|
|||
bool found = false;
|
||||
|
||||
gtp_version = nla_get_u32(info->attrs[GTPA_VERSION]);
|
||||
switch (gtp_version) {
|
||||
case GTP_V0:
|
||||
case GTP_V1:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
link = nla_get_u32(info->attrs[GTPA_LINK]);
|
||||
sgsn_addr = nla_get_u32(info->attrs[GTPA_SGSN_ADDRESS]);
|
||||
ms_addr = nla_get_u32(info->attrs[GTPA_MS_ADDRESS]);
|
||||
|
|
Loading…
Reference in New Issue