aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-08-21 20:06:42 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-21 20:06:42 -0400
commite2a7c34fb2856fd5306e307e170e3dde358d0dce (patch)
treeafeb300b04186b1a1f649b2cd8a401a75878297c /net
parent7d3f0cd43feea1636dd7746f22fe8249b34d1b79 (diff)
parent6470812e22261d2342ef1597be62e63a0423d691 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net')
-rw-r--r--net/core/datagram.c12
-rw-r--r--net/dccp/proto.c14
-rw-r--r--net/ipv4/igmp.c10
-rw-r--r--net/ipv4/route.c13
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv6/ip6_fib.c28
-rw-r--r--net/ipv6/udp.c3
-rw-r--r--net/irda/af_irda.c2
-rw-r--r--net/openvswitch/actions.c1
-rw-r--r--net/openvswitch/datapath.c7
-rw-r--r--net/openvswitch/datapath.h2
-rw-r--r--net/rxrpc/call_accept.c1
-rw-r--r--net/sched/act_ipt.c2
-rw-r--r--net/sched/cls_api.c2
-rw-r--r--net/sctp/ipv6.c2
-rw-r--r--net/tipc/netlink_compat.c6
-rw-r--r--net/unix/af_unix.c5
18 files changed, 79 insertions, 37 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 2f3277945d35..a4d5f10d83a1 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -169,14 +169,20 @@ struct sk_buff *__skb_try_recv_from_queue(struct sock *sk,
169 int *peeked, int *off, int *err, 169 int *peeked, int *off, int *err,
170 struct sk_buff **last) 170 struct sk_buff **last)
171{ 171{
172 bool peek_at_off = false;
172 struct sk_buff *skb; 173 struct sk_buff *skb;
173 int _off = *off; 174 int _off = 0;
175
176 if (unlikely(flags & MSG_PEEK && *off >= 0)) {
177 peek_at_off = true;
178 _off = *off;
179 }
174 180
175 *last = queue->prev; 181 *last = queue->prev;
176 skb_queue_walk(queue, skb) { 182 skb_queue_walk(queue, skb) {
177 if (flags & MSG_PEEK) { 183 if (flags & MSG_PEEK) {
178 if (_off >= skb->len && (skb->len || _off || 184 if (peek_at_off && _off >= skb->len &&
179 skb->peeked)) { 185 (_off || skb->peeked)) {
180 _off -= skb->len; 186 _off -= skb->len;
181 continue; 187 continue;
182 } 188 }
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 86bc40ba6ba5..b68168fcc06a 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -24,6 +24,7 @@
24#include <net/checksum.h> 24#include <net/checksum.h>
25 25
26#include <net/inet_sock.h> 26#include <net/inet_sock.h>
27#include <net/inet_common.h>
27#include <net/sock.h> 28#include <net/sock.h>
28#include <net/xfrm.h> 29#include <net/xfrm.h>
29 30
@@ -170,6 +171,15 @@ const char *dccp_packet_name(const int type)
170 171
171EXPORT_SYMBOL_GPL(dccp_packet_name); 172EXPORT_SYMBOL_GPL(dccp_packet_name);
172 173
174static void dccp_sk_destruct(struct sock *sk)
175{
176 struct dccp_sock *dp = dccp_sk(sk);
177
178 ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
179 dp->dccps_hc_tx_ccid = NULL;
180 inet_sock_destruct(sk);
181}
182
173int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) 183int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
174{ 184{
175 struct dccp_sock *dp = dccp_sk(sk); 185 struct dccp_sock *dp = dccp_sk(sk);
@@ -179,6 +189,7 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
179 icsk->icsk_syn_retries = sysctl_dccp_request_retries; 189 icsk->icsk_syn_retries = sysctl_dccp_request_retries;
180 sk->sk_state = DCCP_CLOSED; 190 sk->sk_state = DCCP_CLOSED;
181 sk->sk_write_space = dccp_write_space; 191 sk->sk_write_space = dccp_write_space;
192 sk->sk_destruct = dccp_sk_destruct;
182 icsk->icsk_sync_mss = dccp_sync_mss; 193 icsk->icsk_sync_mss = dccp_sync_mss;
183 dp->dccps_mss_cache = 536; 194 dp->dccps_mss_cache = 536;
184 dp->dccps_rate_last = jiffies; 195 dp->dccps_rate_last = jiffies;
@@ -219,8 +230,7 @@ void dccp_destroy_sock(struct sock *sk)
219 dp->dccps_hc_rx_ackvec = NULL; 230 dp->dccps_hc_rx_ackvec = NULL;
220 } 231 }
221 ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); 232 ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
222 ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); 233 dp->dccps_hc_rx_ccid = NULL;
223 dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
224 234
225 /* clean up feature negotiation state */ 235 /* clean up feature negotiation state */
226 dccp_feat_list_purge(&dp->dccps_featneg); 236 dccp_feat_list_purge(&dp->dccps_featneg);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 9f86b5133605..ab183af0b5b6 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1007,10 +1007,18 @@ int igmp_rcv(struct sk_buff *skb)
1007{ 1007{
1008 /* This basically follows the spec line by line -- see RFC1112 */ 1008 /* This basically follows the spec line by line -- see RFC1112 */
1009 struct igmphdr *ih; 1009 struct igmphdr *ih;
1010 struct in_device *in_dev = __in_dev_get_rcu(skb->dev); 1010 struct net_device *dev = skb->dev;
1011 struct in_device *in_dev;
1011 int len = skb->len; 1012 int len = skb->len;
1012 bool dropped = true; 1013 bool dropped = true;
1013 1014
1015 if (netif_is_l3_master(dev)) {
1016 dev = dev_get_by_index_rcu(dev_net(dev), IPCB(skb)->iif);
1017 if (!dev)
1018 goto drop;
1019 }
1020
1021 in_dev = __in_dev_get_rcu(dev);
1014 if (!in_dev) 1022 if (!in_dev)
1015 goto drop; 1023 goto drop;
1016 1024
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 872b4cb136d3..94d4cd2d5ea4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1267,7 +1267,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
1267 if (mtu) 1267 if (mtu)
1268 return mtu; 1268 return mtu;
1269 1269
1270 mtu = dst->dev->mtu; 1270 mtu = READ_ONCE(dst->dev->mtu);
1271 1271
1272 if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { 1272 if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
1273 if (rt->rt_uses_gateway && mtu > 576) 1273 if (rt->rt_uses_gateway && mtu > 576)
@@ -2769,14 +2769,21 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
2769 if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE) 2769 if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE)
2770 table_id = rt->rt_table_id; 2770 table_id = rt->rt_table_id;
2771 2771
2772 if (rtm->rtm_flags & RTM_F_FIB_MATCH) 2772 if (rtm->rtm_flags & RTM_F_FIB_MATCH) {
2773 if (!res.fi) {
2774 err = fib_props[res.type].error;
2775 if (!err)
2776 err = -EHOSTUNREACH;
2777 goto errout_free;
2778 }
2773 err = fib_dump_info(skb, NETLINK_CB(in_skb).portid, 2779 err = fib_dump_info(skb, NETLINK_CB(in_skb).portid,
2774 nlh->nlmsg_seq, RTM_NEWROUTE, table_id, 2780 nlh->nlmsg_seq, RTM_NEWROUTE, table_id,
2775 rt->rt_type, res.prefix, res.prefixlen, 2781 rt->rt_type, res.prefix, res.prefixlen,
2776 fl4.flowi4_tos, res.fi, 0); 2782 fl4.flowi4_tos, res.fi, 0);
2777 else 2783 } else {
2778 err = rt_fill_info(net, dst, src, table_id, &fl4, skb, 2784 err = rt_fill_info(net, dst, src, table_id, &fl4, skb,
2779 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq); 2785 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq);
2786 }
2780 if (err < 0) 2787 if (err < 0)
2781 goto errout_free; 2788 goto errout_free;
2782 2789
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d73903fe8c83..ddc854728a60 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3009,8 +3009,7 @@ void tcp_rearm_rto(struct sock *sk)
3009 /* delta_us may not be positive if the socket is locked 3009 /* delta_us may not be positive if the socket is locked
3010 * when the retrans timer fires and is rescheduled. 3010 * when the retrans timer fires and is rescheduled.
3011 */ 3011 */
3012 if (delta_us > 0) 3012 rto = usecs_to_jiffies(max_t(int, delta_us, 1));
3013 rto = usecs_to_jiffies(delta_us);
3014 } 3013 }
3015 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto, 3014 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
3016 TCP_RTO_MAX); 3015 TCP_RTO_MAX);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cb633884e825..25fb14490d6a 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1585,7 +1585,8 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
1585 return ip_recv_error(sk, msg, len, addr_len); 1585 return ip_recv_error(sk, msg, len, addr_len);
1586 1586
1587try_again: 1587try_again:
1588 peeking = off = sk_peek_offset(sk, flags); 1588 peeking = flags & MSG_PEEK;
1589 off = sk_peek_offset(sk, flags);
1589 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); 1590 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err);
1590 if (!skb) 1591 if (!skb)
1591 return err; 1592 return err;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 8c58c7558de0..549aacc3cb2c 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1013,6 +1013,8 @@ add:
1013 nsiblings = iter->rt6i_nsiblings; 1013 nsiblings = iter->rt6i_nsiblings;
1014 iter->rt6i_node = NULL; 1014 iter->rt6i_node = NULL;
1015 fib6_purge_rt(iter, fn, info->nl_net); 1015 fib6_purge_rt(iter, fn, info->nl_net);
1016 if (fn->rr_ptr == iter)
1017 fn->rr_ptr = NULL;
1016 rt6_release(iter); 1018 rt6_release(iter);
1017 1019
1018 if (nsiblings) { 1020 if (nsiblings) {
@@ -1026,6 +1028,8 @@ add:
1026 *ins = iter->dst.rt6_next; 1028 *ins = iter->dst.rt6_next;
1027 iter->rt6i_node = NULL; 1029 iter->rt6i_node = NULL;
1028 fib6_purge_rt(iter, fn, info->nl_net); 1030 fib6_purge_rt(iter, fn, info->nl_net);
1031 if (fn->rr_ptr == iter)
1032 fn->rr_ptr = NULL;
1029 rt6_release(iter); 1033 rt6_release(iter);
1030 nsiblings--; 1034 nsiblings--;
1031 } else { 1035 } else {
@@ -1114,7 +1118,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1114 /* Create subtree root node */ 1118 /* Create subtree root node */
1115 sfn = node_alloc(); 1119 sfn = node_alloc();
1116 if (!sfn) 1120 if (!sfn)
1117 goto st_failure; 1121 goto failure;
1118 1122
1119 sfn->leaf = info->nl_net->ipv6.ip6_null_entry; 1123 sfn->leaf = info->nl_net->ipv6.ip6_null_entry;
1120 atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref); 1124 atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref);
@@ -1131,12 +1135,12 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1131 1135
1132 if (IS_ERR(sn)) { 1136 if (IS_ERR(sn)) {
1133 /* If it is failed, discard just allocated 1137 /* If it is failed, discard just allocated
1134 root, and then (in st_failure) stale node 1138 root, and then (in failure) stale node
1135 in main tree. 1139 in main tree.
1136 */ 1140 */
1137 node_free(sfn); 1141 node_free(sfn);
1138 err = PTR_ERR(sn); 1142 err = PTR_ERR(sn);
1139 goto st_failure; 1143 goto failure;
1140 } 1144 }
1141 1145
1142 /* Now link new subtree to main tree */ 1146 /* Now link new subtree to main tree */
@@ -1151,7 +1155,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1151 1155
1152 if (IS_ERR(sn)) { 1156 if (IS_ERR(sn)) {
1153 err = PTR_ERR(sn); 1157 err = PTR_ERR(sn);
1154 goto st_failure; 1158 goto failure;
1155 } 1159 }
1156 } 1160 }
1157 1161
@@ -1192,18 +1196,17 @@ out:
1192 atomic_inc(&pn->leaf->rt6i_ref); 1196 atomic_inc(&pn->leaf->rt6i_ref);
1193 } 1197 }
1194#endif 1198#endif
1195 /* Always release dst as dst->__refcnt is guaranteed 1199 goto failure;
1196 * to be taken before entering this function
1197 */
1198 dst_release_immediate(&rt->dst);
1199 } 1200 }
1200 return err; 1201 return err;
1201 1202
1202#ifdef CONFIG_IPV6_SUBTREES 1203failure:
1203 /* Subtree creation failed, probably main tree node 1204 /* fn->leaf could be NULL if fn is an intermediate node and we
1204 is orphan. If it is, shoot it. 1205 * failed to add the new route to it in both subtree creation
1206 * failure and fib6_add_rt2node() failure case.
1207 * In both cases, fib6_repair_tree() should be called to fix
1208 * fn->leaf.
1205 */ 1209 */
1206st_failure:
1207 if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT))) 1210 if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT)))
1208 fib6_repair_tree(info->nl_net, fn); 1211 fib6_repair_tree(info->nl_net, fn);
1209 /* Always release dst as dst->__refcnt is guaranteed 1212 /* Always release dst as dst->__refcnt is guaranteed
@@ -1211,7 +1214,6 @@ st_failure:
1211 */ 1214 */
1212 dst_release_immediate(&rt->dst); 1215 dst_release_immediate(&rt->dst);
1213 return err; 1216 return err;
1214#endif
1215} 1217}
1216 1218
1217/* 1219/*
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 19afcaf4a22e..2a15f1bb6ef8 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -366,7 +366,8 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
366 return ipv6_recv_rxpmtu(sk, msg, len, addr_len); 366 return ipv6_recv_rxpmtu(sk, msg, len, addr_len);
367 367
368try_again: 368try_again:
369 peeking = off = sk_peek_offset(sk, flags); 369 peeking = flags & MSG_PEEK;
370 off = sk_peek_offset(sk, flags);
370 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err); 371 skb = __skb_recv_udp(sk, flags, noblock, &peeked, &off, &err);
371 if (!skb) 372 if (!skb)
372 return err; 373 return err;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 2e6990f8b80b..23fa7c8b09a5 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2213,7 +2213,7 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
2213{ 2213{
2214 struct sock *sk = sock->sk; 2214 struct sock *sk = sock->sk;
2215 struct irda_sock *self = irda_sk(sk); 2215 struct irda_sock *self = irda_sk(sk);
2216 struct irda_device_list list; 2216 struct irda_device_list list = { 0 };
2217 struct irda_device_info *discoveries; 2217 struct irda_device_info *discoveries;
2218 struct irda_ias_set * ias_opt; /* IAS get/query params */ 2218 struct irda_ias_set * ias_opt; /* IAS get/query params */
2219 struct ias_object * ias_obj; /* Object in IAS */ 2219 struct ias_object * ias_obj; /* Object in IAS */
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index e4610676299b..a54a556fcdb5 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -1337,6 +1337,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
1337 goto out; 1337 goto out;
1338 } 1338 }
1339 1339
1340 OVS_CB(skb)->acts_origlen = acts->orig_len;
1340 err = do_execute_actions(dp, skb, key, 1341 err = do_execute_actions(dp, skb, key,
1341 acts->actions, acts->actions_len); 1342 acts->actions, acts->actions_len);
1342 1343
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index f6e229b51dfb..76cf273a56c7 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -367,7 +367,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
367} 367}
368 368
369static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info, 369static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
370 unsigned int hdrlen) 370 unsigned int hdrlen, int actions_attrlen)
371{ 371{
372 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) 372 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header))
373 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ 373 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */
@@ -384,7 +384,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
384 384
385 /* OVS_PACKET_ATTR_ACTIONS */ 385 /* OVS_PACKET_ATTR_ACTIONS */
386 if (upcall_info->actions_len) 386 if (upcall_info->actions_len)
387 size += nla_total_size(upcall_info->actions_len); 387 size += nla_total_size(actions_attrlen);
388 388
389 /* OVS_PACKET_ATTR_MRU */ 389 /* OVS_PACKET_ATTR_MRU */
390 if (upcall_info->mru) 390 if (upcall_info->mru)
@@ -451,7 +451,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
451 else 451 else
452 hlen = skb->len; 452 hlen = skb->len;
453 453
454 len = upcall_msg_size(upcall_info, hlen - cutlen); 454 len = upcall_msg_size(upcall_info, hlen - cutlen,
455 OVS_CB(skb)->acts_origlen);
455 user_skb = genlmsg_new(len, GFP_ATOMIC); 456 user_skb = genlmsg_new(len, GFP_ATOMIC);
456 if (!user_skb) { 457 if (!user_skb) {
457 err = -ENOMEM; 458 err = -ENOMEM;
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
index 5d8dcd88815f..480600649d0b 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -99,11 +99,13 @@ struct datapath {
99 * when a packet is received by OVS. 99 * when a packet is received by OVS.
100 * @mru: The maximum received fragement size; 0 if the packet is not 100 * @mru: The maximum received fragement size; 0 if the packet is not
101 * fragmented. 101 * fragmented.
102 * @acts_origlen: The netlink size of the flow actions applied to this skb.
102 * @cutlen: The number of bytes from the packet end to be removed. 103 * @cutlen: The number of bytes from the packet end to be removed.
103 */ 104 */
104struct ovs_skb_cb { 105struct ovs_skb_cb {
105 struct vport *input_vport; 106 struct vport *input_vport;
106 u16 mru; 107 u16 mru;
108 u16 acts_origlen;
107 u32 cutlen; 109 u32 cutlen;
108}; 110};
109#define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) 111#define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
index dd30d74824b0..ec3383f97d4c 100644
--- a/net/rxrpc/call_accept.c
+++ b/net/rxrpc/call_accept.c
@@ -223,6 +223,7 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx)
223 tail = b->call_backlog_tail; 223 tail = b->call_backlog_tail;
224 while (CIRC_CNT(head, tail, size) > 0) { 224 while (CIRC_CNT(head, tail, size) > 0) {
225 struct rxrpc_call *call = b->call_backlog[tail]; 225 struct rxrpc_call *call = b->call_backlog[tail];
226 call->socket = rx;
226 if (rx->discard_new_call) { 227 if (rx->discard_new_call) {
227 _debug("discard %lx", call->user_call_ID); 228 _debug("discard %lx", call->user_call_ID);
228 rx->discard_new_call(call, call->user_call_ID); 229 rx->discard_new_call(call, call->user_call_ID);
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index d516ba8178b8..541707802a23 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -41,6 +41,7 @@ static int ipt_init_target(struct net *net, struct xt_entry_target *t,
41{ 41{
42 struct xt_tgchk_param par; 42 struct xt_tgchk_param par;
43 struct xt_target *target; 43 struct xt_target *target;
44 struct ipt_entry e = {};
44 int ret = 0; 45 int ret = 0;
45 46
46 target = xt_request_find_target(AF_INET, t->u.user.name, 47 target = xt_request_find_target(AF_INET, t->u.user.name,
@@ -52,6 +53,7 @@ static int ipt_init_target(struct net *net, struct xt_entry_target *t,
52 memset(&par, 0, sizeof(par)); 53 memset(&par, 0, sizeof(par));
53 par.net = net; 54 par.net = net;
54 par.table = table; 55 par.table = table;
56 par.entryinfo = &e;
55 par.target = target; 57 par.target = target;
56 par.targinfo = t->data; 58 par.targinfo = t->data;
57 par.hook_mask = hook; 59 par.hook_mask = hook;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index ebeeb87e6d44..eef6b077f30e 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -190,7 +190,7 @@ static void tcf_chain_flush(struct tcf_chain *chain)
190{ 190{
191 struct tcf_proto *tp; 191 struct tcf_proto *tp;
192 192
193 if (*chain->p_filter_chain) 193 if (chain->p_filter_chain)
194 RCU_INIT_POINTER(*chain->p_filter_chain, NULL); 194 RCU_INIT_POINTER(*chain->p_filter_chain, NULL);
195 while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) { 195 while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) {
196 RCU_INIT_POINTER(chain->filter_chain, tp->next); 196 RCU_INIT_POINTER(chain->filter_chain, tp->next);
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index a2a1c1d08d51..51c488769590 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -512,7 +512,9 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
512{ 512{
513 addr->sa.sa_family = AF_INET6; 513 addr->sa.sa_family = AF_INET6;
514 addr->v6.sin6_port = port; 514 addr->v6.sin6_port = port;
515 addr->v6.sin6_flowinfo = 0;
515 addr->v6.sin6_addr = *saddr; 516 addr->v6.sin6_addr = *saddr;
517 addr->v6.sin6_scope_id = 0;
516} 518}
517 519
518/* Compare addresses exactly. 520/* Compare addresses exactly.
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 9bfe886ab330..750949dfc1d7 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -258,13 +258,15 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
258 arg = nlmsg_new(0, GFP_KERNEL); 258 arg = nlmsg_new(0, GFP_KERNEL);
259 if (!arg) { 259 if (!arg) {
260 kfree_skb(msg->rep); 260 kfree_skb(msg->rep);
261 msg->rep = NULL;
261 return -ENOMEM; 262 return -ENOMEM;
262 } 263 }
263 264
264 err = __tipc_nl_compat_dumpit(cmd, msg, arg); 265 err = __tipc_nl_compat_dumpit(cmd, msg, arg);
265 if (err) 266 if (err) {
266 kfree_skb(msg->rep); 267 kfree_skb(msg->rep);
267 268 msg->rep = NULL;
269 }
268 kfree_skb(arg); 270 kfree_skb(arg);
269 271
270 return err; 272 return err;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 5c53f22d62e8..7f46bab4ce5c 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2283,10 +2283,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state,
2283 */ 2283 */
2284 mutex_lock(&u->iolock); 2284 mutex_lock(&u->iolock);
2285 2285
2286 if (flags & MSG_PEEK) 2286 skip = max(sk_peek_offset(sk, flags), 0);
2287 skip = sk_peek_offset(sk, flags);
2288 else
2289 skip = 0;
2290 2287
2291 do { 2288 do {
2292 int chunk; 2289 int chunk;