diff options
Diffstat (limited to 'src/transport/gnunet-helper-transport-wlan.c')
-rw-r--r-- | src/transport/gnunet-helper-transport-wlan.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c index 515da4334..4b4d5426e 100644 --- a/src/transport/gnunet-helper-transport-wlan.c +++ b/src/transport/gnunet-helper-transport-wlan.c | |||
@@ -139,11 +139,20 @@ | |||
139 | 139 | ||
140 | /** | 140 | /** |
141 | * Packet format type for the messages we receive from | 141 | * Packet format type for the messages we receive from |
142 | * the kernel. This is for Ethernet 10Mbps format (no | ||
143 | * performance information included). | ||
144 | */ | ||
145 | #define ARPHRD_ETHER 1 | ||
146 | |||
147 | |||
148 | /** | ||
149 | * Packet format type for the messages we receive from | ||
142 | * the kernel. This is for plain messages (with no | 150 | * the kernel. This is for plain messages (with no |
143 | * performance information included). | 151 | * performance information included). |
144 | */ | 152 | */ |
145 | #define ARPHRD_IEEE80211 801 | 153 | #define ARPHRD_IEEE80211 801 |
146 | 154 | ||
155 | |||
147 | /** | 156 | /** |
148 | * Packet format type for the messages we receive from | 157 | * Packet format type for the messages we receive from |
149 | * the kernel. This is for the PRISM format. | 158 | * the kernel. This is for the PRISM format. |
@@ -1588,6 +1597,17 @@ linux_read (struct HardwareInfos *dev, | |||
1588 | case ARPHRD_IEEE80211: | 1597 | case ARPHRD_IEEE80211: |
1589 | n = 0; /* no header */ | 1598 | n = 0; /* no header */ |
1590 | break; | 1599 | break; |
1600 | case ARPHRD_ETHER: | ||
1601 | { | ||
1602 | ; | ||
1603 | |||
1604 | if (sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) > caplen) | ||
1605 | return 0; /* invalid */ | ||
1606 | memcpy (&buf[sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame)], | ||
1607 | tmpbuf + sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame), | ||
1608 | caplen - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) - 4 /* 4 byte FCS */); | ||
1609 | return caplen - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) - 4; | ||
1610 | } | ||
1591 | default: | 1611 | default: |
1592 | errno = ENOTSUP; /* unsupported format */ | 1612 | errno = ENOTSUP; /* unsupported format */ |
1593 | return -1; | 1613 | return -1; |
@@ -1652,6 +1672,7 @@ open_device_raw (struct HardwareInfos *dev) | |||
1652 | return 1; | 1672 | return 1; |
1653 | } | 1673 | } |
1654 | if (((ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) && | 1674 | if (((ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) && |
1675 | (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) && | ||
1655 | (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) && | 1676 | (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) && |
1656 | (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL)) ) | 1677 | (ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL)) ) |
1657 | { | 1678 | { |