make the network configuration easy more.

发表于:2007-05-26来源:作者:点击数: 标签:
Unlike linux , the netcard's name of freebsd is various. Why not make it simple? Try the patch. After patch, every physical netcard will be named like eth0, eth1. diff -ruN sys/net/if_ethersubr.c sys/net/if_ethersubr.c.orig --- sys/net/if_
Unlike linux, the netcard's name of freebsd is various. Why not make it simple? Try the patch. After patch, every physical netcard will be named like "eth0", "eth1".

diff -ruN sys/net/if_ethersubr.c sys/net/if_ethersubr.c.orig
--- sys/net/if_ethersubr.c    Tue May 24 13:14:42 2005
+++ sys/net/if_ethersubr.c.orig    Tue May 24 13:14:32 2005
@@ -828,8 +828,6 @@
 /*
  * Perform common duties while attaching to interface list
  */
-static int unit = 0;
-char *ifname = "eth";
 void
 ether_ifattach(ifp, bpf)
     register struct ifnet *ifp;
@@ -838,8 +836,6 @@
     register struct ifaddr *ifa;
     register struct sockaddr_dl *sdl;
 
-    ifp->if_name = ifname;
-    ifp->if_unit = unit++;
     ifp->if_type = IFT_ETHER;
     ifp->if_addrlen = 6;
     ifp->if_hdrlen = 14;
 

原文转自:http://www.ltesting.net