diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-09 18:50:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-09 18:50:41 -0400 |
commit | 09075ef0fd585fb093bb9a6cd1240272114f89cf (patch) | |
tree | c01d2cc260a18df73f785bea4de1c1cfbcbbd16f /net/core | |
parent | c87fed1546bd00b42ee75f26c6b45393e4bf7559 (diff) | |
parent | 1b30dd359ebec22d035e8b145751319f63772ca1 (diff) |
Merge commit master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 of HEAD
* HEAD:
[AX.25]: Use kzalloc
[ATM] net/atm/clip.c: fix PROC_FS=n compile
[PKT_SCHED]: act_api: Fix module leak while flushing actions
[NET]: Fix IPv4/DECnet routing rule dumping
[NET] gso: Fix up GSO packets with broken checksums
[NET] gso: Add skb_is_gso
[IRDA]: fix drivers/net/irda/ali-ircc.c:ali_ircc_init()
[ATM]: fix possible recursive locking in skb_migrate()
[ATM]: Typo in drivers/atm/Kconfig...
[TG3]: add amd8131 to "write reorder" chipsets
[NET]: Fix network device interface printk message priority
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 066a60a752..4d2b5167d7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1162,9 +1162,17 @@ int skb_checksum_help(struct sk_buff *skb, int inward) | |||
1162 | unsigned int csum; | 1162 | unsigned int csum; |
1163 | int ret = 0, offset = skb->h.raw - skb->data; | 1163 | int ret = 0, offset = skb->h.raw - skb->data; |
1164 | 1164 | ||
1165 | if (inward) { | 1165 | if (inward) |
1166 | skb->ip_summed = CHECKSUM_NONE; | 1166 | goto out_set_summed; |
1167 | goto out; | 1167 | |
1168 | if (unlikely(skb_shinfo(skb)->gso_size)) { | ||
1169 | static int warned; | ||
1170 | |||
1171 | WARN_ON(!warned); | ||
1172 | warned = 1; | ||
1173 | |||
1174 | /* Let GSO fix up the checksum. */ | ||
1175 | goto out_set_summed; | ||
1168 | } | 1176 | } |
1169 | 1177 | ||
1170 | if (skb_cloned(skb)) { | 1178 | if (skb_cloned(skb)) { |
@@ -1181,6 +1189,8 @@ int skb_checksum_help(struct sk_buff *skb, int inward) | |||
1181 | BUG_ON(skb->csum + 2 > offset); | 1189 | BUG_ON(skb->csum + 2 > offset); |
1182 | 1190 | ||
1183 | *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); | 1191 | *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); |
1192 | |||
1193 | out_set_summed: | ||
1184 | skb->ip_summed = CHECKSUM_NONE; | 1194 | skb->ip_summed = CHECKSUM_NONE; |
1185 | out: | 1195 | out: |
1186 | return ret; | 1196 | return ret; |
@@ -1201,17 +1211,35 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) | |||
1201 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); | 1211 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); |
1202 | struct packet_type *ptype; | 1212 | struct packet_type *ptype; |
1203 | int type = skb->protocol; | 1213 | int type = skb->protocol; |
1214 | int err; | ||
1204 | 1215 | ||
1205 | BUG_ON(skb_shinfo(skb)->frag_list); | 1216 | BUG_ON(skb_shinfo(skb)->frag_list); |
1206 | BUG_ON(skb->ip_summed != CHECKSUM_HW); | ||
1207 | 1217 | ||
1208 | skb->mac.raw = skb->data; | 1218 | skb->mac.raw = skb->data; |
1209 | skb->mac_len = skb->nh.raw - skb->data; | 1219 | skb->mac_len = skb->nh.raw - skb->data; |
1210 | __skb_pull(skb, skb->mac_len); | 1220 | __skb_pull(skb, skb->mac_len); |
1211 | 1221 | ||
1222 | if (unlikely(skb->ip_summed != CHECKSUM_HW)) { | ||
1223 | static int warned; | ||
1224 | |||
1225 | WARN_ON(!warned); | ||
1226 | warned = 1; | ||
1227 | |||
1228 | if (skb_header_cloned(skb) && | ||
1229 | (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) | ||
1230 | return ERR_PTR(err); | ||
1231 | } | ||
1232 | |||
1212 | rcu_read_lock(); | 1233 | rcu_read_lock(); |
1213 | list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) { | 1234 | list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) { |
1214 | if (ptype->type == type && !ptype->dev && ptype->gso_segment) { | 1235 | if (ptype->type == type && !ptype->dev && ptype->gso_segment) { |
1236 | if (unlikely(skb->ip_summed != CHECKSUM_HW)) { | ||
1237 | err = ptype->gso_send_check(skb); | ||
1238 | segs = ERR_PTR(err); | ||
1239 | if (err || skb_gso_ok(skb, features)) | ||
1240 | break; | ||
1241 | __skb_push(skb, skb->data - skb->nh.raw); | ||
1242 | } | ||
1215 | segs = ptype->gso_segment(skb, features); | 1243 | segs = ptype->gso_segment(skb, features); |
1216 | break; | 1244 | break; |
1217 | } | 1245 | } |
@@ -1727,7 +1755,7 @@ static int ing_filter(struct sk_buff *skb) | |||
1727 | if (dev->qdisc_ingress) { | 1755 | if (dev->qdisc_ingress) { |
1728 | __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd); | 1756 | __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd); |
1729 | if (MAX_RED_LOOP < ttl++) { | 1757 | if (MAX_RED_LOOP < ttl++) { |
1730 | printk("Redir loop detected Dropping packet (%s->%s)\n", | 1758 | printk(KERN_WARNING "Redir loop detected Dropping packet (%s->%s)\n", |
1731 | skb->input_dev->name, skb->dev->name); | 1759 | skb->input_dev->name, skb->dev->name); |
1732 | return TC_ACT_SHOT; | 1760 | return TC_ACT_SHOT; |
1733 | } | 1761 | } |
@@ -2922,7 +2950,7 @@ int register_netdevice(struct net_device *dev) | |||
2922 | /* Fix illegal SG+CSUM combinations. */ | 2950 | /* Fix illegal SG+CSUM combinations. */ |
2923 | if ((dev->features & NETIF_F_SG) && | 2951 | if ((dev->features & NETIF_F_SG) && |
2924 | !(dev->features & NETIF_F_ALL_CSUM)) { | 2952 | !(dev->features & NETIF_F_ALL_CSUM)) { |
2925 | printk("%s: Dropping NETIF_F_SG since no checksum feature.\n", | 2953 | printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no checksum feature.\n", |
2926 | dev->name); | 2954 | dev->name); |
2927 | dev->features &= ~NETIF_F_SG; | 2955 | dev->features &= ~NETIF_F_SG; |
2928 | } | 2956 | } |
@@ -2930,7 +2958,7 @@ int register_netdevice(struct net_device *dev) | |||
2930 | /* TSO requires that SG is present as well. */ | 2958 | /* TSO requires that SG is present as well. */ |
2931 | if ((dev->features & NETIF_F_TSO) && | 2959 | if ((dev->features & NETIF_F_TSO) && |
2932 | !(dev->features & NETIF_F_SG)) { | 2960 | !(dev->features & NETIF_F_SG)) { |
2933 | printk("%s: Dropping NETIF_F_TSO since no SG feature.\n", | 2961 | printk(KERN_NOTICE "%s: Dropping NETIF_F_TSO since no SG feature.\n", |
2934 | dev->name); | 2962 | dev->name); |
2935 | dev->features &= ~NETIF_F_TSO; | 2963 | dev->features &= ~NETIF_F_TSO; |
2936 | } | 2964 | } |