diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 86 | ||||
| -rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 4 | ||||
| -rw-r--r-- | net/batman-adv/sysfs.c | 5 | ||||
| -rw-r--r-- | net/ipv4/ip_tunnel.c | 4 | ||||
| -rw-r--r-- | net/ipv4/ip_vti.c | 3 | ||||
| -rw-r--r-- | net/l2tp/l2tp_ppp.c | 6 | ||||
| -rw-r--r-- | net/packet/af_packet.c | 5 | ||||
| -rw-r--r-- | net/sctp/outqueue.c | 6 |
8 files changed, 70 insertions, 49 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 071f288b77a8..f680ee101878 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
| @@ -29,6 +29,21 @@ | |||
| 29 | #include "bat_algo.h" | 29 | #include "bat_algo.h" |
| 30 | #include "network-coding.h" | 30 | #include "network-coding.h" |
| 31 | 31 | ||
| 32 | /** | ||
| 33 | * batadv_dup_status - duplicate status | ||
| 34 | * @BATADV_NO_DUP: the packet is a duplicate | ||
| 35 | * @BATADV_ORIG_DUP: OGM is a duplicate in the originator (but not for the | ||
| 36 | * neighbor) | ||
| 37 | * @BATADV_NEIGH_DUP: OGM is a duplicate for the neighbor | ||
| 38 | * @BATADV_PROTECTED: originator is currently protected (after reboot) | ||
| 39 | */ | ||
| 40 | enum batadv_dup_status { | ||
| 41 | BATADV_NO_DUP = 0, | ||
| 42 | BATADV_ORIG_DUP, | ||
| 43 | BATADV_NEIGH_DUP, | ||
| 44 | BATADV_PROTECTED, | ||
| 45 | }; | ||
| 46 | |||
| 32 | static struct batadv_neigh_node * | 47 | static struct batadv_neigh_node * |
| 33 | batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, | 48 | batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, |
| 34 | const uint8_t *neigh_addr, | 49 | const uint8_t *neigh_addr, |
| @@ -650,7 +665,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
| 650 | const struct batadv_ogm_packet *batadv_ogm_packet, | 665 | const struct batadv_ogm_packet *batadv_ogm_packet, |
| 651 | struct batadv_hard_iface *if_incoming, | 666 | struct batadv_hard_iface *if_incoming, |
| 652 | const unsigned char *tt_buff, | 667 | const unsigned char *tt_buff, |
| 653 | int is_duplicate) | 668 | enum batadv_dup_status dup_status) |
| 654 | { | 669 | { |
| 655 | struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; | 670 | struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; |
| 656 | struct batadv_neigh_node *router = NULL; | 671 | struct batadv_neigh_node *router = NULL; |
| @@ -676,7 +691,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
| 676 | continue; | 691 | continue; |
| 677 | } | 692 | } |
| 678 | 693 | ||
| 679 | if (is_duplicate) | 694 | if (dup_status != BATADV_NO_DUP) |
| 680 | continue; | 695 | continue; |
| 681 | 696 | ||
| 682 | spin_lock_bh(&tmp_neigh_node->lq_update_lock); | 697 | spin_lock_bh(&tmp_neigh_node->lq_update_lock); |
| @@ -718,7 +733,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
| 718 | neigh_node->tq_avg = batadv_ring_buffer_avg(neigh_node->tq_recv); | 733 | neigh_node->tq_avg = batadv_ring_buffer_avg(neigh_node->tq_recv); |
| 719 | spin_unlock_bh(&neigh_node->lq_update_lock); | 734 | spin_unlock_bh(&neigh_node->lq_update_lock); |
| 720 | 735 | ||
| 721 | if (!is_duplicate) { | 736 | if (dup_status == BATADV_NO_DUP) { |
| 722 | orig_node->last_ttl = batadv_ogm_packet->header.ttl; | 737 | orig_node->last_ttl = batadv_ogm_packet->header.ttl; |
| 723 | neigh_node->last_ttl = batadv_ogm_packet->header.ttl; | 738 | neigh_node->last_ttl = batadv_ogm_packet->header.ttl; |
| 724 | } | 739 | } |
| @@ -902,15 +917,16 @@ out: | |||
| 902 | return ret; | 917 | return ret; |
| 903 | } | 918 | } |
| 904 | 919 | ||
| 905 | /* processes a batman packet for all interfaces, adjusts the sequence number and | 920 | /** |
| 906 | * finds out whether it is a duplicate. | 921 | * batadv_iv_ogm_update_seqnos - process a batman packet for all interfaces, |
| 907 | * returns: | 922 | * adjust the sequence number and find out whether it is a duplicate |
| 908 | * 1 the packet is a duplicate | 923 | * @ethhdr: ethernet header of the packet |
| 909 | * 0 the packet has not yet been received | 924 | * @batadv_ogm_packet: OGM packet to be considered |
| 910 | * -1 the packet is old and has been received while the seqno window | 925 | * @if_incoming: interface on which the OGM packet was received |
| 911 | * was protected. Caller should drop it. | 926 | * |
| 927 | * Returns duplicate status as enum batadv_dup_status | ||
| 912 | */ | 928 | */ |
| 913 | static int | 929 | static enum batadv_dup_status |
| 914 | batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | 930 | batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, |
| 915 | const struct batadv_ogm_packet *batadv_ogm_packet, | 931 | const struct batadv_ogm_packet *batadv_ogm_packet, |
| 916 | const struct batadv_hard_iface *if_incoming) | 932 | const struct batadv_hard_iface *if_incoming) |
| @@ -918,17 +934,18 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
| 918 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 934 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
| 919 | struct batadv_orig_node *orig_node; | 935 | struct batadv_orig_node *orig_node; |
| 920 | struct batadv_neigh_node *tmp_neigh_node; | 936 | struct batadv_neigh_node *tmp_neigh_node; |
| 921 | int is_duplicate = 0; | 937 | int is_dup; |
| 922 | int32_t seq_diff; | 938 | int32_t seq_diff; |
| 923 | int need_update = 0; | 939 | int need_update = 0; |
| 924 | int set_mark, ret = -1; | 940 | int set_mark; |
| 941 | enum batadv_dup_status ret = BATADV_NO_DUP; | ||
| 925 | uint32_t seqno = ntohl(batadv_ogm_packet->seqno); | 942 | uint32_t seqno = ntohl(batadv_ogm_packet->seqno); |
| 926 | uint8_t *neigh_addr; | 943 | uint8_t *neigh_addr; |
| 927 | uint8_t packet_count; | 944 | uint8_t packet_count; |
| 928 | 945 | ||
| 929 | orig_node = batadv_get_orig_node(bat_priv, batadv_ogm_packet->orig); | 946 | orig_node = batadv_get_orig_node(bat_priv, batadv_ogm_packet->orig); |
| 930 | if (!orig_node) | 947 | if (!orig_node) |
| 931 | return 0; | 948 | return BATADV_NO_DUP; |
| 932 | 949 | ||
| 933 | spin_lock_bh(&orig_node->ogm_cnt_lock); | 950 | spin_lock_bh(&orig_node->ogm_cnt_lock); |
| 934 | seq_diff = seqno - orig_node->last_real_seqno; | 951 | seq_diff = seqno - orig_node->last_real_seqno; |
| @@ -936,22 +953,29 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
| 936 | /* signalize caller that the packet is to be dropped. */ | 953 | /* signalize caller that the packet is to be dropped. */ |
| 937 | if (!hlist_empty(&orig_node->neigh_list) && | 954 | if (!hlist_empty(&orig_node->neigh_list) && |
| 938 | batadv_window_protected(bat_priv, seq_diff, | 955 | batadv_window_protected(bat_priv, seq_diff, |
| 939 | &orig_node->batman_seqno_reset)) | 956 | &orig_node->batman_seqno_reset)) { |
| 957 | ret = BATADV_PROTECTED; | ||
| 940 | goto out; | 958 | goto out; |
| 959 | } | ||
| 941 | 960 | ||
| 942 | rcu_read_lock(); | 961 | rcu_read_lock(); |
| 943 | hlist_for_each_entry_rcu(tmp_neigh_node, | 962 | hlist_for_each_entry_rcu(tmp_neigh_node, |
| 944 | &orig_node->neigh_list, list) { | 963 | &orig_node->neigh_list, list) { |
| 945 | is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits, | ||
| 946 | orig_node->last_real_seqno, | ||
| 947 | seqno); | ||
| 948 | |||
| 949 | neigh_addr = tmp_neigh_node->addr; | 964 | neigh_addr = tmp_neigh_node->addr; |
| 965 | is_dup = batadv_test_bit(tmp_neigh_node->real_bits, | ||
| 966 | orig_node->last_real_seqno, | ||
| 967 | seqno); | ||
| 968 | |||
| 950 | if (batadv_compare_eth(neigh_addr, ethhdr->h_source) && | 969 | if (batadv_compare_eth(neigh_addr, ethhdr->h_source) && |
| 951 | tmp_neigh_node->if_incoming == if_incoming) | 970 | tmp_neigh_node->if_incoming == if_incoming) { |
| 952 | set_mark = 1; | 971 | set_mark = 1; |
| 953 | else | 972 | if (is_dup) |
| 973 | ret = BATADV_NEIGH_DUP; | ||
| 974 | } else { | ||
| 954 | set_mark = 0; | 975 | set_mark = 0; |
| 976 | if (is_dup && (ret != BATADV_NEIGH_DUP)) | ||
| 977 | ret = BATADV_ORIG_DUP; | ||
| 978 | } | ||
| 955 | 979 | ||
| 956 | /* if the window moved, set the update flag. */ | 980 | /* if the window moved, set the update flag. */ |
| 957 | need_update |= batadv_bit_get_packet(bat_priv, | 981 | need_update |= batadv_bit_get_packet(bat_priv, |
| @@ -971,8 +995,6 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
| 971 | orig_node->last_real_seqno = seqno; | 995 | orig_node->last_real_seqno = seqno; |
| 972 | } | 996 | } |
| 973 | 997 | ||
| 974 | ret = is_duplicate; | ||
| 975 | |||
| 976 | out: | 998 | out: |
| 977 | spin_unlock_bh(&orig_node->ogm_cnt_lock); | 999 | spin_unlock_bh(&orig_node->ogm_cnt_lock); |
| 978 | batadv_orig_node_free_ref(orig_node); | 1000 | batadv_orig_node_free_ref(orig_node); |
| @@ -994,7 +1016,8 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | |||
| 994 | int is_broadcast = 0, is_bidirect; | 1016 | int is_broadcast = 0, is_bidirect; |
| 995 | bool is_single_hop_neigh = false; | 1017 | bool is_single_hop_neigh = false; |
| 996 | bool is_from_best_next_hop = false; | 1018 | bool is_from_best_next_hop = false; |
| 997 | int is_duplicate, sameseq, simlar_ttl; | 1019 | int sameseq, similar_ttl; |
| 1020 | enum batadv_dup_status dup_status; | ||
| 998 | uint32_t if_incoming_seqno; | 1021 | uint32_t if_incoming_seqno; |
| 999 | uint8_t *prev_sender; | 1022 | uint8_t *prev_sender; |
| 1000 | 1023 | ||
| @@ -1138,10 +1161,10 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | |||
| 1138 | if (!orig_node) | 1161 | if (!orig_node) |
| 1139 | return; | 1162 | return; |
| 1140 | 1163 | ||
| 1141 | is_duplicate = batadv_iv_ogm_update_seqnos(ethhdr, batadv_ogm_packet, | 1164 | dup_status = batadv_iv_ogm_update_seqnos(ethhdr, batadv_ogm_packet, |
| 1142 | if_incoming); | 1165 | if_incoming); |
| 1143 | 1166 | ||
| 1144 | if (is_duplicate == -1) { | 1167 | if (dup_status == BATADV_PROTECTED) { |
| 1145 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 1168 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
| 1146 | "Drop packet: packet within seqno protection time (sender: %pM)\n", | 1169 | "Drop packet: packet within seqno protection time (sender: %pM)\n", |
| 1147 | ethhdr->h_source); | 1170 | ethhdr->h_source); |
| @@ -1211,11 +1234,12 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | |||
| 1211 | * seqno and similar ttl as the non-duplicate | 1234 | * seqno and similar ttl as the non-duplicate |
| 1212 | */ | 1235 | */ |
| 1213 | sameseq = orig_node->last_real_seqno == ntohl(batadv_ogm_packet->seqno); | 1236 | sameseq = orig_node->last_real_seqno == ntohl(batadv_ogm_packet->seqno); |
| 1214 | simlar_ttl = orig_node->last_ttl - 3 <= batadv_ogm_packet->header.ttl; | 1237 | similar_ttl = orig_node->last_ttl - 3 <= batadv_ogm_packet->header.ttl; |
| 1215 | if (is_bidirect && (!is_duplicate || (sameseq && simlar_ttl))) | 1238 | if (is_bidirect && ((dup_status == BATADV_NO_DUP) || |
| 1239 | (sameseq && similar_ttl))) | ||
| 1216 | batadv_iv_ogm_orig_update(bat_priv, orig_node, ethhdr, | 1240 | batadv_iv_ogm_orig_update(bat_priv, orig_node, ethhdr, |
| 1217 | batadv_ogm_packet, if_incoming, | 1241 | batadv_ogm_packet, if_incoming, |
| 1218 | tt_buff, is_duplicate); | 1242 | tt_buff, dup_status); |
| 1219 | 1243 | ||
| 1220 | /* is single hop (direct) neighbor */ | 1244 | /* is single hop (direct) neighbor */ |
| 1221 | if (is_single_hop_neigh) { | 1245 | if (is_single_hop_neigh) { |
| @@ -1236,7 +1260,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | |||
| 1236 | goto out_neigh; | 1260 | goto out_neigh; |
| 1237 | } | 1261 | } |
| 1238 | 1262 | ||
| 1239 | if (is_duplicate) { | 1263 | if (dup_status == BATADV_NEIGH_DUP) { |
| 1240 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 1264 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
| 1241 | "Drop packet: duplicate packet received\n"); | 1265 | "Drop packet: duplicate packet received\n"); |
| 1242 | goto out_neigh; | 1266 | goto out_neigh; |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 379061c72549..de27b3175cfd 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
| @@ -1067,6 +1067,10 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv, | |||
| 1067 | group = htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN)); | 1067 | group = htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN)); |
| 1068 | bat_priv->bla.claim_dest.group = group; | 1068 | bat_priv->bla.claim_dest.group = group; |
| 1069 | 1069 | ||
| 1070 | /* purge everything when bridge loop avoidance is turned off */ | ||
| 1071 | if (!atomic_read(&bat_priv->bridge_loop_avoidance)) | ||
| 1072 | oldif = NULL; | ||
| 1073 | |||
| 1070 | if (!oldif) { | 1074 | if (!oldif) { |
| 1071 | batadv_bla_purge_claims(bat_priv, NULL, 1); | 1075 | batadv_bla_purge_claims(bat_priv, NULL, 1); |
| 1072 | batadv_bla_purge_backbone_gw(bat_priv, 1); | 1076 | batadv_bla_purge_backbone_gw(bat_priv, 1); |
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c index 15a22efa9a67..929e304dacb2 100644 --- a/net/batman-adv/sysfs.c +++ b/net/batman-adv/sysfs.c | |||
| @@ -582,10 +582,7 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj, | |||
| 582 | (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0)) | 582 | (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0)) |
| 583 | goto out; | 583 | goto out; |
| 584 | 584 | ||
| 585 | if (!rtnl_trylock()) { | 585 | rtnl_lock(); |
| 586 | ret = -ERESTARTSYS; | ||
| 587 | goto out; | ||
| 588 | } | ||
| 589 | 586 | ||
| 590 | if (status_tmp == BATADV_IF_NOT_IN_USE) { | 587 | if (status_tmp == BATADV_IF_NOT_IN_USE) { |
| 591 | batadv_hardif_disable_interface(hard_iface, | 588 | batadv_hardif_disable_interface(hard_iface, |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index be2f8da0ae8e..7fa8f08fa7ae 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
| @@ -853,7 +853,7 @@ void ip_tunnel_dellink(struct net_device *dev, struct list_head *head) | |||
| 853 | } | 853 | } |
| 854 | EXPORT_SYMBOL_GPL(ip_tunnel_dellink); | 854 | EXPORT_SYMBOL_GPL(ip_tunnel_dellink); |
| 855 | 855 | ||
| 856 | int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, | 856 | int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, |
| 857 | struct rtnl_link_ops *ops, char *devname) | 857 | struct rtnl_link_ops *ops, char *devname) |
| 858 | { | 858 | { |
| 859 | struct ip_tunnel_net *itn = net_generic(net, ip_tnl_net_id); | 859 | struct ip_tunnel_net *itn = net_generic(net, ip_tnl_net_id); |
| @@ -899,7 +899,7 @@ static void ip_tunnel_destroy(struct ip_tunnel_net *itn, struct list_head *head) | |||
| 899 | unregister_netdevice_queue(itn->fb_tunnel_dev, head); | 899 | unregister_netdevice_queue(itn->fb_tunnel_dev, head); |
| 900 | } | 900 | } |
| 901 | 901 | ||
| 902 | void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn) | 902 | void ip_tunnel_delete_net(struct ip_tunnel_net *itn) |
| 903 | { | 903 | { |
| 904 | LIST_HEAD(list); | 904 | LIST_HEAD(list); |
| 905 | 905 | ||
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index 9d2bdb2c1d3f..c118f6b576bb 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c | |||
| @@ -361,8 +361,7 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 361 | tunnel->err_count = 0; | 361 | tunnel->err_count = 0; |
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | | 364 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); |
| 365 | IPSKB_REROUTED); | ||
| 366 | skb_dst_drop(skb); | 365 | skb_dst_drop(skb); |
| 367 | skb_dst_set(skb, &rt->dst); | 366 | skb_dst_set(skb, &rt->dst); |
| 368 | nf_reset(skb); | 367 | nf_reset(skb); |
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 637a341c1e2d..8dec6876dc50 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
| @@ -346,19 +346,19 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
| 346 | skb_put(skb, 2); | 346 | skb_put(skb, 2); |
| 347 | 347 | ||
| 348 | /* Copy user data into skb */ | 348 | /* Copy user data into skb */ |
| 349 | error = memcpy_fromiovec(skb->data, m->msg_iov, total_len); | 349 | error = memcpy_fromiovec(skb_put(skb, total_len), m->msg_iov, |
| 350 | total_len); | ||
| 350 | if (error < 0) { | 351 | if (error < 0) { |
| 351 | kfree_skb(skb); | 352 | kfree_skb(skb); |
| 352 | goto error_put_sess_tun; | 353 | goto error_put_sess_tun; |
| 353 | } | 354 | } |
| 354 | skb_put(skb, total_len); | ||
| 355 | 355 | ||
| 356 | l2tp_xmit_skb(session, skb, session->hdr_len); | 356 | l2tp_xmit_skb(session, skb, session->hdr_len); |
| 357 | 357 | ||
| 358 | sock_put(ps->tunnel_sock); | 358 | sock_put(ps->tunnel_sock); |
| 359 | sock_put(sk); | 359 | sock_put(sk); |
| 360 | 360 | ||
| 361 | return error; | 361 | return total_len; |
| 362 | 362 | ||
| 363 | error_put_sess_tun: | 363 | error_put_sess_tun: |
| 364 | sock_put(ps->tunnel_sock); | 364 | sock_put(ps->tunnel_sock); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 8ec1bca7f859..20a1bd0e6549 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -2851,12 +2851,11 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr, | |||
| 2851 | return -EOPNOTSUPP; | 2851 | return -EOPNOTSUPP; |
| 2852 | 2852 | ||
| 2853 | uaddr->sa_family = AF_PACKET; | 2853 | uaddr->sa_family = AF_PACKET; |
| 2854 | memset(uaddr->sa_data, 0, sizeof(uaddr->sa_data)); | ||
| 2854 | rcu_read_lock(); | 2855 | rcu_read_lock(); |
| 2855 | dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex); | 2856 | dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex); |
| 2856 | if (dev) | 2857 | if (dev) |
| 2857 | strncpy(uaddr->sa_data, dev->name, 14); | 2858 | strlcpy(uaddr->sa_data, dev->name, sizeof(uaddr->sa_data)); |
| 2858 | else | ||
| 2859 | memset(uaddr->sa_data, 0, 14); | ||
| 2860 | rcu_read_unlock(); | 2859 | rcu_read_unlock(); |
| 2861 | *uaddr_len = sizeof(*uaddr); | 2860 | *uaddr_len = sizeof(*uaddr); |
| 2862 | 2861 | ||
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 32a4625fef77..be35e2dbcc9a 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
| @@ -206,6 +206,8 @@ static inline int sctp_cacc_skip(struct sctp_transport *primary, | |||
| 206 | */ | 206 | */ |
| 207 | void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q) | 207 | void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q) |
| 208 | { | 208 | { |
| 209 | memset(q, 0, sizeof(struct sctp_outq)); | ||
| 210 | |||
| 209 | q->asoc = asoc; | 211 | q->asoc = asoc; |
| 210 | INIT_LIST_HEAD(&q->out_chunk_list); | 212 | INIT_LIST_HEAD(&q->out_chunk_list); |
| 211 | INIT_LIST_HEAD(&q->control_chunk_list); | 213 | INIT_LIST_HEAD(&q->control_chunk_list); |
| @@ -213,11 +215,7 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q) | |||
| 213 | INIT_LIST_HEAD(&q->sacked); | 215 | INIT_LIST_HEAD(&q->sacked); |
| 214 | INIT_LIST_HEAD(&q->abandoned); | 216 | INIT_LIST_HEAD(&q->abandoned); |
| 215 | 217 | ||
| 216 | q->fast_rtx = 0; | ||
| 217 | q->outstanding_bytes = 0; | ||
| 218 | q->empty = 1; | 218 | q->empty = 1; |
| 219 | q->cork = 0; | ||
| 220 | q->out_qlen = 0; | ||
| 221 | } | 219 | } |
| 222 | 220 | ||
| 223 | /* Free the outqueue structure and any related pending chunks. | 221 | /* Free the outqueue structure and any related pending chunks. |
