cls_flow.c (c7066f70d9610df0b9406cc635fc09e86136e714) | cls_flow.c (cc7ec456f82da7f89a5b376e613b3ac4311b3e9a) |
---|---|
1/* 2 * net/sched/cls_flow.c Generic flow classifier 3 * 4 * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 --- 107 unchanged lines hidden (view full) --- 116 switch (skb->protocol) { 117 case htons(ETH_P_IP): { 118 struct iphdr *iph; 119 int poff; 120 121 if (!pskb_network_may_pull(skb, sizeof(*iph))) 122 break; 123 iph = ip_hdr(skb); | 1/* 2 * net/sched/cls_flow.c Generic flow classifier 3 * 4 * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 --- 107 unchanged lines hidden (view full) --- 116 switch (skb->protocol) { 117 case htons(ETH_P_IP): { 118 struct iphdr *iph; 119 int poff; 120 121 if (!pskb_network_may_pull(skb, sizeof(*iph))) 122 break; 123 iph = ip_hdr(skb); |
124 if (iph->frag_off & htons(IP_MF|IP_OFFSET)) | 124 if (iph->frag_off & htons(IP_MF | IP_OFFSET)) |
125 break; 126 poff = proto_ports_offset(iph->protocol); 127 if (poff >= 0 && 128 pskb_network_may_pull(skb, iph->ihl * 4 + 2 + poff)) { 129 iph = ip_hdr(skb); 130 return ntohs(*(__be16 *)((void *)iph + iph->ihl * 4 + 131 poff)); 132 } --- 25 unchanged lines hidden (view full) --- 158 switch (skb->protocol) { 159 case htons(ETH_P_IP): { 160 struct iphdr *iph; 161 int poff; 162 163 if (!pskb_network_may_pull(skb, sizeof(*iph))) 164 break; 165 iph = ip_hdr(skb); | 125 break; 126 poff = proto_ports_offset(iph->protocol); 127 if (poff >= 0 && 128 pskb_network_may_pull(skb, iph->ihl * 4 + 2 + poff)) { 129 iph = ip_hdr(skb); 130 return ntohs(*(__be16 *)((void *)iph + iph->ihl * 4 + 131 poff)); 132 } --- 25 unchanged lines hidden (view full) --- 158 switch (skb->protocol) { 159 case htons(ETH_P_IP): { 160 struct iphdr *iph; 161 int poff; 162 163 if (!pskb_network_may_pull(skb, sizeof(*iph))) 164 break; 165 iph = ip_hdr(skb); |
166 if (iph->frag_off & htons(IP_MF|IP_OFFSET)) | 166 if (iph->frag_off & htons(IP_MF | IP_OFFSET)) |
167 break; 168 poff = proto_ports_offset(iph->protocol); 169 if (poff >= 0 && 170 pskb_network_may_pull(skb, iph->ihl * 4 + 4 + poff)) { 171 iph = ip_hdr(skb); 172 return ntohs(*(__be16 *)((void *)iph + iph->ihl * 4 + 173 2 + poff)); 174 } --- 96 unchanged lines hidden (view full) --- 271{ 272 return ntohs(CTTUPLE(skb, dst.u.all)); 273fallback: 274 return flow_get_proto_dst(skb); 275} 276 277static u32 flow_get_rtclassid(const struct sk_buff *skb) 278{ | 167 break; 168 poff = proto_ports_offset(iph->protocol); 169 if (poff >= 0 && 170 pskb_network_may_pull(skb, iph->ihl * 4 + 4 + poff)) { 171 iph = ip_hdr(skb); 172 return ntohs(*(__be16 *)((void *)iph + iph->ihl * 4 + 173 2 + poff)); 174 } --- 96 unchanged lines hidden (view full) --- 271{ 272 return ntohs(CTTUPLE(skb, dst.u.all)); 273fallback: 274 return flow_get_proto_dst(skb); 275} 276 277static u32 flow_get_rtclassid(const struct sk_buff *skb) 278{ |
279#ifdef CONFIG_IP_ROUTE_CLASSID | 279#ifdef CONFIG_NET_CLS_ROUTE |
280 if (skb_dst(skb)) 281 return skb_dst(skb)->tclassid; 282#endif 283 return 0; 284} 285 286static u32 flow_get_skuid(const struct sk_buff *skb) 287{ --- 452 unchanged lines hidden --- | 280 if (skb_dst(skb)) 281 return skb_dst(skb)->tclassid; 282#endif 283 return 0; 284} 285 286static u32 flow_get_skuid(const struct sk_buff *skb) 287{ --- 452 unchanged lines hidden --- |