projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
openflow-1.0: Rename ofp_match to ofp10_match, OFPFW_* to OFPFW10_*.
[openvswitch]
/
datapath
/
vport-gre.c
diff --git
a/datapath/vport-gre.c
b/datapath/vport-gre.c
index 4411cac93840effa31749ec61e6e0c0b51145568..ab89c5b42df4d72ca812c9b5029fa6e2794707ae 100644
(file)
--- a/
datapath/vport-gre.c
+++ b/
datapath/vport-gre.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2007-201
1 Nicira Networks
.
+ * Copyright (c) 2007-201
2 Nicira, Inc
.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@
-29,6
+29,7
@@
#include <net/ip.h>
#include <net/protocol.h>
#include <net/ip.h>
#include <net/protocol.h>
+#include "datapath.h"
#include "tunnel.h"
#include "vport.h"
#include "vport-generic.h"
#include "tunnel.h"
#include "vport.h"
#include "vport-generic.h"
@@
-101,10
+102,11
@@
static struct sk_buff *gre_update_header(const struct vport *vport,
- GRE_HEADER_SECTION);
/* Work backwards over the options so the checksum is last. */
- GRE_HEADER_SECTION);
/* Work backwards over the options so the checksum is last. */
- if (mutable->flags & TNL_F_OUT_KEY_ACTION)
{
+ if (mutable->flags & TNL_F_OUT_KEY_ACTION)
*options = be64_get_low32(OVS_CB(skb)->tun_id);
*options = be64_get_low32(OVS_CB(skb)->tun_id);
+
+ if (mutable->out_key || mutable->flags & TNL_F_OUT_KEY_ACTION)
options--;
options--;
- }
if (mutable->flags & TNL_F_CSUM)
*(__sum16 *)options = csum_fold(skb_checksum(skb,
if (mutable->flags & TNL_F_CSUM)
*(__sum16 *)options = csum_fold(skb_checksum(skb,
@@
-205,8
+207,8
@@
static void gre_err(struct sk_buff *skb, u32 info)
if (tunnel_hdr_len < 0)
return;
if (tunnel_hdr_len < 0)
return;
- vport = ovs_tnl_find_port(
iph->saddr, iph->daddr, key, TNL_T_PROTO_GRE
,
- &mutable);
+ vport = ovs_tnl_find_port(
dev_net(skb->dev), iph->saddr, iph->daddr, key
,
+
TNL_T_PROTO_GRE,
&mutable);
if (!vport)
return;
if (!vport)
return;
@@
-342,8
+344,8
@@
static int gre_rcv(struct sk_buff *skb)
goto error;
iph = ip_hdr(skb);
goto error;
iph = ip_hdr(skb);
- vport = ovs_tnl_find_port(
iph->daddr, iph->saddr, key, TNL_T_PROTO_GRE
,
- &mutable);
+ vport = ovs_tnl_find_port(
dev_net(skb->dev), iph->daddr, iph->saddr, key
,
+
TNL_T_PROTO_GRE,
&mutable);
if (unlikely(!vport)) {
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
goto error;
if (unlikely(!vport)) {
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
goto error;
@@
-381,6
+383,9
@@
static struct vport *gre_create(const struct vport_parms *parms)
static const struct net_protocol gre_protocol_handlers = {
.handler = gre_rcv,
.err_handler = gre_err,
static const struct net_protocol gre_protocol_handlers = {
.handler = gre_rcv,
.err_handler = gre_err,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+ .netns_ok = 1,
+#endif
};
static int gre_init(void)
};
static int gre_init(void)