summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorJingjing Duan <Jingjing.Duan@sun.com>2008-08-13 20:29:47 +0200
committerPaul Jakma <paul@quagga.net>2008-08-22 20:52:57 +0200
commit69954565621127a62c11ec315b175b930230c217 (patch)
tree3ed8c676746cf5ffada57f866923cef445de938c /isisd
parent[ospfd/isisd] Switch to lib/ Fletcher checksum, fixing bug in isisd (diff)
downloadfrr-69954565621127a62c11ec315b175b930230c217.tar.xz
frr-69954565621127a62c11ec315b175b930230c217.zip
[isisd:DLPI] Try open vanity-named DLPI dev before style 1,2
2008-08-13 Jingjing Duan <Jingjing.Duan@sun.com> * isisd/isis_dlpi.c: (open_dlpi_dev) Clearview-UV device nodes are under /dev/net, try opening there before attempting style 1 or 2 names. Signed-off-by: Paul Jakma <paul@quagga.net>
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_dlpi.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c
index e61dd1666..3cbe0b4fc 100644
--- a/isisd/isis_dlpi.c
+++ b/isisd/isis_dlpi.c
@@ -313,12 +313,23 @@ open_dlpi_dev (struct isis_circuit *circuit)
circuit->interface->name);
return ISIS_WARNING;
}
-
- /* Try first as Style 1 */
- (void) snprintf(devpath, sizeof (devpath), "/dev/%s",
- circuit->interface->name);
- unit = -1;
- fd = dlpiopen (devpath, &acklen);
+
+ /* 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)