diff options
author | David S. Miller <davem@davemloft.net> | 2015-01-15 00:53:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-15 00:53:17 -0500 |
commit | 3f3558bb512e0762d5a4573a4aaf038d7a616e92 (patch) | |
tree | 1e2b43d410093e949209ca33614f5cdfdd16e80e /net | |
parent | 9a6b4b392de4569e83ecfd6f382f3369f250b52f (diff) | |
parent | a6391a924cf5a16761ccd6b45094a7d5b9aeebac (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/xen-netfront.c
Minor overlapping changes in xen-netfront.c, mostly to do
with some buffer management changes alongside the split
of stats into TX and RX.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_input.c | 3 | ||||
-rw-r--r-- | net/ceph/auth_x.c | 2 | ||||
-rw-r--r-- | net/ceph/mon_client.c | 2 | ||||
-rw-r--r-- | net/core/neighbour.c | 44 | ||||
-rw-r--r-- | net/ipv4/netfilter/nft_redir_ipv4.c | 8 | ||||
-rw-r--r-- | net/ipv6/netfilter/nft_redir_ipv6.c | 8 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 10 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 20 | ||||
-rw-r--r-- | net/netfilter/nf_tables_api.c | 14 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 5 | ||||
-rw-r--r-- | net/netfilter/nft_nat.c | 8 | ||||
-rw-r--r-- | net/openvswitch/datapath.c | 3 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xdr.c | 6 |
14 files changed, 92 insertions, 43 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 1f1de715197c..e2aa7be3a847 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -154,7 +154,8 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
154 | dst = NULL; | 154 | dst = NULL; |
155 | 155 | ||
156 | if (is_broadcast_ether_addr(dest)) { | 156 | if (is_broadcast_ether_addr(dest)) { |
157 | if (p->flags & BR_PROXYARP && | 157 | if (IS_ENABLED(CONFIG_INET) && |
158 | p->flags & BR_PROXYARP && | ||
158 | skb->protocol == htons(ETH_P_ARP)) | 159 | skb->protocol == htons(ETH_P_ARP)) |
159 | br_do_proxy_arp(skb, br, vid); | 160 | br_do_proxy_arp(skb, br, vid); |
160 | 161 | ||
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index 15845814a0f2..ba6eb17226da 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c | |||
@@ -676,7 +676,7 @@ static int calcu_signature(struct ceph_x_authorizer *au, | |||
676 | int ret; | 676 | int ret; |
677 | char tmp_enc[40]; | 677 | char tmp_enc[40]; |
678 | __le32 tmp[5] = { | 678 | __le32 tmp[5] = { |
679 | 16u, msg->hdr.crc, msg->footer.front_crc, | 679 | cpu_to_le32(16), msg->hdr.crc, msg->footer.front_crc, |
680 | msg->footer.middle_crc, msg->footer.data_crc, | 680 | msg->footer.middle_crc, msg->footer.data_crc, |
681 | }; | 681 | }; |
682 | ret = ceph_x_encrypt(&au->session_key, &tmp, sizeof(tmp), | 682 | ret = ceph_x_encrypt(&au->session_key, &tmp, sizeof(tmp), |
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index a83062ceeec9..f2148e22b148 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -717,7 +717,7 @@ static int get_poolop_reply_buf(const char *src, size_t src_len, | |||
717 | if (src_len != sizeof(u32) + dst_len) | 717 | if (src_len != sizeof(u32) + dst_len) |
718 | return -EINVAL; | 718 | return -EINVAL; |
719 | 719 | ||
720 | buf_len = le32_to_cpu(*(u32 *)src); | 720 | buf_len = le32_to_cpu(*(__le32 *)src); |
721 | if (buf_len != dst_len) | 721 | if (buf_len != dst_len) |
722 | return -EINVAL; | 722 | return -EINVAL; |
723 | 723 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 8e38f17288d3..8d614c93f86a 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2043,6 +2043,12 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2043 | case NDTPA_BASE_REACHABLE_TIME: | 2043 | case NDTPA_BASE_REACHABLE_TIME: |
2044 | NEIGH_VAR_SET(p, BASE_REACHABLE_TIME, | 2044 | NEIGH_VAR_SET(p, BASE_REACHABLE_TIME, |
2045 | nla_get_msecs(tbp[i])); | 2045 | nla_get_msecs(tbp[i])); |
2046 | /* update reachable_time as well, otherwise, the change will | ||
2047 | * only be effective after the next time neigh_periodic_work | ||
2048 | * decides to recompute it (can be multiple minutes) | ||
2049 | */ | ||
2050 | p->reachable_time = | ||
2051 | neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); | ||
2046 | break; | 2052 | break; |
2047 | case NDTPA_GC_STALETIME: | 2053 | case NDTPA_GC_STALETIME: |
2048 | NEIGH_VAR_SET(p, GC_STALETIME, | 2054 | NEIGH_VAR_SET(p, GC_STALETIME, |
@@ -2921,6 +2927,31 @@ static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write, | |||
2921 | return ret; | 2927 | return ret; |
2922 | } | 2928 | } |
2923 | 2929 | ||
2930 | static int neigh_proc_base_reachable_time(struct ctl_table *ctl, int write, | ||
2931 | void __user *buffer, | ||
2932 | size_t *lenp, loff_t *ppos) | ||
2933 | { | ||
2934 | struct neigh_parms *p = ctl->extra2; | ||
2935 | int ret; | ||
2936 | |||
2937 | if (strcmp(ctl->procname, "base_reachable_time") == 0) | ||
2938 | ret = neigh_proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos); | ||
2939 | else if (strcmp(ctl->procname, "base_reachable_time_ms") == 0) | ||
2940 | ret = neigh_proc_dointvec_ms_jiffies(ctl, write, buffer, lenp, ppos); | ||
2941 | else | ||
2942 | ret = -1; | ||
2943 | |||
2944 | if (write && ret == 0) { | ||
2945 | /* update reachable_time as well, otherwise, the change will | ||
2946 | * only be effective after the next time neigh_periodic_work | ||
2947 | * decides to recompute it | ||
2948 | */ | ||
2949 | p->reachable_time = | ||
2950 | neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); | ||
2951 | } | ||
2952 | return ret; | ||
2953 | } | ||
2954 | |||
2924 | #define NEIGH_PARMS_DATA_OFFSET(index) \ | 2955 | #define NEIGH_PARMS_DATA_OFFSET(index) \ |
2925 | (&((struct neigh_parms *) 0)->data[index]) | 2956 | (&((struct neigh_parms *) 0)->data[index]) |
2926 | 2957 | ||
@@ -3047,6 +3078,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
3047 | t->neigh_vars[NEIGH_VAR_RETRANS_TIME_MS].proc_handler = handler; | 3078 | t->neigh_vars[NEIGH_VAR_RETRANS_TIME_MS].proc_handler = handler; |
3048 | /* ReachableTime (in milliseconds) */ | 3079 | /* ReachableTime (in milliseconds) */ |
3049 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = handler; | 3080 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = handler; |
3081 | } else { | ||
3082 | /* Those handlers will update p->reachable_time after | ||
3083 | * base_reachable_time(_ms) is set to ensure the new timer starts being | ||
3084 | * applied after the next neighbour update instead of waiting for | ||
3085 | * neigh_periodic_work to update its value (can be multiple minutes) | ||
3086 | * So any handler that replaces them should do this as well | ||
3087 | */ | ||
3088 | /* ReachableTime */ | ||
3089 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME].proc_handler = | ||
3090 | neigh_proc_base_reachable_time; | ||
3091 | /* ReachableTime (in milliseconds) */ | ||
3092 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = | ||
3093 | neigh_proc_base_reachable_time; | ||
3050 | } | 3094 | } |
3051 | 3095 | ||
3052 | /* Don't export sysctls to unprivileged users */ | 3096 | /* Don't export sysctls to unprivileged users */ |
diff --git a/net/ipv4/netfilter/nft_redir_ipv4.c b/net/ipv4/netfilter/nft_redir_ipv4.c index ff2d23d8c87a..6ecfce63201a 100644 --- a/net/ipv4/netfilter/nft_redir_ipv4.c +++ b/net/ipv4/netfilter/nft_redir_ipv4.c | |||
@@ -27,10 +27,10 @@ static void nft_redir_ipv4_eval(const struct nft_expr *expr, | |||
27 | 27 | ||
28 | memset(&mr, 0, sizeof(mr)); | 28 | memset(&mr, 0, sizeof(mr)); |
29 | if (priv->sreg_proto_min) { | 29 | if (priv->sreg_proto_min) { |
30 | mr.range[0].min.all = (__force __be16) | 30 | mr.range[0].min.all = |
31 | data[priv->sreg_proto_min].data[0]; | 31 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
32 | mr.range[0].max.all = (__force __be16) | 32 | mr.range[0].max.all = |
33 | data[priv->sreg_proto_max].data[0]; | 33 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
34 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 34 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/net/ipv6/netfilter/nft_redir_ipv6.c b/net/ipv6/netfilter/nft_redir_ipv6.c index 2433a6bfb191..11820b6b3613 100644 --- a/net/ipv6/netfilter/nft_redir_ipv6.c +++ b/net/ipv6/netfilter/nft_redir_ipv6.c | |||
@@ -27,10 +27,10 @@ static void nft_redir_ipv6_eval(const struct nft_expr *expr, | |||
27 | 27 | ||
28 | memset(&range, 0, sizeof(range)); | 28 | memset(&range, 0, sizeof(range)); |
29 | if (priv->sreg_proto_min) { | 29 | if (priv->sreg_proto_min) { |
30 | range.min_proto.all = (__force __be16) | 30 | range.min_proto.all = |
31 | data[priv->sreg_proto_min].data[0]; | 31 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
32 | range.max_proto.all = (__force __be16) | 32 | range.max_proto.all = |
33 | data[priv->sreg_proto_max].data[0]; | 33 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
34 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 34 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 1d5341f3761d..5d3daae98bf0 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
183 | struct nf_conn *ct; | 183 | struct nf_conn *ct; |
184 | struct net *net; | 184 | struct net *net; |
185 | 185 | ||
186 | *diff = 0; | ||
187 | |||
186 | #ifdef CONFIG_IP_VS_IPV6 | 188 | #ifdef CONFIG_IP_VS_IPV6 |
187 | /* This application helper doesn't work with IPv6 yet, | 189 | /* This application helper doesn't work with IPv6 yet, |
188 | * so turn this into a no-op for IPv6 packets | 190 | * so turn this into a no-op for IPv6 packets |
@@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
191 | return 1; | 193 | return 1; |
192 | #endif | 194 | #endif |
193 | 195 | ||
194 | *diff = 0; | ||
195 | |||
196 | /* Only useful for established sessions */ | 196 | /* Only useful for established sessions */ |
197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
198 | return 1; | 198 | return 1; |
@@ -322,6 +322,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
322 | struct ip_vs_conn *n_cp; | 322 | struct ip_vs_conn *n_cp; |
323 | struct net *net; | 323 | struct net *net; |
324 | 324 | ||
325 | /* no diff required for incoming packets */ | ||
326 | *diff = 0; | ||
327 | |||
325 | #ifdef CONFIG_IP_VS_IPV6 | 328 | #ifdef CONFIG_IP_VS_IPV6 |
326 | /* This application helper doesn't work with IPv6 yet, | 329 | /* This application helper doesn't work with IPv6 yet, |
327 | * so turn this into a no-op for IPv6 packets | 330 | * so turn this into a no-op for IPv6 packets |
@@ -330,9 +333,6 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
330 | return 1; | 333 | return 1; |
331 | #endif | 334 | #endif |
332 | 335 | ||
333 | /* no diff required for incoming packets */ | ||
334 | *diff = 0; | ||
335 | |||
336 | /* Only useful for established sessions */ | 336 | /* Only useful for established sessions */ |
337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
338 | return 1; | 338 | return 1; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index a11674806707..46d1b26a468e 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -611,16 +611,15 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
611 | */ | 611 | */ |
612 | NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); | 612 | NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); |
613 | pr_debug("Confirming conntrack %p\n", ct); | 613 | pr_debug("Confirming conntrack %p\n", ct); |
614 | /* We have to check the DYING flag inside the lock to prevent | 614 | /* We have to check the DYING flag after unlink to prevent |
615 | a race against nf_ct_get_next_corpse() possibly called from | 615 | * a race against nf_ct_get_next_corpse() possibly called from |
616 | user context, else we insert an already 'dead' hash, blocking | 616 | * user context, else we insert an already 'dead' hash, blocking |
617 | further use of that particular connection -JM */ | 617 | * further use of that particular connection -JM. |
618 | */ | ||
619 | nf_ct_del_from_dying_or_unconfirmed_list(ct); | ||
618 | 620 | ||
619 | if (unlikely(nf_ct_is_dying(ct))) { | 621 | if (unlikely(nf_ct_is_dying(ct))) |
620 | nf_conntrack_double_unlock(hash, reply_hash); | 622 | goto out; |
621 | local_bh_enable(); | ||
622 | return NF_ACCEPT; | ||
623 | } | ||
624 | 623 | ||
625 | /* See if there's one in the list already, including reverse: | 624 | /* See if there's one in the list already, including reverse: |
626 | NAT could have grabbed it without realizing, since we're | 625 | NAT could have grabbed it without realizing, since we're |
@@ -636,8 +635,6 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
636 | zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) | 635 | zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) |
637 | goto out; | 636 | goto out; |
638 | 637 | ||
639 | nf_ct_del_from_dying_or_unconfirmed_list(ct); | ||
640 | |||
641 | /* Timer relative to confirmation time, not original | 638 | /* Timer relative to confirmation time, not original |
642 | setting time, otherwise we'd get timer wrap in | 639 | setting time, otherwise we'd get timer wrap in |
643 | weird delay cases. */ | 640 | weird delay cases. */ |
@@ -673,6 +670,7 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
673 | return NF_ACCEPT; | 670 | return NF_ACCEPT; |
674 | 671 | ||
675 | out: | 672 | out: |
673 | nf_ct_add_to_dying_list(ct); | ||
676 | nf_conntrack_double_unlock(hash, reply_hash); | 674 | nf_conntrack_double_unlock(hash, reply_hash); |
677 | NF_CT_STAT_INC(net, insert_failed); | 675 | NF_CT_STAT_INC(net, insert_failed); |
678 | local_bh_enable(); | 676 | local_bh_enable(); |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 129a8daa4abf..3b3ddb4fb9ee 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -713,16 +713,12 @@ static int nft_flush_table(struct nft_ctx *ctx) | |||
713 | struct nft_chain *chain, *nc; | 713 | struct nft_chain *chain, *nc; |
714 | struct nft_set *set, *ns; | 714 | struct nft_set *set, *ns; |
715 | 715 | ||
716 | list_for_each_entry_safe(chain, nc, &ctx->table->chains, list) { | 716 | list_for_each_entry(chain, &ctx->table->chains, list) { |
717 | ctx->chain = chain; | 717 | ctx->chain = chain; |
718 | 718 | ||
719 | err = nft_delrule_by_chain(ctx); | 719 | err = nft_delrule_by_chain(ctx); |
720 | if (err < 0) | 720 | if (err < 0) |
721 | goto out; | 721 | goto out; |
722 | |||
723 | err = nft_delchain(ctx); | ||
724 | if (err < 0) | ||
725 | goto out; | ||
726 | } | 722 | } |
727 | 723 | ||
728 | list_for_each_entry_safe(set, ns, &ctx->table->sets, list) { | 724 | list_for_each_entry_safe(set, ns, &ctx->table->sets, list) { |
@@ -735,6 +731,14 @@ static int nft_flush_table(struct nft_ctx *ctx) | |||
735 | goto out; | 731 | goto out; |
736 | } | 732 | } |
737 | 733 | ||
734 | list_for_each_entry_safe(chain, nc, &ctx->table->chains, list) { | ||
735 | ctx->chain = chain; | ||
736 | |||
737 | err = nft_delchain(ctx); | ||
738 | if (err < 0) | ||
739 | goto out; | ||
740 | } | ||
741 | |||
738 | err = nft_deltable(ctx); | 742 | err = nft_deltable(ctx); |
739 | out: | 743 | out: |
740 | return err; | 744 | return err; |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index cde4a6702fa3..c421d94c4652 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -321,7 +321,8 @@ replay: | |||
321 | nlh = nlmsg_hdr(skb); | 321 | nlh = nlmsg_hdr(skb); |
322 | err = 0; | 322 | err = 0; |
323 | 323 | ||
324 | if (nlh->nlmsg_len < NLMSG_HDRLEN) { | 324 | if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) || |
325 | skb->len < nlh->nlmsg_len) { | ||
325 | err = -EINVAL; | 326 | err = -EINVAL; |
326 | goto ack; | 327 | goto ack; |
327 | } | 328 | } |
@@ -469,7 +470,7 @@ static int nfnetlink_bind(struct net *net, int group) | |||
469 | int type; | 470 | int type; |
470 | 471 | ||
471 | if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX) | 472 | if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX) |
472 | return -EINVAL; | 473 | return 0; |
473 | 474 | ||
474 | type = nfnl_group2type[group]; | 475 | type = nfnl_group2type[group]; |
475 | 476 | ||
diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index afe2b0b45ec4..aff54fb1c8a0 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c | |||
@@ -65,10 +65,10 @@ static void nft_nat_eval(const struct nft_expr *expr, | |||
65 | } | 65 | } |
66 | 66 | ||
67 | if (priv->sreg_proto_min) { | 67 | if (priv->sreg_proto_min) { |
68 | range.min_proto.all = (__force __be16) | 68 | range.min_proto.all = |
69 | data[priv->sreg_proto_min].data[0]; | 69 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
70 | range.max_proto.all = (__force __be16) | 70 | range.max_proto.all = |
71 | data[priv->sreg_proto_max].data[0]; | 71 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
72 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 72 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 54854e3ecd83..8bda3cc12344 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -524,7 +524,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) | |||
524 | struct vport *input_vport; | 524 | struct vport *input_vport; |
525 | int len; | 525 | int len; |
526 | int err; | 526 | int err; |
527 | bool log = !a[OVS_FLOW_ATTR_PROBE]; | 527 | bool log = !a[OVS_PACKET_ATTR_PROBE]; |
528 | 528 | ||
529 | err = -EINVAL; | 529 | err = -EINVAL; |
530 | if (!a[OVS_PACKET_ATTR_PACKET] || !a[OVS_PACKET_ATTR_KEY] || | 530 | if (!a[OVS_PACKET_ATTR_PACKET] || !a[OVS_PACKET_ATTR_KEY] || |
@@ -610,6 +610,7 @@ static const struct nla_policy packet_policy[OVS_PACKET_ATTR_MAX + 1] = { | |||
610 | [OVS_PACKET_ATTR_PACKET] = { .len = ETH_HLEN }, | 610 | [OVS_PACKET_ATTR_PACKET] = { .len = ETH_HLEN }, |
611 | [OVS_PACKET_ATTR_KEY] = { .type = NLA_NESTED }, | 611 | [OVS_PACKET_ATTR_KEY] = { .type = NLA_NESTED }, |
612 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, | 612 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, |
613 | [OVS_PACKET_ATTR_PROBE] = { .type = NLA_FLAG }, | ||
613 | }; | 614 | }; |
614 | 615 | ||
615 | static const struct genl_ops dp_packet_genl_ops[] = { | 616 | static const struct genl_ops dp_packet_genl_ops[] = { |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index d37075b0d6d5..9c28cec1a083 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2517,7 +2517,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2517 | err = -EINVAL; | 2517 | err = -EINVAL; |
2518 | if (sock->type == SOCK_DGRAM) { | 2518 | if (sock->type == SOCK_DGRAM) { |
2519 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); | 2519 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); |
2520 | if (unlikely(offset) < 0) | 2520 | if (unlikely(offset < 0)) |
2521 | goto out_free; | 2521 | goto out_free; |
2522 | } else { | 2522 | } else { |
2523 | if (ll_header_truncated(dev, len)) | 2523 | if (ll_header_truncated(dev, len)) |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 1cb61242e55e..4439ac4c1b53 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -606,7 +606,7 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
606 | struct kvec *head = buf->head; | 606 | struct kvec *head = buf->head; |
607 | struct kvec *tail = buf->tail; | 607 | struct kvec *tail = buf->tail; |
608 | int fraglen; | 608 | int fraglen; |
609 | int new, old; | 609 | int new; |
610 | 610 | ||
611 | if (len > buf->len) { | 611 | if (len > buf->len) { |
612 | WARN_ON_ONCE(1); | 612 | WARN_ON_ONCE(1); |
@@ -629,8 +629,8 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
629 | buf->len -= fraglen; | 629 | buf->len -= fraglen; |
630 | 630 | ||
631 | new = buf->page_base + buf->page_len; | 631 | new = buf->page_base + buf->page_len; |
632 | old = new + fraglen; | 632 | |
633 | xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); | 633 | xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT); |
634 | 634 | ||
635 | if (buf->page_len) { | 635 | if (buf->page_len) { |
636 | xdr->p = page_address(*xdr->page_ptr); | 636 | xdr->p = page_address(*xdr->page_ptr); |