[prev in list] [next in list] [prev in thread] [next in thread]
List: quagga-dev
Subject: [quagga-dev 5580] [Patch] Minor change to how to open DLPI devices
From: Jingjing Duan <Jingjing.Duan () Sun ! COM>
Date: 2008-07-10 15:18:43
Message-ID: 48762853.4090405 () sun ! com
[Download RAW message or body]
It's a minor change to the function open_dlpi_dev() in file
isisd/isis_dlpi.c. Currently, when we open a DLPI (Ethernet link), we
just look for "/dev/foo0" (Style 1) and "/dev/foo" (Style 2). The
Clearview UV project has created a renaming mechanism, which is
expressed through device nodes in the /dev/net directory. We should try
to open devices under /dev/net first before attempting to open anything
else.
It's worth noting that Clearview also has a private (undocumented)
special environment variable called "DLPI_DEVONLY" that disables this
feature. We take that into account as well.
Below is the patch against the current Quagga CVS repository.
Index: isisd/isis_dlpi.c
===================================================================
RCS file: /var/cvsroot/quagga/isisd/isis_dlpi.c,v
retrieving revision 1.1
diff -u -p -w -b -r1.1 isis_dlpi.c
--- isisd/isis_dlpi.c 8 Aug 2007 11:19:27 -0000 1.1
+++ isisd/isis_dlpi.c 10 Jul 2008 14:43:40 -0000
@@ -316,11 +316,20 @@ open_dlpi_dev (struct isis_circuit *circ
return ISIS_WARNING;
}
- /* Try first as Style 1 */
+ /* Try the vanity node first, if permitted */
+ if (getenv("DLPI_DEVONLY") == NULL) {
+ (void) snprintf(devpath, sizeof(devpath), "/dev/net/%s",
+ circuit->interface->name);
+ fd = dlpiopen(devpath, &acklen);
+ }
+
+ /* Now try as an ordinary Style 1 node */
+ if (fd == -1) {
(void) snprintf(devpath, sizeof (devpath), "/dev/%s",
circuit->interface->name);
unit = -1;
fd = dlpiopen (devpath, &acklen);
+ }
/* If that fails, try again as Style 2 */
if (fd == -1)
--
Jingjing Duan (intern)
Solaris Networking
781.442.2169 (x22169)
617.957.8809 (cell)
Jingjing.Duan@sun.com
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic