diff options
| author | 2009-09-20 20:45:06 +0000 | |
|---|---|---|
| committer | 2009-09-20 20:45:06 +0000 | |
| commit | 90a39e67b908dfa84c0f4b0a29c669469567cc7b (patch) | |
| tree | 93117e07eb76e3995c70659a5923c316f87b1c44 /usr.sbin/ospf6d/interface.c | |
| parent | In kif_update(), the ifname array could be used uninitialised if the (diff) | |
| download | wireguard-openbsd-90a39e67b908dfa84c0f4b0a29c669469567cc7b.tar.xz wireguard-openbsd-90a39e67b908dfa84c0f4b0a29c669469567cc7b.zip | |
if_new() would treat the new interface as a virtual link if the ifname
parameter was NULL. But it's easy enough to make ifname != NULL by accident,
e.g. by passing a zeroed or even uninitialised array. This function should
accept a 'virtual' flag of some kind instead.
Since we don't even support virtual links yet, change the check to
"if (virtual)", #if 0 the check, and code that depends on it (including
a file-scope variable), and add comments marking this as TODO.
ok claudio, who requested #if 0 instead of deletion.
Diffstat (limited to 'usr.sbin/ospf6d/interface.c')
| -rw-r--r-- | usr.sbin/ospf6d/interface.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c index ccbc66e531f..83d95c57e0d 100644 --- a/usr.sbin/ospf6d/interface.c +++ b/usr.sbin/ospf6d/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.14 2009/03/29 16:24:38 stsp Exp $ */ +/* $OpenBSD: interface.c,v 1.15 2009/09/20 20:45:06 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -68,7 +68,10 @@ struct { {-1, IF_EVT_NOTHING, IF_ACT_NOTHING, 0}, }; +#if 0 +/* TODO virtual links */ static int vlink_cnt = 0; +#endif TAILQ_HEAD(, iface) iflist; @@ -211,7 +214,9 @@ if_new(u_short ifindex, char *ifname) TAILQ_INIT(&iface->ls_ack_list); RB_INIT(&iface->lsa_tree); - if (ifname == NULL) { +#if 0 + /* TODO */ + if (virtual) { iface->type = IF_TYPE_VIRTUALLINK; snprintf(iface->name, sizeof(iface->name), "vlink%d", vlink_cnt++); @@ -219,7 +224,7 @@ if_new(u_short ifindex, char *ifname) iface->mtu = IP_MSS; return (iface); } - +#endif strlcpy(iface->name, ifname, sizeof(iface->name)); iface->ifindex = ifindex; |
