diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/8021q/vlan_dev.c | 2 | ||||
-rw-r--r-- | net/bridge/br_stp_timer.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/ethtool.c | 2 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 1 | ||||
-rw-r--r-- | net/ipv4/gre.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 7 | ||||
-rw-r--r-- | net/packet/af_packet.c | 53 | ||||
-rw-r--r-- | net/tipc/bcast.c | 40 |
9 files changed, 63 insertions, 50 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 8af508536d36..3a8c8fd63c88 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -628,7 +628,7 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev, | |||
628 | netdev_features_t features) | 628 | netdev_features_t features) |
629 | { | 629 | { |
630 | struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; | 630 | struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; |
631 | u32 old_features = features; | 631 | netdev_features_t old_features = features; |
632 | 632 | ||
633 | features &= real_dev->vlan_features; | 633 | features &= real_dev->vlan_features; |
634 | features |= NETIF_F_RXCSUM; | 634 | features |= NETIF_F_RXCSUM; |
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c index c3530a81a33b..950663d4d330 100644 --- a/net/bridge/br_stp_timer.c +++ b/net/bridge/br_stp_timer.c | |||
@@ -107,7 +107,7 @@ static void br_tcn_timer_expired(unsigned long arg) | |||
107 | 107 | ||
108 | br_debug(br, "tcn timer expired\n"); | 108 | br_debug(br, "tcn timer expired\n"); |
109 | spin_lock(&br->lock); | 109 | spin_lock(&br->lock); |
110 | if (br->dev->flags & IFF_UP) { | 110 | if (!br_is_root_bridge(br) && (br->dev->flags & IFF_UP)) { |
111 | br_transmit_tcn(br); | 111 | br_transmit_tcn(br); |
112 | 112 | ||
113 | mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time); | 113 | mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time); |
diff --git a/net/core/dev.c b/net/core/dev.c index 4040673f806a..40b1fadaf637 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2456,7 +2456,7 @@ EXPORT_SYMBOL(netif_skb_features); | |||
2456 | * 2. skb is fragmented and the device does not support SG. | 2456 | * 2. skb is fragmented and the device does not support SG. |
2457 | */ | 2457 | */ |
2458 | static inline int skb_needs_linearize(struct sk_buff *skb, | 2458 | static inline int skb_needs_linearize(struct sk_buff *skb, |
2459 | int features) | 2459 | netdev_features_t features) |
2460 | { | 2460 | { |
2461 | return skb_is_nonlinear(skb) && | 2461 | return skb_is_nonlinear(skb) && |
2462 | ((skb_has_frag_list(skb) && | 2462 | ((skb_has_frag_list(skb) && |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 5a934ef90f8b..22efdaa76ebf 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -1421,7 +1421,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1421 | void __user *useraddr = ifr->ifr_data; | 1421 | void __user *useraddr = ifr->ifr_data; |
1422 | u32 ethcmd; | 1422 | u32 ethcmd; |
1423 | int rc; | 1423 | int rc; |
1424 | u32 old_features; | 1424 | netdev_features_t old_features; |
1425 | 1425 | ||
1426 | if (!dev || !netif_device_present(dev)) | 1426 | if (!dev || !netif_device_present(dev)) |
1427 | return -ENODEV; | 1427 | return -ENODEV; |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index c61b3bb87a16..d01be2a3ae53 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1293,6 +1293,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, | |||
1293 | SKB_GSO_DODGY | | 1293 | SKB_GSO_DODGY | |
1294 | SKB_GSO_TCP_ECN | | 1294 | SKB_GSO_TCP_ECN | |
1295 | SKB_GSO_GRE | | 1295 | SKB_GSO_GRE | |
1296 | SKB_GSO_TCPV6 | | ||
1296 | SKB_GSO_UDP_TUNNEL | | 1297 | SKB_GSO_UDP_TUNNEL | |
1297 | 0))) | 1298 | 0))) |
1298 | goto out; | 1299 | goto out; |
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c index d2d5a99fba09..cc22363965d2 100644 --- a/net/ipv4/gre.c +++ b/net/ipv4/gre.c | |||
@@ -121,6 +121,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
121 | int ghl = GRE_HEADER_SECTION; | 121 | int ghl = GRE_HEADER_SECTION; |
122 | struct gre_base_hdr *greh; | 122 | struct gre_base_hdr *greh; |
123 | int mac_len = skb->mac_len; | 123 | int mac_len = skb->mac_len; |
124 | __be16 protocol = skb->protocol; | ||
124 | int tnl_hlen; | 125 | int tnl_hlen; |
125 | bool csum; | 126 | bool csum; |
126 | 127 | ||
@@ -150,7 +151,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
150 | 151 | ||
151 | /* setup inner skb. */ | 152 | /* setup inner skb. */ |
152 | if (greh->protocol == htons(ETH_P_TEB)) { | 153 | if (greh->protocol == htons(ETH_P_TEB)) { |
153 | struct ethhdr *eth = eth_hdr(skb); | 154 | struct ethhdr *eth = (struct ethhdr *)skb_inner_mac_header(skb); |
154 | skb->protocol = eth->h_proto; | 155 | skb->protocol = eth->h_proto; |
155 | } else { | 156 | } else { |
156 | skb->protocol = greh->protocol; | 157 | skb->protocol = greh->protocol; |
@@ -199,6 +200,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
199 | skb_reset_mac_header(skb); | 200 | skb_reset_mac_header(skb); |
200 | skb_set_network_header(skb, mac_len); | 201 | skb_set_network_header(skb, mac_len); |
201 | skb->mac_len = mac_len; | 202 | skb->mac_len = mac_len; |
203 | skb->protocol = protocol; | ||
202 | } while ((skb = skb->next)); | 204 | } while ((skb = skb->next)); |
203 | out: | 205 | out: |
204 | return segs; | 206 | return segs; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6abbe6455129..0ae038a4c7a8 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -2311,8 +2311,10 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2312 | int mac_len = skb->mac_len; | 2312 | int mac_len = skb->mac_len; |
2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); | 2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); |
2314 | int outer_hlen; | 2314 | struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb); |
2315 | __be16 protocol = skb->protocol; | ||
2315 | netdev_features_t enc_features; | 2316 | netdev_features_t enc_features; |
2317 | int outer_hlen; | ||
2316 | 2318 | ||
2317 | if (unlikely(!pskb_may_pull(skb, tnl_hlen))) | 2319 | if (unlikely(!pskb_may_pull(skb, tnl_hlen))) |
2318 | goto out; | 2320 | goto out; |
@@ -2322,6 +2324,8 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2322 | skb_reset_mac_header(skb); | 2324 | skb_reset_mac_header(skb); |
2323 | skb_set_network_header(skb, skb_inner_network_offset(skb)); | 2325 | skb_set_network_header(skb, skb_inner_network_offset(skb)); |
2324 | skb->mac_len = skb_inner_network_offset(skb); | 2326 | skb->mac_len = skb_inner_network_offset(skb); |
2327 | inner_eth = (struct ethhdr *)skb_mac_header(skb); | ||
2328 | skb->protocol = inner_eth->h_proto; | ||
2325 | 2329 | ||
2326 | /* segment inner packet. */ | 2330 | /* segment inner packet. */ |
2327 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); | 2331 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); |
@@ -2358,6 +2362,7 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2358 | 2362 | ||
2359 | } | 2363 | } |
2360 | skb->ip_summed = CHECKSUM_NONE; | 2364 | skb->ip_summed = CHECKSUM_NONE; |
2365 | skb->protocol = protocol; | ||
2361 | } while ((skb = skb->next)); | 2366 | } while ((skb = skb->next)); |
2362 | out: | 2367 | out: |
2363 | return segs; | 2368 | return segs; |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index dd5cd49b0e09..8ec1bca7f859 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -742,36 +742,33 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1, | |||
742 | 742 | ||
743 | smp_rmb(); | 743 | smp_rmb(); |
744 | 744 | ||
745 | if (likely(TP_STATUS_KERNEL == BLOCK_STATUS(pbd1))) { | 745 | /* We could have just memset this but we will lose the |
746 | * flexibility of making the priv area sticky | ||
747 | */ | ||
746 | 748 | ||
747 | /* We could have just memset this but we will lose the | 749 | BLOCK_SNUM(pbd1) = pkc1->knxt_seq_num++; |
748 | * flexibility of making the priv area sticky | 750 | BLOCK_NUM_PKTS(pbd1) = 0; |
749 | */ | 751 | BLOCK_LEN(pbd1) = BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
750 | BLOCK_SNUM(pbd1) = pkc1->knxt_seq_num++; | ||
751 | BLOCK_NUM_PKTS(pbd1) = 0; | ||
752 | BLOCK_LEN(pbd1) = BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
753 | getnstimeofday(&ts); | ||
754 | h1->ts_first_pkt.ts_sec = ts.tv_sec; | ||
755 | h1->ts_first_pkt.ts_nsec = ts.tv_nsec; | ||
756 | pkc1->pkblk_start = (char *)pbd1; | ||
757 | pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
758 | BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
759 | BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN; | ||
760 | pbd1->version = pkc1->version; | ||
761 | pkc1->prev = pkc1->nxt_offset; | ||
762 | pkc1->pkblk_end = pkc1->pkblk_start + pkc1->kblk_size; | ||
763 | prb_thaw_queue(pkc1); | ||
764 | _prb_refresh_rx_retire_blk_timer(pkc1); | ||
765 | 752 | ||
766 | smp_wmb(); | 753 | getnstimeofday(&ts); |
767 | 754 | ||
768 | return; | 755 | h1->ts_first_pkt.ts_sec = ts.tv_sec; |
769 | } | 756 | h1->ts_first_pkt.ts_nsec = ts.tv_nsec; |
770 | 757 | ||
771 | WARN(1, "ERROR block:%p is NOT FREE status:%d kactive_blk_num:%d\n", | 758 | pkc1->pkblk_start = (char *)pbd1; |
772 | pbd1, BLOCK_STATUS(pbd1), pkc1->kactive_blk_num); | 759 | pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
773 | dump_stack(); | 760 | |
774 | BUG(); | 761 | BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
762 | BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN; | ||
763 | |||
764 | pbd1->version = pkc1->version; | ||
765 | pkc1->prev = pkc1->nxt_offset; | ||
766 | pkc1->pkblk_end = pkc1->pkblk_start + pkc1->kblk_size; | ||
767 | |||
768 | prb_thaw_queue(pkc1); | ||
769 | _prb_refresh_rx_retire_blk_timer(pkc1); | ||
770 | |||
771 | smp_wmb(); | ||
775 | } | 772 | } |
776 | 773 | ||
777 | /* | 774 | /* |
@@ -862,10 +859,6 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, | |||
862 | prb_close_block(pkc, pbd, po, status); | 859 | prb_close_block(pkc, pbd, po, status); |
863 | return; | 860 | return; |
864 | } | 861 | } |
865 | |||
866 | WARN(1, "ERROR-pbd[%d]:%p\n", pkc->kactive_blk_num, pbd); | ||
867 | dump_stack(); | ||
868 | BUG(); | ||
869 | } | 862 | } |
870 | 863 | ||
871 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, | 864 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, |
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 25e159c2feb4..e5f3da507823 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -584,8 +584,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, | |||
584 | { | 584 | { |
585 | int bp_index; | 585 | int bp_index; |
586 | 586 | ||
587 | /* | 587 | /* Prepare broadcast link message for reliable transmission, |
588 | * Prepare broadcast link message for reliable transmission, | ||
589 | * if first time trying to send it; | 588 | * if first time trying to send it; |
590 | * preparation is skipped for broadcast link protocol messages | 589 | * preparation is skipped for broadcast link protocol messages |
591 | * since they are sent in an unreliable manner and don't need it | 590 | * since they are sent in an unreliable manner and don't need it |
@@ -611,30 +610,43 @@ static int tipc_bcbearer_send(struct sk_buff *buf, | |||
611 | for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { | 610 | for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { |
612 | struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary; | 611 | struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary; |
613 | struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary; | 612 | struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary; |
613 | struct tipc_bearer *b = p; | ||
614 | struct sk_buff *tbuf; | ||
614 | 615 | ||
615 | if (!p) | 616 | if (!p) |
616 | break; /* no more bearers to try */ | 617 | break; /* No more bearers to try */ |
618 | |||
619 | if (tipc_bearer_blocked(p)) { | ||
620 | if (!s || tipc_bearer_blocked(s)) | ||
621 | continue; /* Can't use either bearer */ | ||
622 | b = s; | ||
623 | } | ||
617 | 624 | ||
618 | tipc_nmap_diff(&bcbearer->remains, &p->nodes, &bcbearer->remains_new); | 625 | tipc_nmap_diff(&bcbearer->remains, &b->nodes, |
626 | &bcbearer->remains_new); | ||
619 | if (bcbearer->remains_new.count == bcbearer->remains.count) | 627 | if (bcbearer->remains_new.count == bcbearer->remains.count) |
620 | continue; /* bearer pair doesn't add anything */ | 628 | continue; /* Nothing added by bearer pair */ |
621 | 629 | ||
622 | if (!tipc_bearer_blocked(p)) | 630 | if (bp_index == 0) { |
623 | tipc_bearer_send(p, buf, &p->bcast_addr); | 631 | /* Use original buffer for first bearer */ |
624 | else if (s && !tipc_bearer_blocked(s)) | 632 | tipc_bearer_send(b, buf, &b->bcast_addr); |
625 | /* unable to send on primary bearer */ | 633 | } else { |
626 | tipc_bearer_send(s, buf, &s->bcast_addr); | 634 | /* Avoid concurrent buffer access */ |
627 | else | 635 | tbuf = pskb_copy(buf, GFP_ATOMIC); |
628 | /* unable to send on either bearer */ | 636 | if (!tbuf) |
629 | continue; | 637 | break; |
638 | tipc_bearer_send(b, tbuf, &b->bcast_addr); | ||
639 | kfree_skb(tbuf); /* Bearer keeps a clone */ | ||
640 | } | ||
630 | 641 | ||
642 | /* Swap bearers for next packet */ | ||
631 | if (s) { | 643 | if (s) { |
632 | bcbearer->bpairs[bp_index].primary = s; | 644 | bcbearer->bpairs[bp_index].primary = s; |
633 | bcbearer->bpairs[bp_index].secondary = p; | 645 | bcbearer->bpairs[bp_index].secondary = p; |
634 | } | 646 | } |
635 | 647 | ||
636 | if (bcbearer->remains_new.count == 0) | 648 | if (bcbearer->remains_new.count == 0) |
637 | break; /* all targets reached */ | 649 | break; /* All targets reached */ |
638 | 650 | ||
639 | bcbearer->remains = bcbearer->remains_new; | 651 | bcbearer->remains = bcbearer->remains_new; |
640 | } | 652 | } |