virtualize rtsol test for wireless interfaces in network.subr

View: New views
1 Messages — Rating Filter:   Alert me  

virtualize rtsol test for wireless interfaces in network.subr

by Doug Barton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I recently added a test in network.subr (for 8.x only) to make sure
that we are not trying IPv6 rtsol on the underlying wireless
interfaces. Sam subsequently asked me to make that test virtual rather
then listing specific interfaces, which I agreed was definitely the
better approach.

The attached patch moves is_wired_interface() into network.subr,
simplifies it a bit, and uses that method in the rtsol test as well.
Please let me know what you think.

I'd like to get this into 8.0-RELEASE, but I don't regard it as crucial.


Doug

--

    This .signature sanitized for your protection


Index: network.subr
===================================================================
--- network.subr (revision 196279)
+++ network.subr (working copy)
@@ -816,6 +816,18 @@
  echo ${str}
 }
 
+is_wired_interface()
+{
+ local media
+
+ case `ifconfig $1 2>/dev/null` in
+ *media:?Ethernet*) media=Ethernet ;;
+ esac
+
+ test "$media" = "Ethernet"
+}
+
+
 # Setup the interfaces for IPv6
 network6_interface_setup()
 {
@@ -858,14 +870,19 @@
  ifconfig $i inet6 ${ipv6_ifconfig} alias
  fi
 
+ # Wireless NIC cards are virtualized through the wlan interface
+ if ! is_wired_interface ${i}; then
+ case "${i}" in
+ wlan*) rtsol_available=yes ;;
+ *) rtsol_available=no ;;
+ esac
+ fi
+
  if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
  then
  case ${i} in
  lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*|pflog[0-9]*|pfsync[0-9]*)
  ;;
- # Wireless NIC cards are virtualized through the wlan interface
- an[0-9]*|ath[0-9]*|ipw[0-9]*|iwi[0-9]*|iwn[0-9]*|ral[0-9]*|wi[0-9]*|wl[0-9]*|wpi[0-9]*)
- ;;
  *)
  rtsol_interfaces="${rtsol_interfaces} ${i}"
  ;;
Index: rc.d/wpa_supplicant
===================================================================
--- rc.d/wpa_supplicant (revision 196279)
+++ rc.d/wpa_supplicant (working copy)
@@ -18,18 +18,6 @@
  return 1
 fi
 
-is_wired_interface()
-{
- media=`ifconfig $1 2>/dev/null | while read line; do
- case "$line" in
- *media:?Ethernet*)
- echo Ethernet
- ;;
- esac
- done`
- test "$media" = "Ethernet"
-}
-
 is_ndis_interface()
 {
  case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in

_______________________________________________
freebsd-rc@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "freebsd-rc-unsubscribe@..."