make the network configuration easy more.

2009-05-13 01:03:22来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

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;
 

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/132/showart_27660.html

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:《解决“FreeBSD NAT 较Win2ksNAT慢”难题备忘录》

下一篇:UNIX711问题集锦