X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Ftunnel.c;h=899d1cdcb8b4fa037fbc92bffc8148aeb993aede;hb=be6255a8251ae69f8a5d54c5afad9604bf9e907b;hp=7863b7a35af85cbf26763a5f34ac0fa2e8522a05;hpb=29722bcc53774a763c583dfeec12af492a035008;p=openvswitch diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 7863b7a3..899d1cdc 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -991,6 +991,7 @@ static struct rtable *find_route(struct vport *vport, return cur_cache->rt; } else { struct rtable *rt; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) struct flowi fl = { .nl_u = { .ip4_u = { .daddr = mutable->daddr, .saddr = mutable->saddr, @@ -999,6 +1000,16 @@ static struct rtable *find_route(struct vport *vport, if (unlikely(ip_route_output_key(&init_net, &rt, &fl))) return NULL; +#else + struct flowi4 fl = { .daddr = mutable->daddr, + .saddr = mutable->saddr, + .flowi4_tos = tos, + .flowi4_proto = tnl_vport->tnl_ops->ipproto }; + + rt = ip_route_output_key(&init_net, &fl); + if (IS_ERR(rt)) + return NULL; +#endif if (likely(tos == mutable->tos)) *cache = build_cache(vport, mutable, rt);