diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2022-12-30 11:00:25 +0100 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2023-06-26 15:47:58 +0200 |
commit | ca3d2113d3f4f1a662b58bb36d28d677b6f4ba00 (patch) | |
tree | 9d13094749c74dcd939b5bf81fc7cd3616bdc93a /accel-pppd/libnetlink/iputils.c | |
parent | 3606825c9664f9139c0fb487ec87d9ba4a889229 (diff) | |
download | accel-ppp-ca3d2113d3f4f1a662b58bb36d28d677b6f4ba00.tar.gz accel-ppp-ca3d2113d3f4f1a662b58bb36d28d677b6f4ba00.zip |
libnetlink: fix a crash with a non vlan interface
Fix a segmentation fault when starting when accel-ppp is configured with
an non vlan interface.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'accel-pppd/libnetlink/iputils.c')
-rw-r--r-- | accel-pppd/libnetlink/iputils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index 550717f..23325fc 100644 --- a/accel-pppd/libnetlink/iputils.c +++ b/accel-pppd/libnetlink/iputils.c @@ -314,7 +314,7 @@ int __export iplink_vlan_get_vid(int ifindex, int *iflink) parse_rtattr_nested(tb, IFLA_MAX, tb[IFLA_LINKINFO]); - if (strcmp(RTA_DATA(tb[IFLA_INFO_KIND]), "vlan")) + if (!tb[IFLA_INFO_KIND] || strcmp(RTA_DATA(tb[IFLA_INFO_KIND]), "vlan")) goto out; parse_rtattr_nested(tb, IFLA_MAX, tb[IFLA_INFO_DATA]); |