diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-11-14 22:54:19 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:45 -0500 |
commit | 6051e2f4fb68fc8e5343db58fa680ece376f405c (patch) | |
tree | b061f38f00100e40a3c5b9f33e3acb58c5aa3e7b /net | |
parent | 04561c1fe7b067a8250e6caaf168256783580c4c (diff) |
[IPv6] prefix: Convert RTM_NEWPREFIX notifications to use the new netlink api
RTM_GETPREFIX is completely unused and is thus removed.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/rtnetlink.c | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 30 |
2 files changed, 14 insertions, 17 deletions
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, |