diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-11-23 23:31:33 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-11-23 23:31:33 +0000 |
commit | b523874cefe6f005a3056cfeb0de28db4907515d (patch) | |
tree | 08c0390b63dbb75bac67da3a394140cd051639a0 /sys/net/if.c | |
parent | 410699c6a25c48ffab6a3b08da24d9f056e6e788 (diff) | |
download | FreeBSD-src-b523874cefe6f005a3056cfeb0de28db4907515d.zip FreeBSD-src-b523874cefe6f005a3056cfeb0de28db4907515d.tar.gz |
Assign if_broadcastaddr to NULL not 0 in if_attach().
Printf() a warning if if_attachdomain() is called more than once on an
interface to generate some noise on mailing lists when this occurs.
Fix up style in if_start(), where spaces crept in instead of tabs at
some point.
MFC after: 1 week
MFC note: Not the printf().
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index b93e81b..f6728df 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -444,7 +444,7 @@ if_attach(struct ifnet *ifp) sdl->sdl_data[--namelen] = 0xff; ifa->ifa_refcnt = 1; TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); - ifp->if_broadcastaddr = 0; /* reliably crash if used uninitialized */ + ifp->if_broadcastaddr = NULL; /* reliably crash if used uninitialized */ ifp->if_snd.altq_type = 0; ifp->if_snd.altq_disc = NULL; ifp->if_snd.altq_flags &= ALTQF_CANTCHANGE; @@ -493,6 +493,8 @@ if_attachdomain1(struct ifnet *ifp) if (ifp->if_afdata_initialized) { IF_AFDATA_UNLOCK(ifp); splx(s); + printf("if_attachdomain called more than once on %s\n", + ifp->if_xname); return; } ifp->if_afdata_initialized = 1; @@ -1920,15 +1922,15 @@ if_start(struct ifnet *ifp) { NET_ASSERT_GIANT(); - - if ((ifp->if_flags & IFF_NEEDSGIANT) != 0 && debug_mpsafenet != 0) { - if (mtx_owned(&Giant)) - (*(ifp)->if_start)(ifp); - else + + if ((ifp->if_flags & IFF_NEEDSGIANT) != 0 && debug_mpsafenet != 0) { + if (mtx_owned(&Giant)) + (*(ifp)->if_start)(ifp); + else taskqueue_enqueue(taskqueue_swi_giant, &ifp->if_starttask); - } else - (*(ifp)->if_start)(ifp); + } else + (*(ifp)->if_start)(ifp); } static void |