Skip to content

Commit

Permalink
Enable vrouter build on RHEL 7.5
Browse files Browse the repository at this point in the history
RHEL 7.5 has kernel version updated to 3.10.0-862.el7, which breaks
building of vrouter module.

Co-Authored-By: Raja Sivaramakrishnan <raja@juniper.net>
Co-Authored-By: Krzysztof Klimonda <krzysztof.klimonda@codilime.com>
Change-Id: Icb0467344c0023141be7e1dd9998d383bfaab14b
Closes-Bug: 1763656
  • Loading branch information
srajag and kklimonda committed Apr 13, 2018
1 parent 5be7c5c commit b948f9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion linux/vhost_dev.c
Expand Up @@ -461,9 +461,11 @@ vhost_setup(struct net_device *dev)
/* follow the standard steps */
random_ether_addr(dev->dev_addr);
ether_setup(dev);

#if (! (defined(RHEL_MAJOR) && defined(RHEL_MINOR) && \
(RHEL_MAJOR == 7) && (RHEL_MINOR >= 5)))
#ifdef ETH_MAX_MTU
dev->max_mtu = ETH_MAX_MTU;
#endif
#endif
dev->needed_headroom = sizeof(struct vr_eth) + sizeof(struct agent_hdr);
dev->netdev_ops = &vhost_dev_ops;
Expand Down
6 changes: 4 additions & 2 deletions linux/vr_genetlink.c
Expand Up @@ -20,7 +20,8 @@
#include "vr_response.h"
#include "vrouter.h"

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) || \
(defined(RHEL_MAJOR) && (RHEL_MAJOR >= 7) && (RHEL_MINOR >= 5))
#define GENL_ID_GENERATE 0
#endif /* Linux 4.10.0 */
static int netlink_trans_request(struct sk_buff *, struct genl_info *);
Expand Down Expand Up @@ -218,7 +219,8 @@ vr_genetlink_init(void)
(!(defined(RHEL_MAJOR) && (RHEL_MAJOR >= 7))))
return genl_register_family_with_ops(&vrouter_genl_family, vrouter_genl_ops,
ARRAY_SIZE(vrouter_genl_ops));
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) || \
(defined(RHEL_MAJOR) && (RHEL_MAJOR >= 7) && (RHEL_MINOR >= 5))
return genl_register_family(&vrouter_genl_family);
#else
return genl_register_family_with_ops_groups(&vrouter_genl_family,
Expand Down

0 comments on commit b948f9f

Please sign in to comment.