pespin submitted this change.

View Change

Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, approved
dev_create: Avoid passing IFLA_GTP_FD* attribute with value -1

The kernel will just reject with errno=9 and log message:
"gtp: gtp socket fd=-1 not found".

Instead, avoid adding the attribute in first place, which is what the
kernel expects.

Related: SYS#7126
Change-Id: Ib7e1d362fbb556c9b15b25408058fbf00bcc7aa3
---
M src/gtp-rtnl.c
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gtp-rtnl.c b/src/gtp-rtnl.c
index 6baa5a6..e0db921 100644
--- a/src/gtp-rtnl.c
+++ b/src/gtp-rtnl.c
@@ -127,8 +127,10 @@
nest = mnl_attr_nest_start(nlh, IFLA_LINKINFO);
mnl_attr_put_str(nlh, IFLA_INFO_KIND, "gtp");
nest2 = mnl_attr_nest_start(nlh, IFLA_INFO_DATA);
- mnl_attr_put_u32(nlh, IFLA_GTP_FD0, fd0);
- mnl_attr_put_u32(nlh, IFLA_GTP_FD1, fd1);
+ if (fd0 >= 0)
+ mnl_attr_put_u32(nlh, IFLA_GTP_FD0, fd0);
+ if (fd1 >= 0)
+ mnl_attr_put_u32(nlh, IFLA_GTP_FD1, fd1);
mnl_attr_put_u32(nlh, IFLA_GTP_PDP_HASHSIZE, 131072);
if (role != GTP_ROLE_GGSN)
mnl_attr_put_u32(nlh, IFLA_GTP_ROLE, role);

To view, visit change 38460. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libgtpnl
Gerrit-Branch: master
Gerrit-Change-Id: Ib7e1d362fbb556c9b15b25408058fbf00bcc7aa3
Gerrit-Change-Number: 38460
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator@gmail.com>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pablo <pablo@gnumonks.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>