diff options
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index a2ede167e045..97aee76fb746 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -83,7 +83,7 @@ | |||
83 | #include <linux/netlink.h> | 83 | #include <linux/netlink.h> |
84 | #include <linux/tcp.h> | 84 | #include <linux/tcp.h> |
85 | 85 | ||
86 | int sysctl_ip_default_ttl = IPDEFTTL; | 86 | int sysctl_ip_default_ttl __read_mostly = IPDEFTTL; |
87 | 87 | ||
88 | /* Generate a checksum for an outgoing IP datagram. */ | 88 | /* Generate a checksum for an outgoing IP datagram. */ |
89 | __inline__ void ip_send_check(struct iphdr *iph) | 89 | __inline__ void ip_send_check(struct iphdr *iph) |
@@ -328,6 +328,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok) | |||
328 | * keep trying until route appears or the connection times | 328 | * keep trying until route appears or the connection times |
329 | * itself out. | 329 | * itself out. |
330 | */ | 330 | */ |
331 | security_sk_classify_flow(sk, &fl); | ||
331 | if (ip_route_output_flow(&rt, &fl, sk, 0)) | 332 | if (ip_route_output_flow(&rt, &fl, sk, 0)) |
332 | goto no_route; | 333 | goto no_route; |
333 | } | 334 | } |
@@ -425,7 +426,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) | |||
425 | int ptr; | 426 | int ptr; |
426 | struct net_device *dev; | 427 | struct net_device *dev; |
427 | struct sk_buff *skb2; | 428 | struct sk_buff *skb2; |
428 | unsigned int mtu, hlen, left, len, ll_rs; | 429 | unsigned int mtu, hlen, left, len, ll_rs, pad; |
429 | int offset; | 430 | int offset; |
430 | __be16 not_last_frag; | 431 | __be16 not_last_frag; |
431 | struct rtable *rt = (struct rtable*)skb->dst; | 432 | struct rtable *rt = (struct rtable*)skb->dst; |
@@ -555,14 +556,13 @@ slow_path: | |||
555 | left = skb->len - hlen; /* Space per frame */ | 556 | left = skb->len - hlen; /* Space per frame */ |
556 | ptr = raw + hlen; /* Where to start from */ | 557 | ptr = raw + hlen; /* Where to start from */ |
557 | 558 | ||
558 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
559 | /* for bridged IP traffic encapsulated inside f.e. a vlan header, | 559 | /* for bridged IP traffic encapsulated inside f.e. a vlan header, |
560 | * we need to make room for the encapsulating header */ | 560 | * we need to make room for the encapsulating header |
561 | ll_rs = LL_RESERVED_SPACE_EXTRA(rt->u.dst.dev, nf_bridge_pad(skb)); | 561 | */ |
562 | mtu -= nf_bridge_pad(skb); | 562 | pad = nf_bridge_pad(skb); |
563 | #else | 563 | ll_rs = LL_RESERVED_SPACE_EXTRA(rt->u.dst.dev, pad); |
564 | ll_rs = LL_RESERVED_SPACE(rt->u.dst.dev); | 564 | mtu -= pad; |
565 | #endif | 565 | |
566 | /* | 566 | /* |
567 | * Fragment the datagram. | 567 | * Fragment the datagram. |
568 | */ | 568 | */ |
@@ -679,7 +679,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk | |||
679 | { | 679 | { |
680 | struct iovec *iov = from; | 680 | struct iovec *iov = from; |
681 | 681 | ||
682 | if (skb->ip_summed == CHECKSUM_HW) { | 682 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
683 | if (memcpy_fromiovecend(to, iov, offset, len) < 0) | 683 | if (memcpy_fromiovecend(to, iov, offset, len) < 0) |
684 | return -EFAULT; | 684 | return -EFAULT; |
685 | } else { | 685 | } else { |
@@ -735,7 +735,7 @@ static inline int ip_ufo_append_data(struct sock *sk, | |||
735 | /* initialize protocol header pointer */ | 735 | /* initialize protocol header pointer */ |
736 | skb->h.raw = skb->data + fragheaderlen; | 736 | skb->h.raw = skb->data + fragheaderlen; |
737 | 737 | ||
738 | skb->ip_summed = CHECKSUM_HW; | 738 | skb->ip_summed = CHECKSUM_PARTIAL; |
739 | skb->csum = 0; | 739 | skb->csum = 0; |
740 | sk->sk_sndmsg_off = 0; | 740 | sk->sk_sndmsg_off = 0; |
741 | } | 741 | } |
@@ -843,7 +843,7 @@ int ip_append_data(struct sock *sk, | |||
843 | length + fragheaderlen <= mtu && | 843 | length + fragheaderlen <= mtu && |
844 | rt->u.dst.dev->features & NETIF_F_ALL_CSUM && | 844 | rt->u.dst.dev->features & NETIF_F_ALL_CSUM && |
845 | !exthdrlen) | 845 | !exthdrlen) |
846 | csummode = CHECKSUM_HW; | 846 | csummode = CHECKSUM_PARTIAL; |
847 | 847 | ||
848 | inet->cork.length += length; | 848 | inet->cork.length += length; |
849 | if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) && | 849 | if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) && |
@@ -1366,6 +1366,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1366 | { .sport = skb->h.th->dest, | 1366 | { .sport = skb->h.th->dest, |
1367 | .dport = skb->h.th->source } }, | 1367 | .dport = skb->h.th->source } }, |
1368 | .proto = sk->sk_protocol }; | 1368 | .proto = sk->sk_protocol }; |
1369 | security_skb_classify_flow(skb, &fl); | ||
1369 | if (ip_route_output_key(&rt, &fl)) | 1370 | if (ip_route_output_key(&rt, &fl)) |
1370 | return; | 1371 | return; |
1371 | } | 1372 | } |