aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/rculist.h17
-rw-r--r--include/linux/skbuff.h15
-rw-r--r--include/linux/sunrpc/svc_xprt.h4
-rw-r--r--include/linux/xfrm.h14
5 files changed, 47 insertions, 15 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fba141d3ca07..ed60f8718d80 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -357,18 +357,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
357 ((unsigned char *)&addr)[3] 357 ((unsigned char *)&addr)[3]
358#define NIPQUAD_FMT "%u.%u.%u.%u" 358#define NIPQUAD_FMT "%u.%u.%u.%u"
359 359
360#define NIP6(addr) \
361 ntohs((addr).s6_addr16[0]), \
362 ntohs((addr).s6_addr16[1]), \
363 ntohs((addr).s6_addr16[2]), \
364 ntohs((addr).s6_addr16[3]), \
365 ntohs((addr).s6_addr16[4]), \
366 ntohs((addr).s6_addr16[5]), \
367 ntohs((addr).s6_addr16[6]), \
368 ntohs((addr).s6_addr16[7])
369#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
370#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"
371
372#if defined(__LITTLE_ENDIAN) 360#if defined(__LITTLE_ENDIAN)
373#define HIPQUAD(addr) \ 361#define HIPQUAD(addr) \
374 ((unsigned char *)&addr)[3], \ 362 ((unsigned char *)&addr)[3], \
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e649bd3f2c97..3ba2998b22ba 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -383,5 +383,22 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ 383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
384 pos = rcu_dereference(pos->next)) 384 pos = rcu_dereference(pos->next))
385 385
386/**
387 * hlist_for_each_entry_rcu_safenext - iterate over rcu list of given type
388 * @tpos: the type * to use as a loop cursor.
389 * @pos: the &struct hlist_node to use as a loop cursor.
390 * @head: the head for your list.
391 * @member: the name of the hlist_node within the struct.
392 * @next: the &struct hlist_node to use as a next cursor
393 *
394 * Special version of hlist_for_each_entry_rcu that make sure
395 * each next pointer is fetched before each iteration.
396 */
397#define hlist_for_each_entry_rcu_safenext(tpos, pos, head, member, next) \
398 for (pos = rcu_dereference((head)->first); \
399 pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && \
400 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
401 pos = rcu_dereference(next))
402
386#endif /* __KERNEL__ */ 403#endif /* __KERNEL__ */
387#endif 404#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2725f4e5a9bf..487e34507b41 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -269,8 +269,9 @@ struct sk_buff {
269 struct dst_entry *dst; 269 struct dst_entry *dst;
270 struct rtable *rtable; 270 struct rtable *rtable;
271 }; 271 };
272#ifdef CONFIG_XFRM
272 struct sec_path *sp; 273 struct sec_path *sp;
273 274#endif
274 /* 275 /*
275 * This is the control buffer. It is free to use for every 276 * This is the control buffer. It is free to use for every
276 * layer. Please put your private variables there. If you 277 * layer. Please put your private variables there. If you
@@ -1864,6 +1865,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
1864 to->queue_mapping = from->queue_mapping; 1865 to->queue_mapping = from->queue_mapping;
1865} 1866}
1866 1867
1868#ifdef CONFIG_XFRM
1869static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1870{
1871 return skb->sp;
1872}
1873#else
1874static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1875{
1876 return NULL;
1877}
1878#endif
1879
1867static inline int skb_is_gso(const struct sk_buff *skb) 1880static inline int skb_is_gso(const struct sk_buff *skb)
1868{ 1881{
1869 return skb_shinfo(skb)->gso_size; 1882 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 6fd7b016517f..51cb75ea42d5 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -145,8 +145,8 @@ static inline char *__svc_print_addr(struct sockaddr *addr,
145 break; 145 break;
146 146
147 case AF_INET6: 147 case AF_INET6:
148 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 148 snprintf(buf, len, "%pI6, port=%u",
149 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 149 &((struct sockaddr_in6 *)addr)->sin6_addr,
150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); 150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port));
151 break; 151 break;
152 152
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 4bc1e6b86cb2..52f3abd453a1 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -199,6 +199,9 @@ enum {
199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO 199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
200 XFRM_MSG_GETSPDINFO, 200 XFRM_MSG_GETSPDINFO,
201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO 201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
202
203 XFRM_MSG_MAPPING,
204#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
202 __XFRM_MSG_MAX 205 __XFRM_MSG_MAX
203}; 206};
204#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 207#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -438,6 +441,15 @@ struct xfrm_user_migrate {
438 __u16 new_family; 441 __u16 new_family;
439}; 442};
440 443
444struct xfrm_user_mapping {
445 struct xfrm_usersa_id id;
446 __u32 reqid;
447 xfrm_address_t old_saddr;
448 xfrm_address_t new_saddr;
449 __be16 old_sport;
450 __be16 new_sport;
451};
452
441#ifndef __KERNEL__ 453#ifndef __KERNEL__
442/* backwards compatibility for userspace */ 454/* backwards compatibility for userspace */
443#define XFRMGRP_ACQUIRE 1 455#define XFRMGRP_ACQUIRE 1
@@ -464,6 +476,8 @@ enum xfrm_nlgroups {
464#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT 476#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
465 XFRMNLGRP_MIGRATE, 477 XFRMNLGRP_MIGRATE,
466#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE 478#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
479 XFRMNLGRP_MAPPING,
480#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
467 __XFRMNLGRP_MAX 481 __XFRMNLGRP_MAX
468}; 482};
469#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 483#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)