diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/8021q/vlan_dev.c | 3 | ||||
| -rw-r--r-- | net/core/dev.c | 8 | ||||
| -rw-r--r-- | net/ipv4/Kconfig | 10 | ||||
| -rw-r--r-- | net/ipv4/syncookies.c | 2 | ||||
| -rw-r--r-- | net/ipv4/tcp_hybla.c | 4 | ||||
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 7 | ||||
| -rw-r--r-- | net/mac80211/agg-tx.c | 6 | ||||
| -rw-r--r-- | net/mac80211/rx.c | 13 | ||||
| -rw-r--r-- | net/sched/act_nat.c | 4 | ||||
| -rw-r--r-- | net/sched/act_pedit.c | 24 | ||||
| -rw-r--r-- | net/sched/cls_u32.c | 49 | ||||
| -rw-r--r-- | net/xfrm/xfrm_output.c | 4 | ||||
| -rw-r--r-- | net/xfrm/xfrm_policy.c | 1 |
13 files changed, 90 insertions, 45 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 55be90826f5f..529842677817 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -708,7 +708,8 @@ static int vlan_dev_init(struct net_device *dev) | |||
| 708 | netif_carrier_off(dev); | 708 | netif_carrier_off(dev); |
| 709 | 709 | ||
| 710 | /* IFF_BROADCAST|IFF_MULTICAST; ??? */ | 710 | /* IFF_BROADCAST|IFF_MULTICAST; ??? */ |
| 711 | dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI); | 711 | dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | |
| 712 | IFF_MASTER | IFF_SLAVE); | ||
| 712 | dev->iflink = real_dev->ifindex; | 713 | dev->iflink = real_dev->ifindex; |
| 713 | dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) | | 714 | dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) | |
| 714 | (1<<__LINK_STATE_DORMANT))) | | 715 | (1<<__LINK_STATE_DORMANT))) | |
diff --git a/net/core/dev.c b/net/core/dev.c index 1845b08c624e..d03470f5260a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2795,7 +2795,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
| 2795 | struct net_device *orig_dev; | 2795 | struct net_device *orig_dev; |
| 2796 | struct net_device *master; | 2796 | struct net_device *master; |
| 2797 | struct net_device *null_or_orig; | 2797 | struct net_device *null_or_orig; |
| 2798 | struct net_device *null_or_bond; | 2798 | struct net_device *orig_or_bond; |
| 2799 | int ret = NET_RX_DROP; | 2799 | int ret = NET_RX_DROP; |
| 2800 | __be16 type; | 2800 | __be16 type; |
| 2801 | 2801 | ||
| @@ -2868,10 +2868,10 @@ ncls: | |||
| 2868 | * device that may have registered for a specific ptype. The | 2868 | * device that may have registered for a specific ptype. The |
| 2869 | * handler may have to adjust skb->dev and orig_dev. | 2869 | * handler may have to adjust skb->dev and orig_dev. |
| 2870 | */ | 2870 | */ |
| 2871 | null_or_bond = NULL; | 2871 | orig_or_bond = orig_dev; |
| 2872 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && | 2872 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && |
| 2873 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { | 2873 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { |
| 2874 | null_or_bond = vlan_dev_real_dev(skb->dev); | 2874 | orig_or_bond = vlan_dev_real_dev(skb->dev); |
| 2875 | } | 2875 | } |
| 2876 | 2876 | ||
| 2877 | type = skb->protocol; | 2877 | type = skb->protocol; |
| @@ -2879,7 +2879,7 @@ ncls: | |||
| 2879 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2879 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
| 2880 | if (ptype->type == type && (ptype->dev == null_or_orig || | 2880 | if (ptype->type == type && (ptype->dev == null_or_orig || |
| 2881 | ptype->dev == skb->dev || ptype->dev == orig_dev || | 2881 | ptype->dev == skb->dev || ptype->dev == orig_dev || |
| 2882 | ptype->dev == null_or_bond)) { | 2882 | ptype->dev == orig_or_bond)) { |
| 2883 | if (pt_prev) | 2883 | if (pt_prev) |
| 2884 | ret = deliver_skb(skb, pt_prev, orig_dev); | 2884 | ret = deliver_skb(skb, pt_prev, orig_dev); |
| 2885 | pt_prev = ptype; | 2885 | pt_prev = ptype; |
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 8e3a1fd938ab..7c3a7d191249 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
| @@ -303,7 +303,7 @@ config ARPD | |||
| 303 | If unsure, say N. | 303 | If unsure, say N. |
| 304 | 304 | ||
| 305 | config SYN_COOKIES | 305 | config SYN_COOKIES |
| 306 | bool "IP: TCP syncookie support (disabled per default)" | 306 | bool "IP: TCP syncookie support" |
| 307 | ---help--- | 307 | ---help--- |
| 308 | Normal TCP/IP networking is open to an attack known as "SYN | 308 | Normal TCP/IP networking is open to an attack known as "SYN |
| 309 | flooding". This denial-of-service attack prevents legitimate remote | 309 | flooding". This denial-of-service attack prevents legitimate remote |
| @@ -328,13 +328,13 @@ config SYN_COOKIES | |||
| 328 | server is really overloaded. If this happens frequently better turn | 328 | server is really overloaded. If this happens frequently better turn |
| 329 | them off. | 329 | them off. |
| 330 | 330 | ||
| 331 | If you say Y here, note that SYN cookies aren't enabled by default; | 331 | If you say Y here, you can disable SYN cookies at run time by |
| 332 | you can enable them by saying Y to "/proc file system support" and | 332 | saying Y to "/proc file system support" and |
| 333 | "Sysctl support" below and executing the command | 333 | "Sysctl support" below and executing the command |
| 334 | 334 | ||
| 335 | echo 1 >/proc/sys/net/ipv4/tcp_syncookies | 335 | echo 0 > /proc/sys/net/ipv4/tcp_syncookies |
| 336 | 336 | ||
| 337 | at boot time after the /proc file system has been mounted. | 337 | after the /proc file system has been mounted. |
| 338 | 338 | ||
| 339 | If unsure, say N. | 339 | If unsure, say N. |
| 340 | 340 | ||
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 5c24db4a3c91..9f6b22206c52 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
| @@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
| 347 | { .sport = th->dest, | 347 | { .sport = th->dest, |
| 348 | .dport = th->source } } }; | 348 | .dport = th->source } } }; |
| 349 | security_req_classify_flow(req, &fl); | 349 | security_req_classify_flow(req, &fl); |
| 350 | if (ip_route_output_key(&init_net, &rt, &fl)) { | 350 | if (ip_route_output_key(sock_net(sk), &rt, &fl)) { |
| 351 | reqsk_free(req); | 351 | reqsk_free(req); |
| 352 | goto out; | 352 | goto out; |
| 353 | } | 353 | } |
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c index c209e054a634..377bc9349371 100644 --- a/net/ipv4/tcp_hybla.c +++ b/net/ipv4/tcp_hybla.c | |||
| @@ -126,8 +126,8 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
| 126 | * calculate 2^fract in a <<7 value. | 126 | * calculate 2^fract in a <<7 value. |
| 127 | */ | 127 | */ |
| 128 | is_slowstart = 1; | 128 | is_slowstart = 1; |
| 129 | increment = ((1 << ca->rho) * hybla_fraction(rho_fractions)) | 129 | increment = ((1 << min(ca->rho, 16U)) * |
| 130 | - 128; | 130 | hybla_fraction(rho_fractions)) - 128; |
| 131 | } else { | 131 | } else { |
| 132 | /* | 132 | /* |
| 133 | * congestion avoidance | 133 | * congestion avoidance |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 202cf09c4cd4..fe193e53af44 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
| @@ -1555,6 +1555,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 1555 | #endif | 1555 | #endif |
| 1556 | 1556 | ||
| 1557 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ | 1557 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ |
| 1558 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
| 1558 | TCP_CHECK_TIMER(sk); | 1559 | TCP_CHECK_TIMER(sk); |
| 1559 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { | 1560 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { |
| 1560 | rsk = sk; | 1561 | rsk = sk; |
| @@ -1579,7 +1580,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 1579 | } | 1580 | } |
| 1580 | return 0; | 1581 | return 0; |
| 1581 | } | 1582 | } |
| 1582 | } | 1583 | } else |
| 1584 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
| 1585 | |||
| 1583 | 1586 | ||
| 1584 | TCP_CHECK_TIMER(sk); | 1587 | TCP_CHECK_TIMER(sk); |
| 1585 | if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) { | 1588 | if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) { |
| @@ -1672,8 +1675,6 @@ process: | |||
| 1672 | 1675 | ||
| 1673 | skb->dev = NULL; | 1676 | skb->dev = NULL; |
| 1674 | 1677 | ||
| 1675 | sock_rps_save_rxhash(sk, skb->rxhash); | ||
| 1676 | |||
| 1677 | bh_lock_sock_nested(sk); | 1678 | bh_lock_sock_nested(sk); |
| 1678 | ret = 0; | 1679 | ret = 0; |
| 1679 | if (!sock_owned_by_user(sk)) { | 1680 | if (!sock_owned_by_user(sk)) { |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index c163d0a149f4..98258b7341e3 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
| @@ -332,14 +332,16 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | |||
| 332 | IEEE80211_QUEUE_STOP_REASON_AGGREGATION); | 332 | IEEE80211_QUEUE_STOP_REASON_AGGREGATION); |
| 333 | 333 | ||
| 334 | spin_unlock(&local->ampdu_lock); | 334 | spin_unlock(&local->ampdu_lock); |
| 335 | spin_unlock_bh(&sta->lock); | ||
| 336 | 335 | ||
| 337 | /* send an addBA request */ | 336 | /* prepare tid data */ |
| 338 | sta->ampdu_mlme.dialog_token_allocator++; | 337 | sta->ampdu_mlme.dialog_token_allocator++; |
| 339 | sta->ampdu_mlme.tid_tx[tid]->dialog_token = | 338 | sta->ampdu_mlme.tid_tx[tid]->dialog_token = |
| 340 | sta->ampdu_mlme.dialog_token_allocator; | 339 | sta->ampdu_mlme.dialog_token_allocator; |
| 341 | sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num; | 340 | sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num; |
| 342 | 341 | ||
| 342 | spin_unlock_bh(&sta->lock); | ||
| 343 | |||
| 344 | /* send AddBA request */ | ||
| 343 | ieee80211_send_addba_request(sdata, pubsta->addr, tid, | 345 | ieee80211_send_addba_request(sdata, pubsta->addr, tid, |
| 344 | sta->ampdu_mlme.tid_tx[tid]->dialog_token, | 346 | sta->ampdu_mlme.tid_tx[tid]->dialog_token, |
| 345 | sta->ampdu_mlme.tid_tx[tid]->ssn, | 347 | sta->ampdu_mlme.tid_tx[tid]->ssn, |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 6e2a7bcd8cb8..5e0b65406c44 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -1818,17 +1818,26 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) | |||
| 1818 | return RX_CONTINUE; | 1818 | return RX_CONTINUE; |
| 1819 | 1819 | ||
| 1820 | if (ieee80211_is_back_req(bar->frame_control)) { | 1820 | if (ieee80211_is_back_req(bar->frame_control)) { |
| 1821 | struct { | ||
| 1822 | __le16 control, start_seq_num; | ||
| 1823 | } __packed bar_data; | ||
| 1824 | |||
| 1821 | if (!rx->sta) | 1825 | if (!rx->sta) |
| 1822 | return RX_DROP_MONITOR; | 1826 | return RX_DROP_MONITOR; |
| 1827 | |||
| 1828 | if (skb_copy_bits(skb, offsetof(struct ieee80211_bar, control), | ||
| 1829 | &bar_data, sizeof(bar_data))) | ||
| 1830 | return RX_DROP_MONITOR; | ||
| 1831 | |||
| 1823 | spin_lock(&rx->sta->lock); | 1832 | spin_lock(&rx->sta->lock); |
| 1824 | tid = le16_to_cpu(bar->control) >> 12; | 1833 | tid = le16_to_cpu(bar_data.control) >> 12; |
| 1825 | if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) { | 1834 | if (!rx->sta->ampdu_mlme.tid_active_rx[tid]) { |
| 1826 | spin_unlock(&rx->sta->lock); | 1835 | spin_unlock(&rx->sta->lock); |
| 1827 | return RX_DROP_MONITOR; | 1836 | return RX_DROP_MONITOR; |
| 1828 | } | 1837 | } |
| 1829 | tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid]; | 1838 | tid_agg_rx = rx->sta->ampdu_mlme.tid_rx[tid]; |
| 1830 | 1839 | ||
| 1831 | start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; | 1840 | start_seq_num = le16_to_cpu(bar_data.start_seq_num) >> 4; |
| 1832 | 1841 | ||
| 1833 | /* reset session timer */ | 1842 | /* reset session timer */ |
| 1834 | if (tid_agg_rx->timeout) | 1843 | if (tid_agg_rx->timeout) |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index d885ba311564..570949417f38 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
| @@ -159,6 +159,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
| 159 | iph->daddr = new_addr; | 159 | iph->daddr = new_addr; |
| 160 | 160 | ||
| 161 | csum_replace4(&iph->check, addr, new_addr); | 161 | csum_replace4(&iph->check, addr, new_addr); |
| 162 | } else if ((iph->frag_off & htons(IP_OFFSET)) || | ||
| 163 | iph->protocol != IPPROTO_ICMP) { | ||
| 164 | goto out; | ||
| 162 | } | 165 | } |
| 163 | 166 | ||
| 164 | ihl = iph->ihl * 4; | 167 | ihl = iph->ihl * 4; |
| @@ -247,6 +250,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
| 247 | break; | 250 | break; |
| 248 | } | 251 | } |
| 249 | 252 | ||
| 253 | out: | ||
| 250 | return action; | 254 | return action; |
| 251 | 255 | ||
| 252 | drop: | 256 | drop: |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index fdbd0b7bd840..50e3d945e1f4 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -125,7 +125,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
| 125 | { | 125 | { |
| 126 | struct tcf_pedit *p = a->priv; | 126 | struct tcf_pedit *p = a->priv; |
| 127 | int i, munged = 0; | 127 | int i, munged = 0; |
| 128 | u8 *pptr; | 128 | unsigned int off; |
| 129 | 129 | ||
| 130 | if (!(skb->tc_verd & TC_OK2MUNGE)) { | 130 | if (!(skb->tc_verd & TC_OK2MUNGE)) { |
| 131 | /* should we set skb->cloned? */ | 131 | /* should we set skb->cloned? */ |
| @@ -134,7 +134,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
| 134 | } | 134 | } |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | pptr = skb_network_header(skb); | 137 | off = skb_network_offset(skb); |
| 138 | 138 | ||
| 139 | spin_lock(&p->tcf_lock); | 139 | spin_lock(&p->tcf_lock); |
| 140 | 140 | ||
| @@ -144,17 +144,17 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
| 144 | struct tc_pedit_key *tkey = p->tcfp_keys; | 144 | struct tc_pedit_key *tkey = p->tcfp_keys; |
| 145 | 145 | ||
| 146 | for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { | 146 | for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { |
| 147 | u32 *ptr; | 147 | u32 *ptr, _data; |
| 148 | int offset = tkey->off; | 148 | int offset = tkey->off; |
| 149 | 149 | ||
| 150 | if (tkey->offmask) { | 150 | if (tkey->offmask) { |
| 151 | if (skb->len > tkey->at) { | 151 | char *d, _d; |
| 152 | char *j = pptr + tkey->at; | 152 | |
| 153 | offset += ((*j & tkey->offmask) >> | 153 | d = skb_header_pointer(skb, off + tkey->at, 1, |
| 154 | tkey->shift); | 154 | &_d); |
| 155 | } else { | 155 | if (!d) |
| 156 | goto bad; | 156 | goto bad; |
| 157 | } | 157 | offset += (*d & tkey->offmask) >> tkey->shift; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | if (offset % 4) { | 160 | if (offset % 4) { |
| @@ -169,9 +169,13 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
| 169 | goto bad; | 169 | goto bad; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | ptr = (u32 *)(pptr+offset); | 172 | ptr = skb_header_pointer(skb, off + offset, 4, &_data); |
| 173 | if (!ptr) | ||
| 174 | goto bad; | ||
| 173 | /* just do it, baby */ | 175 | /* just do it, baby */ |
| 174 | *ptr = ((*ptr & tkey->mask) ^ tkey->val); | 176 | *ptr = ((*ptr & tkey->mask) ^ tkey->val); |
| 177 | if (ptr == &_data) | ||
| 178 | skb_store_bits(skb, off + offset, ptr, 4); | ||
| 175 | munged++; | 179 | munged++; |
| 176 | } | 180 | } |
| 177 | 181 | ||
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 96275422c619..4f522143811e 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -98,11 +98,11 @@ static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_re | |||
| 98 | { | 98 | { |
| 99 | struct { | 99 | struct { |
| 100 | struct tc_u_knode *knode; | 100 | struct tc_u_knode *knode; |
| 101 | u8 *ptr; | 101 | unsigned int off; |
| 102 | } stack[TC_U32_MAXDEPTH]; | 102 | } stack[TC_U32_MAXDEPTH]; |
| 103 | 103 | ||
| 104 | struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root; | 104 | struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root; |
| 105 | u8 *ptr = skb_network_header(skb); | 105 | unsigned int off = skb_network_offset(skb); |
| 106 | struct tc_u_knode *n; | 106 | struct tc_u_knode *n; |
| 107 | int sdepth = 0; | 107 | int sdepth = 0; |
| 108 | int off2 = 0; | 108 | int off2 = 0; |
| @@ -134,8 +134,14 @@ next_knode: | |||
| 134 | #endif | 134 | #endif |
| 135 | 135 | ||
| 136 | for (i = n->sel.nkeys; i>0; i--, key++) { | 136 | for (i = n->sel.nkeys; i>0; i--, key++) { |
| 137 | 137 | unsigned int toff; | |
| 138 | if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) { | 138 | __be32 *data, _data; |
| 139 | |||
| 140 | toff = off + key->off + (off2 & key->offmask); | ||
| 141 | data = skb_header_pointer(skb, toff, 4, &_data); | ||
| 142 | if (!data) | ||
| 143 | goto out; | ||
| 144 | if ((*data ^ key->val) & key->mask) { | ||
| 139 | n = n->next; | 145 | n = n->next; |
| 140 | goto next_knode; | 146 | goto next_knode; |
| 141 | } | 147 | } |
| @@ -174,29 +180,45 @@ check_terminal: | |||
| 174 | if (sdepth >= TC_U32_MAXDEPTH) | 180 | if (sdepth >= TC_U32_MAXDEPTH) |
| 175 | goto deadloop; | 181 | goto deadloop; |
| 176 | stack[sdepth].knode = n; | 182 | stack[sdepth].knode = n; |
| 177 | stack[sdepth].ptr = ptr; | 183 | stack[sdepth].off = off; |
| 178 | sdepth++; | 184 | sdepth++; |
| 179 | 185 | ||
| 180 | ht = n->ht_down; | 186 | ht = n->ht_down; |
| 181 | sel = 0; | 187 | sel = 0; |
| 182 | if (ht->divisor) | 188 | if (ht->divisor) { |
| 183 | sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift); | 189 | __be32 *data, _data; |
| 184 | 190 | ||
| 191 | data = skb_header_pointer(skb, off + n->sel.hoff, 4, | ||
| 192 | &_data); | ||
| 193 | if (!data) | ||
| 194 | goto out; | ||
| 195 | sel = ht->divisor & u32_hash_fold(*data, &n->sel, | ||
| 196 | n->fshift); | ||
| 197 | } | ||
| 185 | if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) | 198 | if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) |
| 186 | goto next_ht; | 199 | goto next_ht; |
| 187 | 200 | ||
| 188 | if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { | 201 | if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { |
| 189 | off2 = n->sel.off + 3; | 202 | off2 = n->sel.off + 3; |
| 190 | if (n->sel.flags&TC_U32_VAROFFSET) | 203 | if (n->sel.flags & TC_U32_VAROFFSET) { |
| 191 | off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift; | 204 | __be16 *data, _data; |
| 205 | |||
| 206 | data = skb_header_pointer(skb, | ||
| 207 | off + n->sel.offoff, | ||
| 208 | 2, &_data); | ||
| 209 | if (!data) | ||
| 210 | goto out; | ||
| 211 | off2 += ntohs(n->sel.offmask & *data) >> | ||
| 212 | n->sel.offshift; | ||
| 213 | } | ||
| 192 | off2 &= ~3; | 214 | off2 &= ~3; |
| 193 | } | 215 | } |
| 194 | if (n->sel.flags&TC_U32_EAT) { | 216 | if (n->sel.flags&TC_U32_EAT) { |
| 195 | ptr += off2; | 217 | off += off2; |
| 196 | off2 = 0; | 218 | off2 = 0; |
| 197 | } | 219 | } |
| 198 | 220 | ||
| 199 | if (ptr < skb_tail_pointer(skb)) | 221 | if (off < skb->len) |
| 200 | goto next_ht; | 222 | goto next_ht; |
| 201 | } | 223 | } |
| 202 | 224 | ||
| @@ -204,9 +226,10 @@ check_terminal: | |||
| 204 | if (sdepth--) { | 226 | if (sdepth--) { |
| 205 | n = stack[sdepth].knode; | 227 | n = stack[sdepth].knode; |
| 206 | ht = n->ht_up; | 228 | ht = n->ht_up; |
| 207 | ptr = stack[sdepth].ptr; | 229 | off = stack[sdepth].off; |
| 208 | goto check_terminal; | 230 | goto check_terminal; |
| 209 | } | 231 | } |
| 232 | out: | ||
| 210 | return -1; | 233 | return -1; |
| 211 | 234 | ||
| 212 | deadloop: | 235 | deadloop: |
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 6a329158bdfa..a3cca0a94346 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
| @@ -95,13 +95,13 @@ resume: | |||
| 95 | goto error_nolock; | 95 | goto error_nolock; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | dst = dst_pop(dst); | 98 | dst = skb_dst_pop(skb); |
| 99 | if (!dst) { | 99 | if (!dst) { |
| 100 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); | 100 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); |
| 101 | err = -EHOSTUNREACH; | 101 | err = -EHOSTUNREACH; |
| 102 | goto error_nolock; | 102 | goto error_nolock; |
| 103 | } | 103 | } |
| 104 | skb_dst_set(skb, dst); | 104 | skb_dst_set_noref(skb, dst); |
| 105 | x = dst->xfrm; | 105 | x = dst->xfrm; |
| 106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); | 106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); |
| 107 | 107 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index d965a2bad8d3..4bf27d901333 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -2153,6 +2153,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
| 2153 | return 0; | 2153 | return 0; |
| 2154 | } | 2154 | } |
| 2155 | 2155 | ||
| 2156 | skb_dst_force(skb); | ||
| 2156 | dst = skb_dst(skb); | 2157 | dst = skb_dst(skb); |
| 2157 | 2158 | ||
| 2158 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; | 2159 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; |
