0005-try-to-use-unaligned-in-core-functions.patch

Dave Täht, 04/14/2012 10:53 am

Download (1.8 kB)

 
b/include/linux/skbuff.h
1359 1359
#ifdef NET_SKBUFF_DATA_USES_OFFSET
1360 1360
static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1361 1361
{
1362
	return skb->head + skb->transport_header;
1362
  return (unsigned char *) (__get_unaligned_cpu32(&skb->head) + __get_unaligned_cpu32(&skb->transport_header);
1363 1363
}
1364 1364

  
1365 1365
static inline void skb_reset_transport_header(struct sk_buff *skb)
......
1376 1376

  
1377 1377
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
1378 1378
{
1379
	return skb->head + skb->network_header;
1379
  return (unsigned char *) (__get_unaligned_cpu32(&skb->head) + __get_unaligned_cpu32(&skb->network_header));
1380 1380
}
1381 1381

  
1382 1382
static inline void skb_reset_network_header(struct sk_buff *skb)
......
1426 1426
static inline void skb_set_transport_header(struct sk_buff *skb,
1427 1427
					    const int offset)
1428 1428
{
1429
	skb->transport_header = skb->data + offset;
1429
  skb->transport_header = ((int) __get_unaligned_cpu32(&skb->data)) + offset;
1430 1430
}
1431 1431

  
1432 1432
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
1433 1433
{
1434
	return skb->network_header;
1434
  return (unsigned char *) __get_unaligned_cpu32(&skb->network_header);
1435 1435
}
1436 1436

  
1437 1437
static inline void skb_reset_network_header(struct sk_buff *skb)
1438
-