* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
@ 2004-01-15 19:09 Shirley Ma
2004-01-15 19:19 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 14+ messages in thread
From: Shirley Ma @ 2004-01-15 19:09 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: mashirle, davem, kuznet, netdev, yoshfuji
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
Agree.
But if no applications use this value, and nothing is boken. It's not
harmful to change the kernel to provide MIBs in as-is format.
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@linux-ipv6.org>@cerberus.hongo.wide.ad.jp> on 01/15/2004 10:36:22
AM
Sent by: "Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp>
To: Shirley Ma/Beaverton/IBM@IBMUS
cc: mashirle@us.ltcfwd.linux.ibm.com, davem@redhat.com,
kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
In article <OF87A9D639.F6A8D26B-ON88256E1C.0064AD99@us.ibm.com> (at Thu, 15
Jan 2004 10:26:21 -0800), Shirley Ma <xma@us.ibm.com> says:
> This is a bug fix for ipDefaultRouter Table. According to the new IP
MIBs,
> the DefaultRouterLifeTime(expire) entry in this table is unsigned 32. It
> measures the remaining length of time in seconds. If it's expire, the
value
> should be 0.
Kernel does not have to provide MIB in as-is format.
--yoshfuji
[-- Attachment #2: Type: text/html, Size: 1499 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:09 [PATCH] IPv6 MIB:ipv6DefaultRouterTable Shirley Ma
@ 2004-01-15 19:19 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:37 ` David S. Miller
0 siblings, 1 reply; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 19:19 UTC (permalink / raw)
To: xma; +Cc: mashirle, davem, kuznet, netdev, yoshfuji
In article <OFC6D64AE0.CEE7DA5F-ON87256E1C.0068A56A@us.ibm.com> (at Thu, 15 Jan 2004 11:09:47 -0800), Shirley Ma <xma@us.ibm.com> says:
> But if no applications use this value, and nothing is boken. It's not
> harmful to change the kernel to provide MIBs in as-is format.
Shirley, nobody can prove that nothing will be broken. :-)
--yoshfuji
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:19 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-01-15 19:37 ` David S. Miller
2004-01-15 19:47 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2004-01-15 19:37 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / _$B5HF#1QL@; +Cc: xma, mashirle, kuznet, netdev, yoshfuji
On Fri, 16 Jan 2004 04:19:50 +0900 (JST)
YOSHIFUJI Hideaki / _$B5HF#1QL@ <yoshfuji@linux-ipv6.org> wrote:
> In article <OFC6D64AE0.CEE7DA5F-ON87256E1C.0068A56A@us.ibm.com> (at Thu, 15 Jan 2004 11:09:47 -0800), Shirley Ma <xma@us.ibm.com> says:
>
> > But if no applications use this value, and nothing is boken. It's not
> > harmful to change the kernel to provide MIBs in as-is format.
>
> Shirley, nobody can prove that nothing will be broken. :-)
And also, the current situation is OK as long as this value we present now
can be converted into the desired value. Is this the case?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:37 ` David S. Miller
@ 2004-01-15 19:47 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 19:47 UTC (permalink / raw)
To: davem; +Cc: xma, mashirle, kuznet, netdev, yoshfuji
In article <20040115113700.166ddfb0.davem@redhat.com> (at Thu, 15 Jan 2004 11:37:00 -0800), "David S. Miller" <davem@redhat.com> says:
> And also, the current situation is OK as long as this value we present now
> can be converted into the desired value. Is this the case?
I think so for the routing table AFAIK.
For neighbours, "jiffies" is required to be exported.
--yoshfuji
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
@ 2004-01-15 19:59 Shirley Ma
0 siblings, 0 replies; 14+ messages in thread
From: Shirley Ma @ 2004-01-15 19:59 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: davem, mashirle, kuznet, netdev, yoshfuji
[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]
OK, I agree with both of you. Then this patch is not needed. Yoshifuji, you
can sleep in peace. ;-)
Thank you all!
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>@oss.sgi.com on
01/15/2004 11:53:41 AM
Sent by: netdev-bounce@oss.sgi.com
To: davem@redhat.com
cc: Shirley Ma/Beaverton/IBM@IBMUS, mashirle@us.ltcfwd.linux.ibm.com,
kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
In article <20040115113840.4b7eb5d8.davem@redhat.com> (at Thu, 15 Jan 2004
11:38:40 -0800), "David S. Miller" <davem@redhat.com> says:
> We can create new files to present information in new ways and formats,
> but I totally prefer using netlink based information gathering over
making
> new procfs files.
Although this discussion is about rtnetlink message,
problem will be solved if we provide jiffies for neigbours
IMHO.
--yoshfuji @ let me sleep...
[-- Attachment #2: Type: text/html, Size: 1435 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
@ 2004-01-15 19:30 Shirley Ma
2004-01-15 19:36 ` YOSHIFUJI Hideaki / 吉藤英明
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Shirley Ma @ 2004-01-15 19:30 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: mashirle, davem, kuznet, netdev, yoshfuji
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]
Hi, Yoshifuji,
This rule would mean that any new kernel development *could* break
something somewhere else? ;-)
I don't see any application uses these values for now, so I change them.
It's good for kernel to provide the real MIBs information. If later on,
some applications start to use these values, they can get the correct
numbers without converting. Unless you can give me an broken example. :-)
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@linux-ipv6.org>@cerberus.hongo.wide.ad.jp> on 01/15/2004 11:19:50
AM
Sent by: "Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp>
To: Shirley Ma/Beaverton/IBM@IBMUS
cc: mashirle@us.ltcfwd.linux.ibm.com, davem@redhat.com,
kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
In article <OFC6D64AE0.CEE7DA5F-ON87256E1C.0068A56A@us.ibm.com> (at Thu, 15
Jan 2004 11:09:47 -0800), Shirley Ma <xma@us.ibm.com> says:
> But if no applications use this value, and nothing is boken. It's not
> harmful to change the kernel to provide MIBs in as-is format.
Shirley, nobody can prove that nothing will be broken. :-)
--yoshfuji
[-- Attachment #2: Type: text/html, Size: 1685 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:30 Shirley Ma
@ 2004-01-15 19:36 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:38 ` David S. Miller
2004-01-15 19:45 ` YOSHIFUJI Hideaki / 吉藤英明
2 siblings, 0 replies; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 19:36 UTC (permalink / raw)
To: xma; +Cc: mashirle, davem, kuznet, netdev, yoshfuji
In article <OF6C177E72.62FA8BF9-ON87256E1C.006A8953@us.ibm.com> (at Thu, 15 Jan 2004 11:30:25 -0800), Shirley Ma <xma@us.ibm.com> says:
> I don't see any application uses these values for now, so I change them.
> It's good for kernel to provide the real MIBs information. If later on,
> some applications start to use these values, they can get the correct
> numbers without converting. Unless you can give me an broken example. :-)
ip -6 route ?
--yoshfuji
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:30 Shirley Ma
2004-01-15 19:36 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-01-15 19:38 ` David S. Miller
2004-01-15 19:53 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:45 ` YOSHIFUJI Hideaki / 吉藤英明
2 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2004-01-15 19:38 UTC (permalink / raw)
To: Shirley Ma; +Cc: yoshfuji, mashirle, kuznet, netdev
On Thu, 15 Jan 2004 11:30:25 -0800
Shirley Ma <xma@us.ibm.com> wrote:
> I don't see any application uses these values for now, so I change them.
> It's good for kernel to provide the real MIBs information. If later on,
> some applications start to use these values, they can get the correct
> numbers without converting. Unless you can give me an broken example. :-)
Format and layout of procfs files have to stay as they are, this is just the
nature of the game.
We can create new files to present information in new ways and formats,
but I totally prefer using netlink based information gathering over making
new procfs files.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:38 ` David S. Miller
@ 2004-01-15 19:53 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 19:53 UTC (permalink / raw)
To: davem; +Cc: xma, mashirle, kuznet, netdev, yoshfuji
In article <20040115113840.4b7eb5d8.davem@redhat.com> (at Thu, 15 Jan 2004 11:38:40 -0800), "David S. Miller" <davem@redhat.com> says:
> We can create new files to present information in new ways and formats,
> but I totally prefer using netlink based information gathering over making
> new procfs files.
Although this discussion is about rtnetlink message,
problem will be solved if we provide jiffies for neigbours
IMHO.
--yoshfuji @ let me sleep...
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 19:30 Shirley Ma
2004-01-15 19:36 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:38 ` David S. Miller
@ 2004-01-15 19:45 ` YOSHIFUJI Hideaki / 吉藤英明
2 siblings, 0 replies; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 19:45 UTC (permalink / raw)
To: xma; +Cc: mashirle, davem, kuznet, netdev, yoshfuji
In article <OF6C177E72.62FA8BF9-ON87256E1C.006A8953@us.ibm.com> (at Thu, 15 Jan 2004 11:30:25 -0800), Shirley Ma <xma@us.ibm.com> says:
> This rule would mean that any new kernel development *could* break
> something somewhere else? ;-)
Please try to avoid changing the interface as long as you can.
Please add something rather change it.
In these case, we can avoid changing the interface,
so let's avoid breaking interface.
For ipv6inetNetToMeiaTable case, it is ok to add "jiffies,"
but it wrong to change the value's context.
If you really want to "change" that, please change the name.
Thanks.
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
@ 2004-01-15 18:26 Shirley Ma
2004-01-15 18:36 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 14+ messages in thread
From: Shirley Ma @ 2004-01-15 18:26 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: mashirle, davem, kuznet, netdev
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
This is a bug fix for ipDefaultRouter Table. According to the new IP MIBs,
the DefaultRouterLifeTime(expire) entry in this table is unsigned 32. It
measures the remaining length of time in seconds. If it's expire, the value
should be 0.
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@linux-ipv6.org>@cerberus.hongo.wide.ad.jp> on 01/15/2004 01:03:15
AM
Sent by: "Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp>
To: mashirle@us.ltcfwd.linux.ibm.com
cc: davem@redhat.com, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, Shirley
Ma/Beaverton/IBM@IBMUS
Subject: Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
In article <200401141622.09299.mashirle@us.ibm.com> (at Wed, 14 Jan 2004
16:22:09 -0800), Shirley Ma <mashirle@us.ibm.com> says:
> This patch is agaist 2.6.1 kernel.
Wrong. Do not change user interface.
--yoshfuji
[-- Attachment #2: Type: text/html, Size: 1309 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2004-01-15 18:26 Shirley Ma
@ 2004-01-15 18:36 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 14+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-01-15 18:36 UTC (permalink / raw)
To: xma; +Cc: mashirle, davem, kuznet, netdev, yoshfuji
In article <OF87A9D639.F6A8D26B-ON88256E1C.0064AD99@us.ibm.com> (at Thu, 15 Jan 2004 10:26:21 -0800), Shirley Ma <xma@us.ibm.com> says:
> This is a bug fix for ipDefaultRouter Table. According to the new IP MIBs,
> the DefaultRouterLifeTime(expire) entry in this table is unsigned 32. It
> measures the remaining length of time in seconds. If it's expire, the value
> should be 0.
Kernel does not have to provide MIB in as-is format.
--yoshfuji
^ permalink raw reply [flat|nested] 14+ messages in thread
* IPv6 MIB:ipv6PrefixTable implementation
@ 2003-11-20 0:21 Shirley Ma
2003-12-05 21:51 ` [PATCH] IPv6 MIB:ipv6Prefix netlink notification Shirley Ma
0 siblings, 1 reply; 14+ messages in thread
From: Shirley Ma @ 2003-11-20 0:21 UTC (permalink / raw)
To: kuznet, netdev; +Cc: xma
Hi, Alexy,
A while ago, we had a discussion about IPv6 Prefix Table implementation.
I agree with you it's not necessary to process offlink prefix.
In each ipv6PrefixTable, there are 9 objects, which are Ifindex, Type, Prefix,
Length, Origin(addrconf, manually, dhcp, others), OnLinkFlag, AutonomoueFlag,
AdvPreferredLiftTime and ValidLifeTime.
As we know, the routing table has all on-link prefix routes. But only Prefix,
Length, Ifindex are saved in routing table, the rest objects info are not saved
anywhere.
One implementation detail question, do you think I need to save all the other
Prefix Objects: Type, Origin(addrconf, manually, dhcp, others), OnLinkFlag,
AutonomoueFlag, AdvPreferredLiftTime and ValidLifeTime in routing table also?
If so, sounds like I add a big structure in each prefix route entry in the routing table.
Thanks
Shirley Ma
IBM Linux Technology Center
=======================
List: linux-netdev
Subject: Re: [Issues] Implementation for IPv6 MIB:ipv6PrefixTable
From: kuznet () ms2 ! inr ! ac ! ru
Date: 2003-10-24 17:59:27
Hello!
> First, do you think it's a good idea to save all prefix objects in routing
> table?
Those which are on-link, of course.
> Second, where is the best location for the off-link prefix, on-link flag 0
> prefix to be saved?
Do you really think off-link prefixes are to be saved? Prefix in use is onlink
by defintion, so just return 1 in these bit and ignore off-link prefixes
completely, they are meaningless, are not they?
> Third, do you think it's a good idea to implement a prefix table/per
> interface in the kernel?
Well, if SNMP is going to be used as a tool to snoop ndisc promiscuously
(which seems to be the case if it shows inforrmation about offlink prefixes),
then it is definitely not a kernel task.
Alexey
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] IPv6 MIB:ipv6Prefix netlink notification
2003-11-20 0:21 IPv6 MIB:ipv6PrefixTable implementation Shirley Ma
@ 2003-12-05 21:51 ` Shirley Ma
2003-12-05 22:57 ` David S. Miller
0 siblings, 1 reply; 14+ messages in thread
From: Shirley Ma @ 2003-12-05 21:51 UTC (permalink / raw)
To: kuznet, netdev; +Cc: xma
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
Once receiving a router advertisement message for prefix info,
a netlink notification event will be created.
This patch has been tested against linux-2.6.0-test11.
Thanks
Shirley Ma
IBM Linux Technology Center
[-- Attachment #2: linux-2.6.0-test11-ipv6mib3.patch --]
[-- Type: text/x-diff, Size: 4590 bytes --]
diff -urN linux-2.6.0-test11/include/linux/rtnetlink.h linux-2.6.0-test11-ipv6mib3/include/linux/rtnetlink.h
--- linux-2.6.0-test11/include/linux/rtnetlink.h 2003-11-26 12:45:11.000000000 -0800
+++ linux-2.6.0-test11-ipv6mib3/include/linux/rtnetlink.h 2003-12-05 12:20:11.000000000 -0800
@@ -44,7 +44,10 @@
#define RTM_DELTFILTER (RTM_BASE+29)
#define RTM_GETTFILTER (RTM_BASE+30)
-#define RTM_MAX (RTM_BASE+31)
+#define RTM_NEWPREFIX (RTM_BASE+36)
+#define RTM_GETPREFIX (RTM_BASE+38)
+
+#define RTM_MAX (RTM_BASE+39)
/*
Generic structure for encapsulation of optional route information.
@@ -458,6 +461,34 @@
unsigned ifi_change; /* IFF_* change mask */
};
+/********************************************************************
+ * prefix information
+ ****/
+
+struct prefixmsg
+{
+ unsigned char prefix_family;
+ int prefix_ifindex;
+ unsigned char prefix_type;
+ unsigned char prefix_len;
+ unsigned char prefix_flags;
+};
+
+enum
+{
+ PREFIX_UNSPEC,
+ PREFIX_ADDRESS,
+ PREFIX_CACHEINFO,
+};
+
+#define PREFIX_MAX PREFIX_CACHEINFO
+
+struct prefix_cacheinfo
+{
+ __u32 preferred_time;
+ __u32 valid_time;
+};
+
/* The struct should be in sync with struct net_device_stats */
struct rtnl_link_stats
{
@@ -614,6 +645,8 @@
#define RTMGRP_DECnet_IFADDR 0x1000
#define RTMGRP_DECnet_ROUTE 0x4000
+#define RTMGRP_IPV6_PREFIX 0x20000
+
/* End of information exported to user level */
#ifdef __KERNEL__
diff -urN linux-2.6.0-test11/include/net/if_inet6.h linux-2.6.0-test11-ipv6mib3/include/net/if_inet6.h
--- linux-2.6.0-test11/include/net/if_inet6.h 2003-11-26 12:45:45.000000000 -0800
+++ linux-2.6.0-test11-ipv6mib3/include/net/if_inet6.h 2003-12-05 12:20:11.000000000 -0800
@@ -25,6 +25,10 @@
#define IF_RA_RCVD 0x20
#define IF_RS_SENT 0x10
+/* prefix flags */
+#define IF_PREFIX_ONLINK 0x01
+#define IF_PREFIX_AUTOCONF 0x02
+
#ifdef __KERNEL__
struct inet6_ifaddr
diff -urN linux-2.6.0-test11/net/ipv6/addrconf.c linux-2.6.0-test11-ipv6mib3/net/ipv6/addrconf.c
--- linux-2.6.0-test11/net/ipv6/addrconf.c 2003-11-26 12:45:37.000000000 -0800
+++ linux-2.6.0-test11-ipv6mib3/net/ipv6/addrconf.c 2003-12-05 12:21:59.000000000 -0800
@@ -138,6 +138,8 @@
static void addrconf_rs_timer(unsigned long data);
static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);
+static void inet6_prefix_notify(int event, struct inet6_dev *idev,
+ struct prefix_info *pinfo);
static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev);
static struct notifier_block *inet6addr_chain;
@@ -1491,6 +1493,7 @@
addrconf_verify(0);
}
}
+ inet6_prefix_notify(RTM_NEWPREFIX, in6_dev, pinfo);
in6_dev_put(in6_dev);
}
@@ -2751,6 +2754,66 @@
return skb->len;
}
+static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
+ struct prefix_info *pinfo, u32 pid, u32 seq, int event)
+{
+ struct prefixmsg *pmsg;
+ struct nlmsghdr *nlh;
+ unsigned char *b = skb->tail;
+ struct prefix_cacheinfo ci;
+
+ nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*pmsg));
+
+ if (pid)
+ nlh->nlmsg_flags |= NLM_F_MULTI;
+
+ pmsg = NLMSG_DATA(nlh);
+ pmsg->prefix_family = AF_INET6;
+ pmsg->prefix_ifindex = idev->dev->ifindex;
+ pmsg->prefix_len = pinfo->prefix_len;
+ pmsg->prefix_type = pinfo->type;
+
+ pmsg->prefix_flags = 0;
+ if (pinfo->onlink)
+ pmsg->prefix_flags |= IF_PREFIX_ONLINK;
+ if (pinfo->autoconf)
+ pmsg->prefix_flags |= IF_PREFIX_AUTOCONF;
+
+ RTA_PUT(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix);
+
+ ci.preferred_time = ntohl(pinfo->prefered);
+ ci.valid_time = ntohl(pinfo->valid);
+ RTA_PUT(skb, PREFIX_CACHEINFO, sizeof(ci), &ci);
+
+ nlh->nlmsg_len = skb->tail - b;
+ return skb->len;
+
+nlmsg_failure:
+rtattr_failure:
+ skb_trim(skb, b - skb->data);
+ return -1;
+}
+
+static void inet6_prefix_notify(int event, struct inet6_dev *idev,
+ struct prefix_info *pinfo)
+{
+ struct sk_buff *skb;
+ int size = NLMSG_SPACE(sizeof(struct prefixmsg)+128);
+
+ skb = alloc_skb(size, GFP_ATOMIC);
+ if (!skb) {
+ netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, ENOBUFS);
+ return;
+ }
+ if (inet6_fill_prefix(skb, idev, pinfo, 0, 0, event) < 0) {
+ kfree_skb(skb);
+ netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, EINVAL);
+ return;
+ }
+ NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_PREFIX;
+ netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_PREFIX, GFP_ATOMIC);
+}
+
static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = {
[RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, },
[RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, },
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] IPv6 MIB:ipv6Prefix netlink notification
2003-12-05 21:51 ` [PATCH] IPv6 MIB:ipv6Prefix netlink notification Shirley Ma
@ 2003-12-05 22:57 ` David S. Miller
2004-01-15 0:22 ` [PATCH] IPv6 MIB:ipv6DefaultRouterTable Shirley Ma
0 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2003-12-05 22:57 UTC (permalink / raw)
To: Shirley Ma; +Cc: kuznet, netdev, xma
On Fri, 5 Dec 2003 13:51:47 -0800
Shirley Ma <mashirle@us.ibm.com> wrote:
> Once receiving a router advertisement message for prefix info,
> a netlink notification event will be created.
>
> This patch has been tested against linux-2.6.0-test11.
Let's queue this up for 2.6.1, please resend it after 2.6.0 is
released.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] IPv6 MIB:ipv6DefaultRouterTable
2003-12-05 22:57 ` David S. Miller
@ 2004-01-15 0:22 ` Shirley Ma
2004-01-15 9:03 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 14+ messages in thread
From: Shirley Ma @ 2004-01-15 0:22 UTC (permalink / raw)
To: David S. Miller; +Cc: kuznet, netdev, xma
[-- Attachment #1: Type: text/plain, Size: 91 bytes --]
This patch is agaist 2.6.1 kernel.
Thanks
Shirley Ma
IBM Linux Technology Center
[-- Attachment #2: linux-2.6.1-ipv6mib7.patch --]
[-- Type: text/x-diff, Size: 1121 bytes --]
diff -urN linux-2.6.1/include/linux/rtnetlink.h linux-2.6.1-ipv6mib7/include/linux/rtnetlink.h
--- linux-2.6.1/include/linux/rtnetlink.h 2004-01-08 22:59:55.000000000 -0800
+++ linux-2.6.1-ipv6mib7/include/linux/rtnetlink.h 2004-01-13 10:41:55.000000000 -0800
@@ -247,7 +247,7 @@
{
__u32 rta_clntref;
__u32 rta_lastuse;
- __s32 rta_expires;
+ __u32 rta_expires; /* seconds */
__u32 rta_error;
__u32 rta_used;
diff -urN linux-2.6.1/net/ipv6/route.c linux-2.6.1-ipv6mib7/net/ipv6/route.c
--- linux-2.6.1/net/ipv6/route.c 2004-01-08 22:59:48.000000000 -0800
+++ linux-2.6.1-ipv6mib7/net/ipv6/route.c 2004-01-13 10:41:55.000000000 -0800
@@ -1535,8 +1535,8 @@
RTA_PUT(skb, RTA_OIF, sizeof(int), &rt->rt6i_dev->ifindex);
RTA_PUT(skb, RTA_PRIORITY, 4, &rt->rt6i_metric);
ci.rta_lastuse = jiffies_to_clock_t(jiffies - rt->u.dst.lastuse);
- if (rt->rt6i_expires)
- ci.rta_expires = jiffies_to_clock_t(rt->rt6i_expires - jiffies);
+ if (rt->rt6i_expires && time_after(rt->rt6i_expires, jiffies))
+ ci.rta_expires = (rt->rt6i_expires - jiffies)/HZ;
else
ci.rta_expires = 0;
ci.rta_used = rt->u.dst.__use;
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2004-01-15 19:59 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-15 19:09 [PATCH] IPv6 MIB:ipv6DefaultRouterTable Shirley Ma
2004-01-15 19:19 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:37 ` David S. Miller
2004-01-15 19:47 ` YOSHIFUJI Hideaki / 吉藤英明
-- strict thread matches above, loose matches on Subject: below --
2004-01-15 19:59 Shirley Ma
2004-01-15 19:30 Shirley Ma
2004-01-15 19:36 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:38 ` David S. Miller
2004-01-15 19:53 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 19:45 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-15 18:26 Shirley Ma
2004-01-15 18:36 ` YOSHIFUJI Hideaki / 吉藤英明
2003-11-20 0:21 IPv6 MIB:ipv6PrefixTable implementation Shirley Ma
2003-12-05 21:51 ` [PATCH] IPv6 MIB:ipv6Prefix netlink notification Shirley Ma
2003-12-05 22:57 ` David S. Miller
2004-01-15 0:22 ` [PATCH] IPv6 MIB:ipv6DefaultRouterTable Shirley Ma
2004-01-15 9:03 ` YOSHIFUJI Hideaki / 吉藤英明
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).