- Timestamp:
- Dec 25, 2020 2:51:44 AM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r82968 r87126 1254 1254 { 1255 1255 unsigned short ar_hrd; /* format of hardware address */ 1256 #define ARPHRD_ETHER 1 /* ethernet hardware format */ 1256 1257 unsigned short ar_pro; /* format of protocol address */ 1257 1258 unsigned char ar_hln; /* length of hardware address */ 1258 1259 unsigned char ar_pln; /* length of protocol address */ 1259 1260 unsigned short ar_op; /* ARP opcode (command) */ 1261 #define ARPOP_REQUEST 1 /* ARP request */ 1262 #define ARPOP_REPLY 2 /* ARP reply */ 1260 1263 1261 1264 /* … … 1323 1326 struct ethhdr *pEtherHeader; 1324 1327 struct arphdr *pARPHeader; 1328 int ar_op; 1325 1329 uint32_t ip4TargetAddress; 1326 1330 1327 int ar_op; 1331 /* drivers never return runt packets, so this should never happen */ 1332 if (RT_UNLIKELY((size_t)m->m_len 1333 < sizeof(struct ethhdr) + sizeof(struct arphdr))) 1334 goto done; 1335 1328 1336 pEtherHeader = mtod(m, struct ethhdr *); 1329 1337 pARPHeader = (struct arphdr *)&pEtherHeader[1]; 1338 1339 if (RT_UNLIKELY( pARPHeader->ar_hrd != RT_H2N_U16_C(ARPHRD_ETHER) 1340 || pARPHeader->ar_pro != RT_H2N_U16_C(ETH_P_IP) 1341 || pARPHeader->ar_hln != ETH_ALEN 1342 || pARPHeader->ar_pln != sizeof(RTNETADDRIPV4))) 1343 goto done; 1330 1344 1331 1345 ar_op = RT_N2H_U16(pARPHeader->ar_op); … … 1365 1379 } 1366 1380 1381 done: 1367 1382 m_freem(pData, m); 1368 1383 } -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r85195 r87126 390 390 # define ETH_HLEN 14 391 391 392 # define ARPOP_REQUEST 1 /* ARP request */393 # define ARPOP_REPLY 2 /* ARP reply */394 395 392 struct ethhdr 396 393 {
Note:
See TracChangeset
for help on using the changeset viewer.