summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-07-11 07:56:29 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2014-05-14 16:46:22 +0200
commit4b4bda9bb1913579bd54667f62fafe58e2746478 (patch)
tree11b3a421f85686544d95425c13608736226a7225
parent7a9d983e4f961c2103f2cf82a51d5d8321ad0e43 (diff)
downloadquagga-4b4bda9bb1913579bd54667f62fafe58e2746478.tar.bz2
quagga-4b4bda9bb1913579bd54667f62fafe58e2746478.tar.xz
ospfd: don't allow to set network type on loopback interfaces
OSPFd only allocates some stub information for loopback interfaces. This causes a crash when the interface state machine is started on that interface by configuring a different network type. It doesn't make much sense to configure the network type of a loopback interface, therefore, just forbid it. See also bugzilla #670. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--ospfd/ospf_vty.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 1489b20a..ee8c9019 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -5309,7 +5309,13 @@ DEFUN (ip_ospf_network,
struct interface *ifp = vty->index;
int old_type = IF_DEF_PARAMS (ifp)->type;
struct route_node *rn;
-
+
+ if (old_type == OSPF_IFTYPE_LOOPBACK)
+ {
+ vty_out (vty, "This is a loopback interface. Can't set network type.%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
if (strncmp (argv[0], "b", 1) == 0)
IF_DEF_PARAMS (ifp)->type = OSPF_IFTYPE_BROADCAST;
else if (strncmp (argv[0], "n", 1) == 0)