]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: Kill ip6_get_dsfield
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 16 Sep 2004 06:10:18 +0000 (23:10 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Thu, 16 Sep 2004 06:10:18 +0000 (23:10 -0700)
This patch kills the duplicate implementation of ip6_get_dsfield in
inet_ecn.h.  It now uses ipv6_get_dsfield from dsfield.h instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_ecn.h
net/ipv4/ip_gre.c
net/ipv6/sit.c
net/ipv6/tcp_ipv6.c
net/ipv6/xfrm6_input.c
net/sched/sch_red.c

index e04db26f4d84a1741db1f14e3d9a590bc37439df..0bde1b6d5ced7f05c327da6d49efc6906bf39252 100644 (file)
@@ -78,13 +78,11 @@ static inline void IP_ECN_clear(struct iphdr *iph)
        iph->tos &= ~INET_ECN_MASK;
 }
 
-#define ip6_get_dsfield(iph) ((ntohs(*(u16*)(iph)) >> 4) & 0xFF)
-
 struct ipv6hdr;
 
 static inline void IP6_ECN_set_ce(struct ipv6hdr *iph)
 {
-       if (INET_ECN_is_not_ect(ip6_get_dsfield(iph)))
+       if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
                return;
        *(u32*)iph |= htonl(INET_ECN_CE << 20);
 }
index 6f6250e5d9e1aa16621ce69e73a559eb01503ed0..97e8595a5b8650a9a81cedc14adad7da84c234b0 100644 (file)
@@ -36,6 +36,7 @@
 #include <net/ipip.h>
 #include <net/arp.h>
 #include <net/checksum.h>
+#include <net/dsfield.h>
 #include <net/inet_ecn.h>
 #include <net/xfrm.h>
 
@@ -547,7 +548,7 @@ ipgre_ecn_encapsulate(u8 tos, struct iphdr *old_iph, struct sk_buff *skb)
        if (skb->protocol == htons(ETH_P_IP))
                inner = old_iph->tos;
        else if (skb->protocol == htons(ETH_P_IPV6))
-               inner = ip6_get_dsfield((struct ipv6hdr*)old_iph);
+               inner = ipv6_get_dsfield((struct ipv6hdr *)old_iph);
        return INET_ECN_encapsulate(tos, inner);
 }
 
index 6ce7719d43a9c9969990b136fef89c0a2c62201c..2f89e1a411781e60f61c083c6baffacbbcae0e2a 100644 (file)
@@ -50,6 +50,7 @@
 #include <net/ipip.h>
 #include <net/inet_ecn.h>
 #include <net/xfrm.h>
+#include <net/dsfield.h>
 
 /*
    This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c
@@ -566,7 +567,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
                iph->frag_off   =       0;
 
        iph->protocol           =       IPPROTO_IPV6;
-       iph->tos                =       INET_ECN_encapsulate(tos, ip6_get_dsfield(iph6));
+       iph->tos                =       INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
        iph->daddr              =       rt->rt_dst;
        iph->saddr              =       rt->rt_src;
 
index 66a56080c202af086c58ad221178d60432fc6a1a..1410650e38b889e958547930182130e683a00b42 100644 (file)
@@ -57,6 +57,7 @@
 #include <net/xfrm.h>
 #include <net/addrconf.h>
 #include <net/snmp.h>
+#include <net/dsfield.h>
 
 #include <asm/uaccess.h>
 
@@ -1646,7 +1647,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
                                    skb->len - th->doff*4);
        TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
        TCP_SKB_CB(skb)->when = 0;
-       TCP_SKB_CB(skb)->flags = ip6_get_dsfield(skb->nh.ipv6h);
+       TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(skb->nh.ipv6h);
        TCP_SKB_CB(skb)->sacked = 0;
 
        sk = __tcp_v6_lookup(&skb->nh.ipv6h->saddr, th->source,
index 89000c7889f80f4c0d4892fcc051fa69d97faecb..45702e4d429cf1794fdd4513e400c8db49073a4d 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/string.h>
+#include <net/dsfield.h>
 #include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/ipv6.h>
@@ -21,7 +22,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
        struct ipv6hdr *outer_iph = skb->nh.ipv6h;
        struct ipv6hdr *inner_iph = skb->h.ipv6h;
 
-       if (INET_ECN_is_ce(ip6_get_dsfield(outer_iph)))
+       if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
                IP6_ECN_set_ce(inner_iph);
 }
 
index e5899f67ed64046cc4eb0138ff68ca83de3947cb..e98f79bdb435dee959745b7e714966e0bb7f6956 100644 (file)
@@ -40,6 +40,7 @@
 #include <net/sock.h>
 #include <net/pkt_sched.h>
 #include <net/inet_ecn.h>
+#include <net/dsfield.h>
 
 
 /*     Random Early Detection (RED) algorithm.
@@ -167,7 +168,7 @@ static int red_ecn_mark(struct sk_buff *skb)
                IP_ECN_set_ce(skb->nh.iph);
                return 1;
        case __constant_htons(ETH_P_IPV6):
-               if (INET_ECN_is_not_ect(ip6_get_dsfield(skb->nh.ipv6h)))
+               if (INET_ECN_is_not_ect(ipv6_get_dsfield(skb->nh.ipv6h)))
                        return 0;
                IP6_ECN_set_ce(skb->nh.ipv6h);
                return 1;