ip.h (188933ac139a6f8ab06cad369bd0200af947b00d) ip.h (b6a7719aedd7e5c0f2df7641aa47386111682df4)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the IP module.
7 *
8 * Version: @(#)ip.h 1.0.2 05/07/93

--- 304 unchanged lines hidden (view full) ---

313 bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
314 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
315 } else {
316 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
317 }
318}
319
320u32 ip_idents_reserve(u32 hash, int segs);
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the IP module.
7 *
8 * Version: @(#)ip.h 1.0.2 05/07/93

--- 304 unchanged lines hidden (view full) ---

313 bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
314 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
315 } else {
316 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
317 }
318}
319
320u32 ip_idents_reserve(u32 hash, int segs);
321void __ip_select_ident(struct iphdr *iph, int segs);
321void __ip_select_ident(struct net *net, struct iphdr *iph, int segs);
322
322
323static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, int segs)
323static inline void ip_select_ident_segs(struct net *net, struct sk_buff *skb,
324 struct sock *sk, int segs)
324{
325 struct iphdr *iph = ip_hdr(skb);
326
327 if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
328 /* This is only to work around buggy Windows95/2000
329 * VJ compression implementations. If the ID field
330 * does not change, they drop every other packet in
331 * a TCP stream using header compression.
332 */
333 if (sk && inet_sk(sk)->inet_daddr) {
334 iph->id = htons(inet_sk(sk)->inet_id);
335 inet_sk(sk)->inet_id += segs;
336 } else {
337 iph->id = 0;
338 }
339 } else {
325{
326 struct iphdr *iph = ip_hdr(skb);
327
328 if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
329 /* This is only to work around buggy Windows95/2000
330 * VJ compression implementations. If the ID field
331 * does not change, they drop every other packet in
332 * a TCP stream using header compression.
333 */
334 if (sk && inet_sk(sk)->inet_daddr) {
335 iph->id = htons(inet_sk(sk)->inet_id);
336 inet_sk(sk)->inet_id += segs;
337 } else {
338 iph->id = 0;
339 }
340 } else {
340 __ip_select_ident(iph, segs);
341 __ip_select_ident(net, iph, segs);
341 }
342}
343
342 }
343}
344
344static inline void ip_select_ident(struct sk_buff *skb, struct sock *sk)
345static inline void ip_select_ident(struct net *net, struct sk_buff *skb,
346 struct sock *sk)
345{
347{
346 ip_select_ident_segs(skb, sk, 1);
348 ip_select_ident_segs(net, skb, sk, 1);
347}
348
349static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto)
350{
351 return csum_tcpudp_nofold(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
352 skb->len, proto, 0);
353}
354

--- 220 unchanged lines hidden ---
349}
350
351static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto)
352{
353 return csum_tcpudp_nofold(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
354 skb->len, proto, 0);
355}
356

--- 220 unchanged lines hidden ---