diff options
Diffstat (limited to 'net/openvswitch')
| -rw-r--r-- | net/openvswitch/conntrack.c | 8 | ||||
| -rw-r--r-- | net/openvswitch/vport-geneve.c | 9 | ||||
| -rw-r--r-- | net/openvswitch/vport-gre.c | 11 | ||||
| -rw-r--r-- | net/openvswitch/vport-internal_dev.c | 2 | ||||
| -rw-r--r-- | net/openvswitch/vport-vxlan.c | 9 |
5 files changed, 27 insertions, 12 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index c644c78ed485..e054a748ff25 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c | |||
| @@ -433,7 +433,6 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone, | |||
| 433 | struct nf_conntrack_l4proto *l4proto; | 433 | struct nf_conntrack_l4proto *l4proto; |
| 434 | struct nf_conntrack_tuple tuple; | 434 | struct nf_conntrack_tuple tuple; |
| 435 | struct nf_conntrack_tuple_hash *h; | 435 | struct nf_conntrack_tuple_hash *h; |
| 436 | enum ip_conntrack_info ctinfo; | ||
| 437 | struct nf_conn *ct; | 436 | struct nf_conn *ct; |
| 438 | unsigned int dataoff; | 437 | unsigned int dataoff; |
| 439 | u8 protonum; | 438 | u8 protonum; |
| @@ -458,13 +457,8 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone, | |||
| 458 | 457 | ||
| 459 | ct = nf_ct_tuplehash_to_ctrack(h); | 458 | ct = nf_ct_tuplehash_to_ctrack(h); |
| 460 | 459 | ||
| 461 | ctinfo = ovs_ct_get_info(h); | ||
| 462 | if (ctinfo == IP_CT_NEW) { | ||
| 463 | /* This should not happen. */ | ||
| 464 | WARN_ONCE(1, "ovs_ct_find_existing: new packet for %p\n", ct); | ||
| 465 | } | ||
| 466 | skb->nfct = &ct->ct_general; | 460 | skb->nfct = &ct->ct_general; |
| 467 | skb->nfctinfo = ctinfo; | 461 | skb->nfctinfo = ovs_ct_get_info(h); |
| 468 | return ct; | 462 | return ct; |
| 469 | } | 463 | } |
| 470 | 464 | ||
diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c index 1a1fcec88695..5aaf3babfc3f 100644 --- a/net/openvswitch/vport-geneve.c +++ b/net/openvswitch/vport-geneve.c | |||
| @@ -93,7 +93,14 @@ static struct vport *geneve_tnl_create(const struct vport_parms *parms) | |||
| 93 | return ERR_CAST(dev); | 93 | return ERR_CAST(dev); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | dev_change_flags(dev, dev->flags | IFF_UP); | 96 | err = dev_change_flags(dev, dev->flags | IFF_UP); |
| 97 | if (err < 0) { | ||
| 98 | rtnl_delete_link(dev); | ||
| 99 | rtnl_unlock(); | ||
| 100 | ovs_vport_free(vport); | ||
| 101 | goto error; | ||
| 102 | } | ||
| 103 | |||
| 97 | rtnl_unlock(); | 104 | rtnl_unlock(); |
| 98 | return vport; | 105 | return vport; |
| 99 | error: | 106 | error: |
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c index 7f8897f33a67..0e72d95b0e8f 100644 --- a/net/openvswitch/vport-gre.c +++ b/net/openvswitch/vport-gre.c | |||
| @@ -54,6 +54,7 @@ static struct vport *gre_tnl_create(const struct vport_parms *parms) | |||
| 54 | struct net *net = ovs_dp_get_net(parms->dp); | 54 | struct net *net = ovs_dp_get_net(parms->dp); |
| 55 | struct net_device *dev; | 55 | struct net_device *dev; |
| 56 | struct vport *vport; | 56 | struct vport *vport; |
| 57 | int err; | ||
| 57 | 58 | ||
| 58 | vport = ovs_vport_alloc(0, &ovs_gre_vport_ops, parms); | 59 | vport = ovs_vport_alloc(0, &ovs_gre_vport_ops, parms); |
| 59 | if (IS_ERR(vport)) | 60 | if (IS_ERR(vport)) |
| @@ -67,9 +68,15 @@ static struct vport *gre_tnl_create(const struct vport_parms *parms) | |||
| 67 | return ERR_CAST(dev); | 68 | return ERR_CAST(dev); |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | dev_change_flags(dev, dev->flags | IFF_UP); | 71 | err = dev_change_flags(dev, dev->flags | IFF_UP); |
| 71 | rtnl_unlock(); | 72 | if (err < 0) { |
| 73 | rtnl_delete_link(dev); | ||
| 74 | rtnl_unlock(); | ||
| 75 | ovs_vport_free(vport); | ||
| 76 | return ERR_PTR(err); | ||
| 77 | } | ||
| 72 | 78 | ||
| 79 | rtnl_unlock(); | ||
| 73 | return vport; | 80 | return vport; |
| 74 | } | 81 | } |
| 75 | 82 | ||
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 434e04c3a189..95c36147a6e1 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c | |||
| @@ -140,7 +140,7 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) | |||
| 140 | 140 | ||
| 141 | static void internal_set_rx_headroom(struct net_device *dev, int new_hr) | 141 | static void internal_set_rx_headroom(struct net_device *dev, int new_hr) |
| 142 | { | 142 | { |
| 143 | dev->needed_headroom = new_hr; | 143 | dev->needed_headroom = new_hr < 0 ? 0 : new_hr; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static const struct net_device_ops internal_dev_netdev_ops = { | 146 | static const struct net_device_ops internal_dev_netdev_ops = { |
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c index 5eb7694348b5..7eb955e453e6 100644 --- a/net/openvswitch/vport-vxlan.c +++ b/net/openvswitch/vport-vxlan.c | |||
| @@ -130,7 +130,14 @@ static struct vport *vxlan_tnl_create(const struct vport_parms *parms) | |||
| 130 | return ERR_CAST(dev); | 130 | return ERR_CAST(dev); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | dev_change_flags(dev, dev->flags | IFF_UP); | 133 | err = dev_change_flags(dev, dev->flags | IFF_UP); |
| 134 | if (err < 0) { | ||
| 135 | rtnl_delete_link(dev); | ||
| 136 | rtnl_unlock(); | ||
| 137 | ovs_vport_free(vport); | ||
| 138 | goto error; | ||
| 139 | } | ||
| 140 | |||
| 134 | rtnl_unlock(); | 141 | rtnl_unlock(); |
| 135 | return vport; | 142 | return vport; |
| 136 | error: | 143 | error: |
