Message ID | 1447277144-36451-1-git-send-email-joestringer@nicira.com |
---|---|
State | Accepted, archived |
Headers | show |
On Thu, Nov 12, 2015 at 2:55 AM, Joe Stringer <joestringer@nicira.com> wrote: > The inet_get_local_port_range() function is defined as a 3-parameter > version in the backported net/ip.h, however some versions of RHEL7 > kernel use the 2-parameter version in their net/udp.h header. We need to > make sure that our net/ip.h is first included, then undef our overriding > 3-parameter version, include the system net/udp.h, then redefine our > overriding 3-parameter version so that it may be used inside OVS code. > > This header needs to include net/ip.h here as some files may not include > it prior to net/udp.h, in which case the logic we have to define the > right version while including the system net/udp.h will not work. > > Specifically this fixes issues on kernel 3.10.0-229.7.2.el7.x86_64 > (perhaps earlier as well; some later versions make this unnecessary). > > Signed-off-by: Joe Stringer <joestringer@nicira.com> Thanks for the fix. Acked-by: Pravin B Shelar <pshelar@nicira.com>
On 19 November 2015 at 08:01, Pravin Shelar <pshelar@nicira.com> wrote: > On Thu, Nov 12, 2015 at 2:55 AM, Joe Stringer <joestringer@nicira.com> wrote: >> The inet_get_local_port_range() function is defined as a 3-parameter >> version in the backported net/ip.h, however some versions of RHEL7 >> kernel use the 2-parameter version in their net/udp.h header. We need to >> make sure that our net/ip.h is first included, then undef our overriding >> 3-parameter version, include the system net/udp.h, then redefine our >> overriding 3-parameter version so that it may be used inside OVS code. >> >> This header needs to include net/ip.h here as some files may not include >> it prior to net/udp.h, in which case the logic we have to define the >> right version while including the system net/udp.h will not work. >> >> Specifically this fixes issues on kernel 3.10.0-229.7.2.el7.x86_64 >> (perhaps earlier as well; some later versions make this unnecessary). >> >> Signed-off-by: Joe Stringer <joestringer@nicira.com> > > Thanks for the fix. > > Acked-by: Pravin B Shelar <pshelar@nicira.com> Thanks, applied.
diff --git a/datapath/linux/compat/include/net/udp.h b/datapath/linux/compat/include/net/udp.h index fcb8f6a8e227..41254aad7260 100644 --- a/datapath/linux/compat/include/net/udp.h +++ b/datapath/linux/compat/include/net/udp.h @@ -1,10 +1,10 @@ #ifndef __NET_UDP_WRAPPER_H #define __NET_UDP_WRAPPER_H 1 -#include <linux/version.h> +#include <net/ip.h> #ifdef inet_get_local_port_range -/* RHEL7 backports udp_flow_src_port() using an older version of +/* Earlier RHEL7 kernels backport udp_flow_src_port() using an older version of * inet_get_local_port_range(). */ #undef inet_get_local_port_range #include_next <net/udp.h>
The inet_get_local_port_range() function is defined as a 3-parameter version in the backported net/ip.h, however some versions of RHEL7 kernel use the 2-parameter version in their net/udp.h header. We need to make sure that our net/ip.h is first included, then undef our overriding 3-parameter version, include the system net/udp.h, then redefine our overriding 3-parameter version so that it may be used inside OVS code. This header needs to include net/ip.h here as some files may not include it prior to net/udp.h, in which case the logic we have to define the right version while including the system net/udp.h will not work. Specifically this fixes issues on kernel 3.10.0-229.7.2.el7.x86_64 (perhaps earlier as well; some later versions make this unnecessary). Signed-off-by: Joe Stringer <joestringer@nicira.com> --- datapath/linux/compat/include/net/udp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)