aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-11-16 16:39:32 +0000
committerChristian Grothoff <christian@grothoff.org>2012-11-16 16:39:32 +0000
commit8c273cebdbd6e9257d5bc407d60e0d2ef1303c6d (patch)
treee6ad31108c0c596490da58960427b26fc51df3ea
parenta3b2f6a3e531bc25391c0b1221f14662c850ce1e (diff)
downloadgnunet-8c273cebdbd6e9257d5bc407d60e0d2ef1303c6d.tar.gz
gnunet-8c273cebdbd6e9257d5bc407d60e0d2ef1303c6d.zip
-cleaner error reporting
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index 9920b69ba..515da4334 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -1651,6 +1651,15 @@ open_device_raw (struct HardwareInfos *dev)
1651 IFNAMSIZ, dev->iface, strerror (errno)); 1651 IFNAMSIZ, dev->iface, strerror (errno));
1652 return 1; 1652 return 1;
1653 } 1653 }
1654 if (((ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) &&
1655 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) &&
1656 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL)) )
1657 {
1658 fprintf (stderr, "Error: interface `%.*s' is not using a supported hardware address family (got %d)\n",
1659 IFNAMSIZ, dev->iface,
1660 ifr.ifr_hwaddr.sa_family);
1661 return 1;
1662 }
1654 1663
1655 /* lookup iw mode */ 1664 /* lookup iw mode */
1656 memset (&wrq, 0, sizeof (struct iwreq)); 1665 memset (&wrq, 0, sizeof (struct iwreq));
@@ -1662,12 +1671,8 @@ open_device_raw (struct HardwareInfos *dev)
1662 wrq.u.mode = IW_MODE_MONITOR; 1671 wrq.u.mode = IW_MODE_MONITOR;
1663 } 1672 }
1664 1673
1665 if (((ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) && 1674 if ( (wrq.u.mode != IW_MODE_MONITOR) &&
1666 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) && 1675 (wrq.u.mode != IW_MODE_ADHOC) )
1667 (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL)) ||
1668 ( (wrq.u.mode != IW_MODE_MONITOR) &&
1669 (wrq.u.mode != IW_MODE_ADHOC) ))
1670
1671 { 1676 {
1672 fprintf (stderr, "Error: interface `%.*s' is not in monitor or ad-hoc mode (got %d)\n", 1677 fprintf (stderr, "Error: interface `%.*s' is not in monitor or ad-hoc mode (got %d)\n",
1673 IFNAMSIZ, dev->iface, 1678 IFNAMSIZ, dev->iface,