diff options
-rw-r--r-- | include/linux/rtnetlink.h | 2 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 30 | ||||
-rw-r--r-- | security/selinux/nlmsgtab.c | 1 |
4 files changed, 14 insertions, 20 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3a18addaed4c..33b3d0ab3a91 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -81,8 +81,6 @@ enum { | |||
81 | 81 | ||
82 | RTM_NEWPREFIX = 52, | 82 | RTM_NEWPREFIX = 52, |
83 | #define RTM_NEWPREFIX RTM_NEWPREFIX | 83 | #define RTM_NEWPREFIX RTM_NEWPREFIX |
84 | RTM_GETPREFIX = 54, | ||
85 | #define RTM_GETPREFIX RTM_GETPREFIX | ||
86 | 84 | ||
87 | RTM_GETMULTICAST = 58, | 85 | RTM_GETMULTICAST = 58, |
88 | #define RTM_GETMULTICAST RTM_GETMULTICAST | 86 | #define RTM_GETMULTICAST RTM_GETMULTICAST |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 50d6cb40c6e3..0cb4d9e53a07 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -108,7 +108,6 @@ static const int rtm_min[RTM_NR_FAMILIES] = | |||
108 | [RTM_FAM(RTM_NEWTCLASS)] = NLMSG_LENGTH(sizeof(struct tcmsg)), | 108 | [RTM_FAM(RTM_NEWTCLASS)] = NLMSG_LENGTH(sizeof(struct tcmsg)), |
109 | [RTM_FAM(RTM_NEWTFILTER)] = NLMSG_LENGTH(sizeof(struct tcmsg)), | 109 | [RTM_FAM(RTM_NEWTFILTER)] = NLMSG_LENGTH(sizeof(struct tcmsg)), |
110 | [RTM_FAM(RTM_NEWACTION)] = NLMSG_LENGTH(sizeof(struct tcamsg)), | 110 | [RTM_FAM(RTM_NEWACTION)] = NLMSG_LENGTH(sizeof(struct tcamsg)), |
111 | [RTM_FAM(RTM_NEWPREFIX)] = NLMSG_LENGTH(sizeof(struct rtgenmsg)), | ||
112 | [RTM_FAM(RTM_GETMULTICAST)] = NLMSG_LENGTH(sizeof(struct rtgenmsg)), | 111 | [RTM_FAM(RTM_GETMULTICAST)] = NLMSG_LENGTH(sizeof(struct rtgenmsg)), |
113 | [RTM_FAM(RTM_GETANYCAST)] = NLMSG_LENGTH(sizeof(struct rtgenmsg)), | 112 | [RTM_FAM(RTM_GETANYCAST)] = NLMSG_LENGTH(sizeof(struct rtgenmsg)), |
114 | }; | 113 | }; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 46cd941d296f..052f99eaf2ac 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3518,16 +3518,18 @@ static inline size_t inet6_prefix_nlmsg_size(void) | |||
3518 | } | 3518 | } |
3519 | 3519 | ||
3520 | static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, | 3520 | static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, |
3521 | struct prefix_info *pinfo, u32 pid, u32 seq, | 3521 | struct prefix_info *pinfo, u32 pid, u32 seq, |
3522 | int event, unsigned int flags) | 3522 | int event, unsigned int flags) |
3523 | { | 3523 | { |
3524 | struct prefixmsg *pmsg; | 3524 | struct prefixmsg *pmsg; |
3525 | struct nlmsghdr *nlh; | 3525 | struct nlmsghdr *nlh; |
3526 | unsigned char *b = skb->tail; | ||
3527 | struct prefix_cacheinfo ci; | 3526 | struct prefix_cacheinfo ci; |
3528 | 3527 | ||
3529 | nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*pmsg), flags); | 3528 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*pmsg), flags); |
3530 | pmsg = NLMSG_DATA(nlh); | 3529 | if (nlh == NULL) |
3530 | return -ENOBUFS; | ||
3531 | |||
3532 | pmsg = nlmsg_data(nlh); | ||
3531 | pmsg->prefix_family = AF_INET6; | 3533 | pmsg->prefix_family = AF_INET6; |
3532 | pmsg->prefix_pad1 = 0; | 3534 | pmsg->prefix_pad1 = 0; |
3533 | pmsg->prefix_pad2 = 0; | 3535 | pmsg->prefix_pad2 = 0; |
@@ -3535,26 +3537,22 @@ static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, | |||
3535 | pmsg->prefix_len = pinfo->prefix_len; | 3537 | pmsg->prefix_len = pinfo->prefix_len; |
3536 | pmsg->prefix_type = pinfo->type; | 3538 | pmsg->prefix_type = pinfo->type; |
3537 | pmsg->prefix_pad3 = 0; | 3539 | pmsg->prefix_pad3 = 0; |
3538 | |||
3539 | pmsg->prefix_flags = 0; | 3540 | pmsg->prefix_flags = 0; |
3540 | if (pinfo->onlink) | 3541 | if (pinfo->onlink) |
3541 | pmsg->prefix_flags |= IF_PREFIX_ONLINK; | 3542 | pmsg->prefix_flags |= IF_PREFIX_ONLINK; |
3542 | if (pinfo->autoconf) | 3543 | if (pinfo->autoconf) |
3543 | pmsg->prefix_flags |= IF_PREFIX_AUTOCONF; | 3544 | pmsg->prefix_flags |= IF_PREFIX_AUTOCONF; |
3544 | 3545 | ||
3545 | RTA_PUT(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix); | 3546 | NLA_PUT(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix); |
3546 | 3547 | ||
3547 | ci.preferred_time = ntohl(pinfo->prefered); | 3548 | ci.preferred_time = ntohl(pinfo->prefered); |
3548 | ci.valid_time = ntohl(pinfo->valid); | 3549 | ci.valid_time = ntohl(pinfo->valid); |
3549 | RTA_PUT(skb, PREFIX_CACHEINFO, sizeof(ci), &ci); | 3550 | NLA_PUT(skb, PREFIX_CACHEINFO, sizeof(ci), &ci); |
3550 | 3551 | ||
3551 | nlh->nlmsg_len = skb->tail - b; | 3552 | return nlmsg_end(skb, nlh); |
3552 | return skb->len; | ||
3553 | 3553 | ||
3554 | nlmsg_failure: | 3554 | nla_put_failure: |
3555 | rtattr_failure: | 3555 | return nlmsg_cancel(skb, nlh); |
3556 | skb_trim(skb, b - skb->data); | ||
3557 | return -1; | ||
3558 | } | 3556 | } |
3559 | 3557 | ||
3560 | static void inet6_prefix_notify(int event, struct inet6_dev *idev, | 3558 | static void inet6_prefix_notify(int event, struct inet6_dev *idev, |
diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c index b8f4d25cf335..ccfe8755735e 100644 --- a/security/selinux/nlmsgtab.c +++ b/security/selinux/nlmsgtab.c | |||
@@ -60,7 +60,6 @@ static struct nlmsg_perm nlmsg_route_perms[] = | |||
60 | { RTM_DELACTION, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, | 60 | { RTM_DELACTION, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, |
61 | { RTM_GETACTION, NETLINK_ROUTE_SOCKET__NLMSG_READ }, | 61 | { RTM_GETACTION, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
62 | { RTM_NEWPREFIX, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, | 62 | { RTM_NEWPREFIX, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, |
63 | { RTM_GETPREFIX, NETLINK_ROUTE_SOCKET__NLMSG_READ }, | ||
64 | { RTM_GETMULTICAST, NETLINK_ROUTE_SOCKET__NLMSG_READ }, | 63 | { RTM_GETMULTICAST, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
65 | { RTM_GETANYCAST, NETLINK_ROUTE_SOCKET__NLMSG_READ }, | 64 | { RTM_GETANYCAST, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
66 | { RTM_GETNEIGHTBL, NETLINK_ROUTE_SOCKET__NLMSG_READ }, | 65 | { RTM_GETNEIGHTBL, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |