aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rtnetlink.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:31:22 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:31:22 -0400
commite1bd2ac5a6b7a8b625e40c9e9f8b6dea4cf22f85 (patch)
tree9366e9fb481da2c7195ca3f2bafeffebbf001363 /include/linux/rtnetlink.h
parent0b9062f6b57a87f22309c6b920a51aaa66ce2a13 (diff)
parent15028aad00ddf241581fbe74a02ec89cbb28d35d (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (183 commits) [TG3]: Update version to 3.78. [TG3]: Add missing NVRAM strapping. [TG3]: Enable auto MDI. [TG3]: Fix the polarity bit. [TG3]: Fix irq_sync race condition. [NET_SCHED]: ematch: module autoloading [TCP]: tcp probe wraparound handling and other changes [RTNETLINK]: rtnl_link: allow specifying initial device address [RTNETLINK]: rtnl_link API simplification [VLAN]: Fix MAC address handling [ETH]: Validate address in eth_mac_addr [NET]: Fix races in net_rx_action vs netpoll. [AF_UNIX]: Rewrite garbage collector, fixes race. [NETFILTER]: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference (CVE-2007-2876) [NET]: Make all initialized struct seq_operations const. [UDP]: Fix length check. [IPV6]: Remove unneeded pointer idev from addrconf_cleanup(). [DECNET]: Another unnecessary net/tcp.h inclusion in net/dn.h [IPV6]: Make IPV6_{RECV,2292}RTHDR boolean options. [IPV6]: Do not send RH0 anymore. ... Fixed up trivial conflict in Documentation/feature-removal-schedule.txt manually. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r--include/linux/rtnetlink.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1fae30af91f3..c91476ce314a 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -261,7 +261,7 @@ enum rtattr_type_t
261 RTA_FLOW, 261 RTA_FLOW,
262 RTA_CACHEINFO, 262 RTA_CACHEINFO,
263 RTA_SESSION, 263 RTA_SESSION,
264 RTA_MP_ALGO, 264 RTA_MP_ALGO, /* no longer used */
265 RTA_TABLE, 265 RTA_TABLE,
266 __RTA_MAX 266 __RTA_MAX
267}; 267};
@@ -570,10 +570,16 @@ static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
570} 570}
571 571
572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); 572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
573extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
574 struct rtattr *rta, int len);
573 575
574#define rtattr_parse_nested(tb, max, rta) \ 576#define rtattr_parse_nested(tb, max, rta) \
575 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) 577 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
576 578
579#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
580({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
581 __rtattr_parse_nested_compat(tb, max, rta, len); })
582
577extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); 583extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
578extern int rtnl_unicast(struct sk_buff *skb, u32 pid); 584extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
579extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, 585extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
@@ -638,6 +644,18 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
638({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 644({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
639 (skb)->len; }) 645 (skb)->len; })
640 646
647#define RTA_NEST_COMPAT(skb, type, attrlen, data) \
648({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
649 RTA_PUT(skb, type, attrlen, data); \
650 RTA_NEST(skb, type); \
651 __start; })
652
653#define RTA_NEST_COMPAT_END(skb, start) \
654({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \
655 (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
656 RTA_NEST_END(skb, __nest); \
657 (skb)->len; })
658
641#define RTA_NEST_CANCEL(skb, start) \ 659#define RTA_NEST_CANCEL(skb, start) \
642({ if (start) \ 660({ if (start) \
643 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ 661 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \