All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Prefix List against 2.5.73
@ 2003-07-14 22:35 Krishna Kumar
  2003-07-15  1:17 ` kuznet
  0 siblings, 1 reply; 52+ messages in thread
From: Krishna Kumar @ 2003-07-14 22:35 UTC (permalink / raw)
  To: yoshfuji; +Cc: davem, netdev, linux-net, kuznet, krkumar


I am sending the latest patches against 2.5.73 and 2.4.21 with the changes
mentioned in my previous mail. I have also split the patch based on the
functionalities - prefix list and O/M flags of an RA.

At the bottom of this mail contains the patch for setting/getting O/M
flags against 2.5.73. The next three mails contain patches for prefix list
against 2.5.73, and both of these patches against 2.4.21. Please apply the
O/M flags patch before the prefix list patch.

Thanks,

- KK

---------------------------------------------------------------------------

> You do not explain why we (or kernel) NEED(s) this.
> It is not so important how SMALL it is
> though it may cause problems how LARGE it is.

I had explained the reasons for having prefix list i/f in my previous
mail. To recap :
-  User don't need to know what the definition of a prefix is, all he has
   to do is ask the kernel and get the list. Otherwise different user apps
   will have to know the definition of a prefix and parse the entry themselves.
   The parsing is non-trivial (eg the address should not LL or MC, there should
   be no nexthop and it should be added via an RA, etc).
-  The kernel code to get the prefix list is small, the top level
   inet6_dump_fib uses  either the dump_node or the dump_prefix, the
   latter being the new user interface. Having a user interface makes it easier
   to get the prefix list without significant bloat to the kernel.

> This is design issue; how we should provide L3 per-interface
> information to userspace; eg. in_device and/or inet6_dev things
> including per-interface statistics.
>
> Since I think it is not appropriate to provide per-interface
> statistics via RTM_xxxROUTE, so I don't agree to provide
> the RA infomation (i.e. Manage/Otherconf Flags) via
> RTM_xxxROUTE.
>
> Options:
>  - use RTM_xxxLINK for L3 operation
>  - introduce RTM_xxxIFACE for L3 per-interface operations

Yes, there are a couple of different ways to do this. One is as you have
suggested, but there is a problem with it. The existing RTM_GETLINK
interface returns very generic elements of the dev (mtu, hardware address,
dev statistics), while the change you suggested is specific to ipv6. I am
not sure if this is a good design to implement. Either we could use the
current (submitted) way or use a different RTM_GETADDR interface in
inet6_fill_ifaddr (and introduce RTM_IFACEFLAGS). This will be specific to
IPv6. Are you agreeable to this ?

> Well, on moving forward; you can split your patch up to 3 things:
>   1. fix routing flags
>   2. provide Managed/Otherconf flags API
>  (3. provide the prefix list API (if it IS required))
>
> I'm not against the first item.
> We need to discuss on the design related to the 2nd item.
> I don't think that we really need 3rd item.

- I am ok with 1 :-)
- I have suggested changes for 2, please let me know what you think, whether
  we can go with the old way or make the change suggested above.
- I believe we need #3 for the reasons given above.

Thanks,

- KK

----------------------- PATCH for O/M against 2.5.73 --------------------
diff -ruN linux-2.5.73.org/include/linux/rtnetlink.h PATCHES/linux-2.5.73/include/linux/rtnetlink.h
--- linux-2.5.73.org/include/linux/rtnetlink.h	2003-06-22 11:33:07.000000000 -0700
+++ PATCHES/linux-2.5.73/include/linux/rtnetlink.h	2003-07-14 12:11:51.000000000 -0700
@@ -330,6 +330,7 @@
 	IFA_LABEL,
 	IFA_BROADCAST,
 	IFA_ANYCAST,
+	IFA_IFFLAGS,
 	IFA_CACHEINFO
 };

diff -ruN linux-2.5.73.org/include/net/if_inet6.h PATCHES/linux-2.5.73/include/net/if_inet6.h
--- linux-2.5.73.org/include/net/if_inet6.h	2003-06-22 11:33:32.000000000 -0700
+++ PATCHES/linux-2.5.73/include/net/if_inet6.h	2003-07-14 10:30:59.000000000 -0700
@@ -17,6 +17,8 @@

 #include <net/snmp.h>

+#define IF_RA_OTHERCONF	0x80
+#define IF_RA_MANAGED	0x40
 #define IF_RA_RCVD	0x20
 #define IF_RS_SENT	0x10

diff -ruN linux-2.5.73.org/net/ipv6/addrconf.c PATCHES/linux-2.5.73/net/ipv6/addrconf.c
--- linux-2.5.73.org/net/ipv6/addrconf.c	2003-06-22 11:33:17.000000000 -0700
+++ PATCHES/linux-2.5.73/net/ipv6/addrconf.c	2003-07-14 12:22:07.000000000 -0700
@@ -2359,6 +2359,7 @@
 static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
 			     u32 pid, u32 seq, int event)
 {
+	int flags;
 	struct ifaddrmsg *ifm;
 	struct nlmsghdr  *nlh;
 	struct ifa_cacheinfo ci;
@@ -2389,6 +2390,8 @@
 		}
 		RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci);
 	}
+	flags = ifa->idev->if_flags;
+	RTA_PUT(skb, IFA_IFFLAGS, sizeof(flags), &flags);
 	nlh->nlmsg_len = skb->tail - b;
 	return skb->len;

diff -ruN linux-2.5.73.org/net/ipv6/ndisc.c PATCHES/linux-2.5.73/net/ipv6/ndisc.c
--- linux-2.5.73.org/net/ipv6/ndisc.c	2003-06-22 11:32:56.000000000 -0700
+++ PATCHES/linux-2.5.73/net/ipv6/ndisc.c	2003-07-14 10:30:59.000000000 -0700
@@ -1036,6 +1036,16 @@
 		 */
 		in6_dev->if_flags |= IF_RA_RCVD;
 	}
+	/*
+	 * Remember the managed/otherconf flags from most recently
+	 * receieved RA message (RFC 2462) -- yoshfuji
+	 */
+	in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED|
+				IF_RA_OTHERCONF)) |
+				(ra_msg->icmph.icmp6_addrconf_managed ?
+					IF_RA_MANAGED : 0) |
+				(ra_msg->icmph.icmp6_addrconf_other ?
+					IF_RA_OTHERCONF : 0);

 	lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime);

------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2003-09-20  8:18 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-14 22:35 [PATCH 1/4] Prefix List against 2.5.73 Krishna Kumar
2003-07-15  1:17 ` kuznet
2003-07-15  6:59   ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-15 13:20     ` kuznet
2003-07-15 18:34   ` Krishna Kumar
2003-07-16  0:11     ` Krishna Kumar
2003-07-16  0:21     ` kuznet
2003-07-16  8:39       ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-16 18:42         ` [PATCH 1/2] " Krishna Kumar
2003-07-16 18:49           ` Krishna Kumar
2003-07-16 18:50           ` [PATCH 2/2] Prefix List against 2.4.21 Krishna Kumar
2003-07-16 23:41         ` [PATCH 1/4] Prefix List against 2.5.73 kuznet
2003-07-17  0:06           ` Krishna Kumar
2003-07-17  0:38             ` kuznet
2003-07-17 21:12               ` [PATCH 1/2] Prefix List and O/M flags " Krishna Kumar
2003-07-17 22:06                 ` [PATCH 2/2] Prefix List and O/M flags against 2.4.21 Krishna Kumar
2003-07-17 22:22                   ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-17 22:34                     ` Krishna Kumar
2003-07-17 22:47                       ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-18  0:37                         ` [PATCH 2/2] Prefix List and O/M flags against 2.5.73 Krishna Kumar
2003-07-19  6:47                           ` David S. Miller
2003-07-19  7:33                           ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-21  0:49                             ` kuznet
2003-07-21 12:17                           ` David S. Miller
2003-07-21 17:16                             ` Krishna Kumar
2003-07-21  1:55                       ` [PATCH 2/2] Prefix List and O/M flags against 2.4.21 kuznet
2003-07-21  4:46                         ` David S. Miller
2003-07-22 21:50                         ` O/M flags against 2.6.0-test1 Krishna Kumar
2003-07-22 22:25                           ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-22 22:59                             ` Krishna Kumar
2003-07-23 10:13                           ` David S. Miller
2003-07-23 22:32                             ` Krishna Kumar
2003-07-24  7:07                               ` David S. Miller
2003-07-24 14:02                                 ` kuznet
2003-07-24 14:26                                   ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-24 14:43                                     ` kuznet
2003-07-25  0:14                                       ` Krishna Kumar
2003-07-25 13:22                                         ` David S. Miller
2003-07-30  0:33                                 ` Krishna Kumar
2003-07-31  5:02                                   ` David S. Miller
2003-07-31 20:33                                     ` Krishna Kumar
2003-08-04 23:57                                       ` David S. Miller
2003-09-05 18:26                                         ` Krishna Kumar
2003-09-12  2:25                                           ` David S. Miller
2003-09-12 22:36                                             ` Krishna Kumar
2003-09-12 22:45                                             ` O/M flags for 2.4.22 (was "Re: O/M flags against 2.6.0-test1") Krishna Kumar
2003-09-13  0:19                                               ` David S. Miller
2003-09-16 22:06                                                 ` Krishna Kumar
2003-09-20  8:18                                                   ` David S. Miller
2003-07-22 23:52                         ` [PATCH] Prefix List against 2.4.21 Krishna Kumar
2003-07-23 10:02                           ` David S. Miller
2003-07-17 21:53               ` [PATCH 1/4] Prefix List against 2.5.73 YOSHIFUJI Hideaki / 吉藤英明

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.