if_xname ... here we go

Matthew Dillon dillon at apollo.backplane.com
Mon Jan 5 18:29:41 PST 2004


    I've committed the easy parts.   I have the rest in my tree ready to
    go... I added additional #if checks in the contrib code as per your notes.

    In reviewing the code I have one question.  Take the code in 
    netif/ed/if_ed.c as an example:

RCS file: /cvs/src/sys/dev/netif/ed/if_ed.c,v
retrieving revision 1.6
diff -u -w -r1.6 if_ed.c
--- sys/dev/netif/ed/if_ed.c    20 Nov 2003 22:07:27 -0000      1.6
+++ sys/dev/netif/ed/if_ed.c    6 Jan 2004 01:13:21 -0000
@@ -1593,13 +1593,11 @@
         */
        ed_stop(sc);
 
-       if (!ifp->if_name) {
                /*
                 * Initialize ifnet structure
                 */
                ifp->if_softc = sc;
-               ifp->if_unit = unit;
-               ifp->if_name = "ed";
+       if_initname(ifp, "ed", unit);
                ifp->if_output = ether_output;
                ifp->if_start = ed_start;
                ifp->if_ioctl = ed_ioctl;
@@ -1637,13 +1635,13 @@
                 * Attach the interface
                 */
                ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
-       }
+

    My question is, why did you remove the if (!ifp->if_name) {
    conditional?  It seems to be checking to see if an interface is
    being re-initialized and is not reloading the already loaded fields
    if so.  In particular, it is not calling ether_ifattach() again.

    I'm not sure if the reload scenario is possible here but if so I
    think we need some sort of conditional there so as not to 
    call ether_ifattach() multiple times.

    There are a couple of a IF files where you've done this.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Submit mailing list