diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ddbdde82a700..61ac8d06292c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -82,32 +82,6 @@ int rtnl_trylock(void) | |||
82 | return mutex_trylock(&rtnl_mutex); | 82 | return mutex_trylock(&rtnl_mutex); |
83 | } | 83 | } |
84 | 84 | ||
85 | int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len) | ||
86 | { | ||
87 | memset(tb, 0, sizeof(struct rtattr*)*maxattr); | ||
88 | |||
89 | while (RTA_OK(rta, len)) { | ||
90 | unsigned flavor = rta->rta_type; | ||
91 | if (flavor && flavor <= maxattr) | ||
92 | tb[flavor-1] = rta; | ||
93 | rta = RTA_NEXT(rta, len); | ||
94 | } | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, | ||
99 | struct rtattr *rta, int len) | ||
100 | { | ||
101 | if (RTA_PAYLOAD(rta) < len) | ||
102 | return -1; | ||
103 | if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) { | ||
104 | rta = RTA_DATA(rta) + RTA_ALIGN(len); | ||
105 | return rtattr_parse_nested(tb, maxattr, rta); | ||
106 | } | ||
107 | memset(tb, 0, sizeof(struct rtattr *) * maxattr); | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static struct rtnl_link *rtnl_msg_handlers[NPROTO]; | 85 | static struct rtnl_link *rtnl_msg_handlers[NPROTO]; |
112 | 86 | ||
113 | static inline int rtm_msgindex(int msgtype) | 87 | static inline int rtm_msgindex(int msgtype) |
@@ -442,21 +416,6 @@ void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data | |||
442 | memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); | 416 | memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); |
443 | } | 417 | } |
444 | 418 | ||
445 | size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size) | ||
446 | { | ||
447 | size_t ret = RTA_PAYLOAD(rta); | ||
448 | char *src = RTA_DATA(rta); | ||
449 | |||
450 | if (ret > 0 && src[ret - 1] == '\0') | ||
451 | ret--; | ||
452 | if (size > 0) { | ||
453 | size_t len = (ret >= size) ? size - 1 : ret; | ||
454 | memset(dest, 0, size); | ||
455 | memcpy(dest, src, len); | ||
456 | } | ||
457 | return ret; | ||
458 | } | ||
459 | |||
460 | int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) | 419 | int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) |
461 | { | 420 | { |
462 | struct sock *rtnl = net->rtnl; | 421 | struct sock *rtnl = net->rtnl; |
@@ -1411,9 +1370,6 @@ void __init rtnetlink_init(void) | |||
1411 | } | 1370 | } |
1412 | 1371 | ||
1413 | EXPORT_SYMBOL(__rta_fill); | 1372 | EXPORT_SYMBOL(__rta_fill); |
1414 | EXPORT_SYMBOL(rtattr_strlcpy); | ||
1415 | EXPORT_SYMBOL(rtattr_parse); | ||
1416 | EXPORT_SYMBOL(__rtattr_parse_nested_compat); | ||
1417 | EXPORT_SYMBOL(rtnetlink_put_metrics); | 1373 | EXPORT_SYMBOL(rtnetlink_put_metrics); |
1418 | EXPORT_SYMBOL(rtnl_lock); | 1374 | EXPORT_SYMBOL(rtnl_lock); |
1419 | EXPORT_SYMBOL(rtnl_trylock); | 1375 | EXPORT_SYMBOL(rtnl_trylock); |