Skip to content

Commit

Permalink
route/link: fix parsing of 'remote' attribute for GRE links
Browse files Browse the repository at this point in the history
Fixes: 57bdc4f

http://lists.infradead.org/pipermail/libnl/2015-November/002004.html

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
[thaller@redhat.com: add capability to indicate bug-fix]
Signed-off-by: Thomas Haller <thaller@redhat.com>
  • Loading branch information
bengal authored and thom311 committed Nov 19, 2015
1 parent 5f044ac commit a0b2710
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions include/netlink/utils.h
Expand Up @@ -171,6 +171,12 @@ enum {
NL_CAPABILITY_RTNL_LINK_VLAN_PROTOCOL_SERIALZE = 12,
#define NL_CAPABILITY_RTNL_LINK_VLAN_PROTOCOL_SERIALZE NL_CAPABILITY_RTNL_LINK_VLAN_PROTOCOL_SERIALZE

/**
* Properly read gre REMOTE port.
*/
NL_CAPABILITY_RTNL_LINK_PARSE_GRE_REMOTE = 13,
#define NL_CAPABILITY_RTNL_LINK_PARSE_GRE_REMOTE NL_CAPABILITY_RTNL_LINK_PARSE_GRE_REMOTE

__NL_CAPABILITY_MAX,
NL_CAPABILITY_MAX = (__NL_CAPABILITY_MAX - 1),
#define NL_CAPABILITY_MAX NL_CAPABILITY_MAX
Expand Down
4 changes: 2 additions & 2 deletions lib/route/link/ipgre.c
Expand Up @@ -137,8 +137,8 @@ static int ipgre_parse(struct rtnl_link *link, struct nlattr *data,
ipgre->ipgre_mask |= IPGRE_ATTR_LOCAL;
}

if (tb[IFLA_GRE_LOCAL]) {
ipgre->remote = nla_get_u32(tb[IFLA_GRE_LOCAL]);
if (tb[IFLA_GRE_REMOTE]) {
ipgre->remote = nla_get_u32(tb[IFLA_GRE_REMOTE]);
ipgre->ipgre_mask |= IPGRE_ATTR_REMOTE;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils.c
Expand Up @@ -1156,7 +1156,7 @@ int nl_has_capability (int capability)
NL_CAPABILITY_RTNL_NEIGH_GET_FILTER_AF_UNSPEC_FIX,
NL_CAPABILITY_VERSION_3_2_27,
NL_CAPABILITY_RTNL_LINK_VLAN_PROTOCOL_SERIALZE,
0,
NL_CAPABILITY_RTNL_LINK_PARSE_GRE_REMOTE,
0,
0,
0),
Expand Down

0 comments on commit a0b2710

Please sign in to comment.